@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta Exata Requisitada */
  --sidebar-bg: #2A201A;             /* Marrom Escuro */
  --sidebar-hover: #382c24;
  --sidebar-active: #4a3a30;
  --sidebar-border: #44342a;

  --accent-secondary: #7B243B;        /* Borgonha */
  --accent-secondary-hover: #932c47;
  --accent-secondary-light: rgba(123, 36, 59, 0.12);

  --accent-primary: #D4A76A;          /* Ocre Dourado */
  --accent-primary-hover: #c49658;
  --accent-primary-light: rgba(212, 167, 106, 0.18);

  --bg-dark: #2A201A;
  --bg-content: #F9F8F6;              /* Cinza Quente Claro */
  --bg-card: #FFFFFF;                 /* Fundo de Cartões no Conteúdo */
  --bg-card-hover: #fbf9f6;
  --border-color: #E6E1DC;            /* Borda sutil quente */

  --text-main: #4A4A4A;               /* Carvão */
  --text-dark: #2A201A;               /* Marrom quase preto para títulos */
  --text-muted: #78716c;              /* Cinza médio neutro quente */
  --text-dim: #a8a29e;
  --text-white: #FFFFFF;              /* Branco */

  /* Sucesso e Alertas */
  --accent-emerald: #10b981;
  --accent-emerald-bg: #ecfdf5;
  --accent-amber: #D4A76A;
  --accent-rose: #ef4444;
  --accent-rose-bg: #fef2f2;
  --accent-cyan: #7B243B;

  --shadow-glow: 0 0 16px rgba(212, 167, 106, 0.25);
  --shadow-card: 0 4px 18px rgba(42, 32, 26, 0.05);
  --shadow-lg: 0 10px 30px rgba(42, 32, 26, 0.08);

  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-content);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

/* Layout Geral: Sidebar Esquerda Fixa + Wrapper Principal */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ========================================================
   MENU LATERAL (SIDEBAR) — #2A201A
   ======================================================== */
.app-sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--sidebar-bg);
  color: var(--text-white);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 90;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-hover) transparent;
}

/* Logo e Identidade: Barra toda branca no topo do menu */
.sidebar-brand {
  background: #FFFFFF;
  width: 100%;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #E6E1DC;
  box-shadow: 0 2px 6px rgba(42, 32, 26, 0.05);
}

.sidebar-brand-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.sidebar-brand-logo-img {
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #7B243B 0%, #2A201A 100%);
  border: 1px solid #D4A76A;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #D4A76A;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-main {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

/* Campo de Pesquisa Arredondado */
.sidebar-search-box {
  position: relative;
  margin: 14px 16px 10px 16px;
}

.sidebar-search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #D4A76A;
  pointer-events: none;
}

.sidebar-search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9999px !important;
  padding: 9px 12px 9px 36px !important;
  color: #FFFFFF !important;
  font-size: 12.5px !important;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.sidebar-search-box input::placeholder {
  color: #a89f91;
  font-size: 12px;
}

.sidebar-search-box input:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: #D4A76A !important;
  box-shadow: 0 0 0 2px rgba(212, 167, 106, 0.25) !important;
}

/* Seções da Sidebar */
.sidebar-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #D4A76A;
  margin-bottom: 10px;
}

/* Card do Curso Ativo na Sidebar */
.sidebar-course-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.course-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-icon-badge {
  font-size: 18px;
  width: 32px;
  height: 32px;
  background: rgba(212, 167, 106, 0.15);
  border: 1px solid rgba(212, 167, 106, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.course-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.course-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-role {
  font-size: 10px;
  color: #D4A76A;
  font-weight: 600;
  margin-top: 2px;
}

.course-buttons-row {
  display: flex;
  gap: 6px;
}

.btn-sidebar-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sidebar-action:hover {
  background: #7B243B;
  border-color: #7B243B;
  color: #FFFFFF;
}

.btn-sidebar-admin {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #7B243B;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.btn-sidebar-admin:hover {
  background: #932c47;
}

/* Árvore Pedagógica na Sidebar */
.sidebar-tree-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-nav-item {
  position: relative;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #ded7ce;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.sidebar-nav-item.active .sidebar-nav-link,
.sidebar-nav-link.active {
  background: rgba(212, 167, 106, 0.18);
  color: #FFFFFF;
  font-weight: 600;
  border-left: 3px solid #D4A76A;
}

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-counter {
  font-size: 11px;
  font-weight: 700;
  background: rgba(123, 36, 59, 0.4);
  color: #fbcfe8;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(123, 36, 59, 0.6);
}

.nav-counter.gold {
  background: rgba(212, 167, 106, 0.3);
  color: #fef08a;
  border-color: #D4A76A;
}

.sidebar-submenu-list {
  list-style: none;
  margin: 4px 0 6px 26px;
  padding-left: 10px;
  border-left: 1px dashed rgba(212, 167, 106, 0.4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  color: #c4bbae;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-sub-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-sub-item.active {
  color: #D4A76A;
  font-weight: 700;
}

.tree-dot {
  width: 6px;
  height: 6px;
  background-color: #D4A76A;
  border-radius: 50%;
}

.leaf-label {
  font-size: 11px;
}

/* Rodapé do Menu Lateral */
.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-user-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #7B243B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #D4A76A;
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-fullname {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-role {
  font-size: 10px;
  color: #D4A76A;
}

.btn-logout-sidebar {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-logout-sidebar:hover {
  background: #ef4444;
  color: #FFFFFF;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-user-action-sidebar {
  background: rgba(212, 167, 106, 0.12);
  border: 1px solid rgba(212, 167, 106, 0.28);
  color: #D4A76A;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.btn-user-action-sidebar:hover {
  background: #D4A76A;
  border-color: #D4A76A;
  color: #1A1A1A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 167, 106, 0.35);
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 40px !important;
}

.btn-toggle-password-visibility {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #78716c;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.btn-toggle-password-visibility:hover {
  color: #2A201A;
}

.input-error-shake {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  animation: pwdShake 0.35s ease-in-out;
}

@keyframes pwdShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ========================================================
   ÁREA PRINCIPAL (WRAPPER: CABEÇALHO + TABS + CONTEÚDO)
   ======================================================== */
.app-main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-content);
  background-image: url('/bg-pattern.jpg');
  background-repeat: repeat;
  background-attachment: fixed;
  background-size: 1024px auto;
}

/* Top Header */
.app-top-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: 0 1px 4px rgba(42, 32, 26, 0.03);
}

.top-course-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dark);
}

.top-course-title {
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
}

.top-course-sep {
  color: var(--text-dim);
}

.top-course-cycle {
  font-weight: 500;
  color: var(--text-muted);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #a7f3d0;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

.header-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(123, 36, 59, 0.08);
  border: 1px solid rgba(123, 36, 59, 0.2);
  color: #7B243B;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
}

.header-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 167, 106, 0.12);
  border: 1px solid rgba(212, 167, 106, 0.3);
  color: #7c5417;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
}

.btn-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.btn-icon-circle:hover {
  background: #F9F8F6;
  border-color: #D4A76A;
}

/* ========================================================
   STEPPER NAVIGATION (CHEVRON PIPELINE CONFORME A IMAGEM)
   ======================================================== */
.nav-tabs-container {
  background: #EFECE6;
  border-bottom: 1px solid #DDD8D1;
  padding: 10px 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: 0 2px 6px rgba(42, 32, 26, 0.04);
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 24px 9px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #57534e;
  background: #FFFFFF;
  border: 1px solid #D6D1CA;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%, 14px 50%);
  margin-left: -8px;
}

.tab-btn:first-child {
  clip-path: polygon(0% 0%, calc(100% - 14px) 0%, 100% 50%, calc(100% - 14px) 100%, 0% 100%);
  margin-left: 0;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.tab-btn:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.tab-btn:hover {
  background: #F9F8F6;
  color: #2A201A;
}

/* Etapas Anteriores Concluídas: Borgonha (#7B243B) */
.tab-btn.completed {
  background: #7B243B;
  color: #FFFFFF;
  border-color: #7B243B;
}

.tab-btn.completed .tab-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* Etapa Ativa: Ocre Dourado (#D4A76A) */
.tab-btn.active {
  background: #D4A76A;
  color: #2A201A;
  border-color: #D4A76A;
  font-weight: 700;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(212, 167, 106, 0.4);
}

.tab-btn.active .tab-badge {
  background: rgba(42, 32, 26, 0.2);
  color: #2A201A;
}

.tab-badge {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* ========================================================
   ESTILOS DE BOTÕES REQUISITADOS
   ======================================================== */
.btn-quick-actions-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #D4A76A;
  color: #2A201A;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid rgba(42, 32, 26, 0.15);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 167, 106, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-quick-actions-pill:hover {
  background: #c49658;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212, 167, 106, 0.45);
}

.btn-action-burgundy,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #7B243B;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(123, 36, 59, 0.2);
  transition: all 0.2s ease;
}

.btn-action-burgundy:hover,
.btn-secondary:hover {
  background: #932c47;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123, 36, 59, 0.35);
}

.btn-primary,
.btn-action-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #D4A76A;
  color: #2A201A;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid rgba(42, 32, 26, 0.12);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 167, 106, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-action-gold:hover {
  background: #c49658;
  color: #2A201A;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212, 167, 106, 0.4);
}

/* Main Container */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.tab-content,
.step-content {
  display: none;
  min-width: 0;
  width: 100%;
}

.tab-content.active,
.step-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Layout */
.grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.left-col {
  min-width: 0;
  width: 100%;
}

.sidebar {
  min-width: 0;
  width: 100%;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1140px) {
  .grid-2col {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
  min-width: 0;
}

.section-card:hover {
  border-color: rgba(212, 167, 106, 0.5);
  box-shadow: 0 6px 22px rgba(42, 32, 26, 0.08);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(123, 36, 59, 0.1);
  color: var(--accent-secondary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(123, 36, 59, 0.25);
}

.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.span-2 {
  grid-column: span 2;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

input, select, textarea {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.25);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  width: 40px;
  height: 38px;
  padding: 2px;
  cursor: pointer;
  border-radius: 6px;
}

/* Upload zone */
.dropzone {
  border: 2px dashed #D4A76A;
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  background: rgba(212, 167, 106, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover {
  border-color: var(--accent-secondary);
  background: rgba(123, 36, 59, 0.05);
}

.dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.dropzone-icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}

.file-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 13px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.file-item:hover {
  background: #FAF8F5;
  border-color: #D4A76A;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-item-name {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-delete-file {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-delete-file:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Mode Selection Cards (Tab 2) */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.mode-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
}

.mode-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.mode-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.mode-desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

/* Prompt Box Viewer */
.prompt-viewer {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #cbd5e1;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

/* Audit Table (Tab 3) */
.audit-progress-card {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  color: var(--text-main);
}

.progress-bar-bg {
  width: 240px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  width: 0%;
  transition: width 0.3s ease;
}

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th {
  background: #FAF8F5;
  padding: 14px 18px;
  color: #7B243B;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 18px;
  border-bottom: 1px solid #F0ECE8;
  color: var(--text-main);
}

tr:hover td {
  background: #FAF8F5;
}

/* Badges */
.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-validated { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Modal for HTML Preview */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(42, 32, 26, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#preview-modal.active {
  z-index: 10001 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
}

#question-scores-modal {
  display: none;
}

#question-scores-modal.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
}

.modal-content,
.modal-container {
  background: #FFFFFF;
  border: 1px solid #DDD8D1;
  border-radius: var(--radius-lg);
  width: 95vw;
  max-width: 1360px;
  height: 92vh;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(42, 32, 26, 0.25);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #E5DFD7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF8F5;
}

.modal-body {
  flex: 1;
  background: #ffffff;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #E5DFD7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FAF8F5;
}

/* Modal de Pré-Visualização com Split View e Painel de Intervenção */
.modal-preview-split {
  width: 96vw;
  max-width: 1560px;
  height: 94vh;
  max-height: 98vh;
}

.intervention-pane {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.intervention-pane.collapsed {
  width: 0 !important;
  max-width: 0 !important;
  border-left: none !important;
  opacity: 0;
  pointer-events: none;
}

.intervention-tab {
  transition: all 0.2s ease;
}

.intervention-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.intervention-tab.active {
  color: #818cf8 !important;
  border-bottom-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.1) !important;
}

.quick-pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-pill-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
}

/* Question Pill Buttons in Pareamento */
.question-pill-btn {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.question-pill-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-indigo);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Console Log Box */
.console-box {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: #e2e8f0;
  max-height: 240px;
  overflow-y: auto;
  line-height: 1.5;
}

.log-entry { margin-bottom: 4px; display: flex; gap: 8px; }
.log-time { color: var(--text-dim); }
.log-info { color: var(--accent-cyan); }
.log-success { color: var(--accent-emerald); }
.log-error { color: var(--accent-rose); }

/* Step Content & Stepper Navigation */
.step-content {
  display: none;
}
.step-content.active {
  display: block;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: bold;
  margin-right: 6px;
}

.tab-btn.active .step-num {
  background: var(--accent-primary);
  color: #ffffff;
}

/* ========================================================
   LINHA DO TEMPO HORIZONTAL DAS TRILHAS (Passo 4)
   ======================================================== */
.trilhas-timeline-container {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.timeline-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.timeline-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

.timeline-count-badge {
  background: rgba(123, 36, 59, 0.1);
  color: var(--accent-secondary);
  border: 1px solid rgba(123, 36, 59, 0.25);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
}

.timeline-scroll-track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: 8px 4px 14px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.timeline-scroll-track::-webkit-scrollbar {
  height: 6px;
}

.timeline-scroll-track::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  max-width: 180px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.timeline-item:hover {
  background-color: #F9F8F6;
  transform: translateY(-2px);
}

.timeline-item.active {
  background: rgba(212, 167, 106, 0.12);
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.timeline-node-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7B243B 0%, #2A201A 100%);
  border: 2px solid #D4A76A;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(42, 32, 26, 0.15);
  transition: all 0.25s ease;
}

.timeline-item:hover .timeline-node-circle {
  border-color: #FFFFFF;
  box-shadow: 0 0 14px rgba(212, 167, 106, 0.6);
  transform: scale(1.08);
}

.timeline-item.active .timeline-node-circle {
  border-color: #FFFFFF;
  background: linear-gradient(135deg, #D4A76A 0%, #b88a4c 100%);
  color: #2A201A;
  box-shadow: 0 0 16px rgba(212, 167, 106, 0.8);
}

.timeline-node-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-node-info {
  margin-top: 8px;
  text-align: center;
  width: 100%;
}

.timeline-node-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 32px;
}

.timeline-node-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.timeline-connector {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  margin-top: 20px;
  position: relative;
}

.timeline-connector-bar {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #7B243B 0%, #D4A76A 100%);
}

.timeline-connector-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #FFFFFF;
  padding: 0 3px;
  color: #D4A76A;
  font-size: 10px;
  font-weight: 800;
}

/* ========================================================
   CARDS DE TRILHA COLAPSÁVEIS (Passo 4)
   ======================================================== */
.trilha-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(42, 32, 26, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.trilha-editor-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(42, 32, 26, 0.08);
}

.trilha-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #FFFFFF;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.trilha-editor-card:not(.collapsed) .trilha-card-header {
  border-bottom-color: var(--border-color);
  background-color: #FCFBF9;
}

.trilha-card-header:hover {
  background-color: #F8F6F3;
}

.trilha-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.trilha-collapse-toggle-btn {
  background: transparent;
  border: 1px solid #D6D1CA;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.trilha-collapse-toggle-btn:hover {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

.trilha-collapse-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.trilha-editor-card.collapsed .trilha-collapse-icon {
  transform: rotate(-90deg);
}

.trilha-badge-num {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #7B243B 0%, #2A201A 100%);
  color: #FFFFFF;
  flex-shrink: 0;
}

.trilha-titulo-input {
  font-family: 'Poppins', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-dark);
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 8px;
  border-radius: 6px;
  flex: 1;
  max-width: 520px;
  transition: all 0.2s ease;
}

.trilha-titulo-input:hover {
  border-color: #D6D1CA;
  background: #FFFFFF;
}

.trilha-titulo-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(212, 167, 106, 0.2);
}

.trilha-summary-chip {
  background: rgba(123, 36, 59, 0.08);
  color: var(--accent-secondary);
  border: 1px solid rgba(123, 36, 59, 0.2);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.trilha-card-body {
  padding: 20px;
  background: #FFFFFF;
  transition: all 0.25s ease;
}

.trilha-editor-card.collapsed .trilha-card-body {
  display: none;
}

@keyframes pulseHighlightFocus {
  0% { box-shadow: 0 0 0 4px rgba(212, 167, 106, 0.85); }
  70% { box-shadow: 0 0 0 4px rgba(212, 167, 106, 0.4); }
  100% { box-shadow: 0 2px 8px rgba(42, 32, 26, 0.04); }
}

.trilha-editor-card.highlight-focus {
  animation: pulseHighlightFocus 1.6s ease-out;
  border-color: var(--accent-primary) !important;
}


.revisoes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Abas de Trilhas no Passo 5/6 */
.trilha-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.trilha-tab-btn:hover {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--text-dark);
}

.trilha-tab-btn.active {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(123, 36, 59, 0.2);
}

.trilha-tab-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Card de Trilha no Quadro do Passo 5/6 */
.trilha-board-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.trilha-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.trilha-pages-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.trilha-page-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.trilha-page-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(212, 167, 106, 0.15);
}

/* Estado Vazio das Trilhas */
.trilhas-empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  margin: 16px 0 24px 0;
  box-shadow: var(--shadow-card);
}

.trilhas-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-primary-light);
  color: var(--accent-secondary);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

#btn-resume-generation {
  transition: all 0.2s ease;
}

#btn-resume-generation:hover:not(:disabled) {
  background: rgba(123, 36, 59, 0.09) !important;
  border-color: #5a1a2b !important;
  color: #5a1a2b !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(123, 36, 59, 0.15);
}

#btn-resume-generation:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Painel de Progresso Unificado de Geração */
.pipeline-progress-box {
  background: #FFFFFF;
  border: 1px solid var(--accent-primary);
  border-left: 5px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(42, 32, 26, 0.08);
}

.pipeline-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.pipeline-step-item {
  background: var(--bg-content);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.pipeline-step-item.active {
  background: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--text-dark);
  font-weight: 700;
}

.pipeline-step-item.done {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  font-weight: 600;
}

.pipeline-step-item.done::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  margin-right: 4px;
}

/* Galeria de Figuras no Passo 3 */
.img-preview-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.05);
}

.img-preview-card img {
  max-width: 100%;
  height: 140px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 4px;
  padding: 4px;
}

/* Progress & Spinner for AI Refinement */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pulse-glow {
  animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
  from {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
  }
  to {
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.4);
    border-color: rgba(6, 182, 212, 0.8);
  }
}

/* ==========================================================================
   Modal de Revisão Manual de Questões Suspeitas
   ========================================================================== */
.modal-review-container {
  width: 96vw;
  max-width: 1500px;
  height: 94vh;
  max-height: 96vh;
  background: #FFFFFF;
  border: 1px solid #DDD8D1;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(42, 32, 26, 0.25);
}

.review-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #F9F8F6;
  overflow: hidden;
}

/* Sidebar Esquerda (Lista de Questões) */
.review-sidebar {
  width: 380px;
  min-width: 320px;
  background: #FFFFFF;
  border-right: 1px solid #E5DFD7;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.review-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid #E5DFD7;
  background: #FAF8F5;
}

.review-filter-pills {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.review-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  background: #FFFFFF;
  border: 1px solid #DDD8D1;
  color: #57534e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.review-pill:hover {
  background: #F4EFEA;
  color: #2A201A;
}

.review-pill.active {
  background: #7B243B;
  border-color: #7B243B;
  color: #ffffff;
}

.review-search-box {
  width: 100%;
  padding: 9px 14px;
  background: #FFFFFF;
  border: 1px solid #D6D1CA;
  border-radius: 20px;
  color: #2A201A;
  font-size: 12.5px;
  box-sizing: border-box;
}

.review-search-box:focus {
  border-color: #D4A76A;
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.2);
  outline: none;
}

.review-questions-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FAF8F5;
}

.review-q-card {
  padding: 12px 14px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.review-q-card:hover {
  background: #FFFDFC;
  border-color: #D4A76A;
  box-shadow: 0 2px 6px rgba(212, 167, 106, 0.18);
}

.review-q-card.active {
  background: #FFFFFF;
  border-color: #7B243B;
  box-shadow: inset 4px 0 0 #7B243B, 0 2px 8px rgba(123, 36, 59, 0.15);
}

.review-q-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #2A201A;
  margin-bottom: 4px;
}

.review-q-meta {
  font-size: 11px;
  color: #78716c;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.review-q-preview {
  font-size: 11px;
  color: #57534e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  font-style: italic;
}

/* Painel de Edição à Direita */
.review-editor-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1e293b;
  overflow: hidden;
}

.review-editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

.review-alert-card {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.review-field-group {
  margin-bottom: 20px;
}

.review-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #7B243B;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #D6D1CA;
  border-radius: 6px;
  font-size: 14px;
  color: #2A201A;
  background: #FAF8F5;
  line-height: 1.5;
  transition: border-color 0.15s ease;
}

.review-field-input:focus {
  border-color: #D4A76A;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.2);
}

.review-field-textarea {
  min-height: 140px;
  resize: vertical;
  font-family: inherit;
}

.review-alt-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  background: #FAF8F5;
  border: 1px solid #E5DFD7;
  border-radius: 6px;
  padding: 10px 14px;
  transition: all 0.15s ease;
}

.review-alt-card.is-correct {
  background: #f0fdf4;
  border-color: #86efac;
}

.review-alt-badge {
  font-weight: 800;
  font-size: 14px;
  color: #7B243B;
  padding-top: 8px;
  min-width: 28px;
}

.review-alt-card.is-correct .review-alt-badge {
  color: #15803d;
}

.review-editor-footer {
  padding: 16px 28px;
  background: #FAF8F5;
  border-top: 1px solid #E5DFD7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.review-actions-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.review-actions-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Header Active AI Provider Pill */
.header-provider-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.header-provider-badge.vertex {
  background: rgba(4, 120, 87, 0.1);
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.3);
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.1);
}

.header-provider-badge.vertex:hover {
  background: rgba(4, 120, 87, 0.18);
  border-color: #047857;
  transform: translateY(-1px);
}

.header-provider-badge.ai-studio {
  background: rgba(123, 36, 59, 0.1);
  color: #7B243B;
  border: 1px solid rgba(123, 36, 59, 0.3);
  box-shadow: 0 1px 3px rgba(123, 36, 59, 0.1);
}

.header-provider-badge.ai-studio:hover {
  background: rgba(123, 36, 59, 0.18);
  border-color: #7B243B;
  transform: translateY(-1px);
}

/* Header Mini Quota Pill */
.header-quota-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(212, 167, 106, 0.12);
  color: #7c5417;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212, 167, 106, 0.4);
  box-shadow: 0 1px 4px rgba(42, 32, 26, 0.05);
  transition: all 0.2s ease;
  user-select: none;
}

.header-quota-pill:hover {
  background: rgba(212, 167, 106, 0.22);
  border-color: #D4A76A;
  transform: translateY(-1px);
}

.header-quota-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #D4A76A;
  box-shadow: 0 0 6px rgba(212, 167, 106, 0.7);
  display: inline-block;
}

.header-quota-pill.status-warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.header-quota-pill.status-warn .pill-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.header-quota-pill.status-cooling {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}
.header-quota-pill.status-cooling .pill-dot {
  background: #f87171;
  box-shadow: 0 0 8px #f87171;
  animation: pulse-cooling 1s infinite alternate;
}

@keyframes pulse-cooling {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Main Telemetry Card in Step 2 */
.gemini-quota-card {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 4px 16px rgba(42, 32, 26, 0.05);
}

.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #E5DFD7;
}

.quota-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quota-icon {
  font-size: 26px;
  width: 44px;
  height: 44px;
  background: rgba(212, 167, 106, 0.15);
  border: 1px solid rgba(212, 167, 106, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #7c5417;
}

.quota-title {
  font-size: 15px;
  font-weight: 700;
  color: #2A201A;
  margin: 0;
  letter-spacing: -0.2px;
}

.quota-subtitle {
  font-size: 12px;
  color: #78716c;
  margin-top: 3px;
}

.quota-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quota-status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.quota-status-badge.status-ok {
  background: rgba(4, 120, 87, 0.1);
  color: #047857;
  border: 1px solid rgba(4, 120, 87, 0.3);
}

.quota-status-badge.status-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.quota-status-badge.status-cooling {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulse-cooling 1.2s infinite alternate;
}

/* Quota Grid */
.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.quota-metric-box {
  background: #FAF8F5;
  border: 1px solid #E5DFD7;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.quota-metric-box:hover {
  border-color: #D4A76A;
  transform: translateY(-2px);
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(51, 65, 85, 0.6);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

.progress-bar-fill.fill-indigo {
  background: linear-gradient(90deg, #6366f1, #818cf8);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.progress-bar-fill.fill-cyan {
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.progress-bar-fill.fill-amber {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.progress-bar-fill.fill-rose {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.metric-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}

.model-badge {
  font-family: monospace;
  font-size: 11px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 600;
}

.quota-details-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.quota-detail-item {
  font-size: 12px;
  color: var(--text-muted);
}

.quota-detail-item strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Alert Box for Cooldown (HTTP 429) */
.quota-alert-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.quota-alert-box .alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.quota-alert-box .alert-text strong {
  color: #fca5a5;
  font-size: 13px;
}

.quota-alert-box .alert-text p {
  font-size: 12px;
  color: #fecaca;
  margin-top: 2px;
}

/* ==========================================================================
   Question Explorer & Interactive Scores Modal (Step 5)
   ========================================================================== */

.mq-item-card {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-left: 4px solid #D4A76A;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.mq-item-card:hover {
  background: #FAF8F5;
  border-color: #D4A76A;
  border-left-color: #7B243B;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(42, 32, 26, 0.08);
}

.mq-item-card.status-allocated {
  border-left-color: #10b981;
}

.mq-item-card.status-classified {
  border-left-color: #3b82f6;
}

.mq-item-card.status-manual {
  border-left-color: #f59e0b;
}

.mq-item-card.status-pending {
  border-left-color: #475569;
  opacity: 0.85;
}

.mq-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mq-id-title {
  font-size: 14px;
  font-weight: 700;
  color: #2A201A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mq-badges-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.mq-snippet {
  font-size: 13px;
  color: #4A4A4A;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mq-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #E5DFD7;
}

.mq-score-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mq-score-chip.score-emerald {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.mq-score-chip.score-cyan {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.mq-score-chip.score-amber {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.mq-score-chip.score-gray {
  background: #FAF8F5;
  color: #78716c;
  border: 1px solid #E5DFD7;
}

/* Scores Modal Styles */
.qsm-trilha-card {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.qsm-trilha-title {
  font-size: 13px;
  font-weight: 700;
  color: #2A201A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qsm-revisao-item {
  background: #FAF8F5;
  border: 1px solid #E5DFD7;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qsm-revisao-item.top-score {
  border-color: rgba(4, 120, 87, 0.4);
  background: rgba(4, 120, 87, 0.06);
}

.qsm-revisao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.qsm-revisao-name {
  font-size: 12px;
  font-weight: 600;
  color: #2A201A;
  flex: 1;
}

.qsm-revisao-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qsm-score-input {
  width: 50px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #2A201A;
  background: #FFFFFF;
  border: 1px solid #D6D1CA;
  border-radius: 4px;
  text-align: center;
}

.qsm-score-bar-bg {
  width: 100%;
  height: 5px;
  background: #E5DFD7;
  border-radius: 3px;
  overflow: hidden;
}

.qsm-score-bar-val {
  height: 100%;
  border-radius: 3px;
  transition: width 0.2s ease, background 0.2s ease;
}

.qsm-alt-box {
  background: #FAF8F5;
  border: 1px solid #E5DFD7;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #2A201A;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.5;
}

.qsm-alt-box.correct {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  font-weight: 600;
}

.btn-open-qsm:hover {
  background: #7B243B !important;
  color: #FFFFFF !important;
  border-color: #7B243B !important;
}

/* ==========================================================================
   LAYOUT DO PAREAMENTO: MENU LATERAL DE TRILHAS + PAINEL DE QUESTÕES
   ========================================================================== */
.matching-view-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .matching-view-layout {
    grid-template-columns: 1fr;
  }
}

/* Menu Lateral de Trilhas */
.trilhas-side-menu {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.side-menu-header {
  padding: 12px 14px;
  background: #FAF8F5;
  border-bottom: 1px solid #E5DFD7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #7B243B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-menu-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.trilha-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-left: 3px solid transparent;
  color: #4A4A4A;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.trilha-menu-item:hover {
  background: #FAF8F5;
  color: #2A201A;
}

.trilha-menu-item.active {
  background: rgba(123, 36, 59, 0.08);
  border-left-color: #7B243B;
  color: #7B243B;
  font-weight: 700;
}

.trilha-menu-item .menu-item-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #F4EFEA;
  color: #57534e;
  white-space: nowrap;
}

.trilha-menu-item.active .menu-item-badge {
  background: #7B243B;
  color: #FFFFFF;
}

/* Painel de Questões */
.trilha-questions-panel {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.04);
}

.matching-panel-toolbar {
  padding: 12px 16px;
  background: #FAF8F5;
  border-bottom: 1px solid #E5DFD7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-filters-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #D6D1CA;
}

.matching-questions-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  max-height: 640px;
  overflow-y: auto;
}

/* Card de Questão */
.mq-question-card {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-left: 3px solid #D4A76A;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.03);
}

.mq-question-card:hover {
  background: #FAF8F5;
  border-color: #D4A76A;
  border-left-color: #7B243B;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(42, 32, 26, 0.08);
}

.mq-question-card.allocated-card {
  border-left-color: #047857;
}

/* Paginação */
.matching-pagination {
  padding: 10px 16px;
  background: #FAF8F5;
  border-top: 1px solid #E5DFD7;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Cards Ranqueados do Modal (Score > 30) */
.qsm-trilha-rank-card {
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(42, 32, 26, 0.03);
}

.qsm-trilha-rank-card:hover {
  border-color: #D4A76A;
  background: #FAF8F5;
}

.qsm-trilha-rank-card.rank-first {
  border-left: 4px solid #047857;
  background: rgba(4, 120, 87, 0.03);
}

.qsm-trilha-rank-card.rank-second {
  border-left: 4px solid #7B243B;
}

.qsm-trilha-rank-card.rank-other {
  border-left: 4px solid #D4A76A;
}

.qsm-rank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.qsm-rank-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.qsm-rank-badge.badge-green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.qsm-rank-badge.badge-blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.qsm-rank-badge.badge-purple {
  background: #FAF8F5;
  color: #7B243B;
  border: 1px solid rgba(123, 36, 59, 0.25);
}

/* =========================================================
   Passo 4: Assistente de Refinamento Iterativo da Matriz
   ========================================================= */
.btn-refine-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-refine-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  transform: translateY(-1px);
}

.chat-msg {
  animation: fadeIn 0.25s ease;
  word-break: break-word;
}

.chat-msg.user {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
}

.chat-msg.user .chat-author {
  font-weight: 600;
  color: #38bdf8;
  display: block;
  margin-bottom: 3px;
}

.chat-msg.ai {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
}

.chat-msg.ai .chat-author {
  font-weight: 600;
  color: #818cf8;
  display: block;
  margin-bottom: 3px;
}

/* =========================================================
   Passo 6: Modal de Simulado ENADE 2026 (12 Questões • 4 Alternativas)
   ========================================================= */
#simulado-modal {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(3, 7, 18, 0.88) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 9999 !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease;
}

#simulado-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

#simulado-modal .modal-content,
#simulado-modal .modal-container,
#simulado-modal .modal-header,
#simulado-modal .modal-body,
#simulado-modal button,
#simulado-modal input,
#simulado-modal textarea {
  pointer-events: auto !important;
}

.simulado-modal-container {
  width: 92vw;
  max-width: 1120px;
  height: 88vh;
  background: var(--bg-card, #0f172a);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto !important;
}

@keyframes modalPop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.simulado-modal-header {
  padding: 16px 24px;
  background: #FAF8F5;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.simulado-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #FFFFFF;
}

.simulado-modal-footer {
  padding: 14px 24px;
  background: #FAF8F5;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.sim-question-card {
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #FFFFFF;
  border: 1px solid #E5DFD7;
}

.sim-question-card:hover {
  border-color: #D4A76A !important;
}

.sim-radio-gab {
  accent-color: #047857;
  width: 16px;
  height: 16px;
}

.sim-alt-input:focus,
.sim-enunciado-input:focus,
.sim-justificativa-input:focus {
  outline: none;
  border-color: #D4A76A !important;
  box-shadow: 0 0 10px rgba(212, 167, 106, 0.25);
}

/* =========================================================
   Passo 7: Hub de Configuração & Exportação Canvas LMS
   ========================================================= */
.canvas-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.canvas-hub-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  padding: 22px;
  box-shadow: 0 4px 16px rgba(42, 32, 26, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.canvas-hub-card:hover {
  border-color: #D4A76A;
}

.canvas-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  user-select: none;
}

.canvas-toggle-label input[type="checkbox"] {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.canvas-modular-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.canvas-trilha-card {
  background: #FAF8F5;
  border: 1px solid #E5DFD7;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(42, 32, 26, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.canvas-trilha-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(123, 36, 59, 0.08);
  border-color: #D4A76A;
}

/* ==========================================================================
   ESTILOS DE ATUALIZAÇÃO EM TEMPO REAL (CARDS PASSO 5)
   ========================================================================== */
@keyframes cardPulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
  40% { transform: scale(1.025); box-shadow: 0 0 16px rgba(56, 189, 248, 0.4); border-color: rgba(56, 189, 248, 0.75) !important; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
}

.stat-badge-pulse {
  animation: cardPulseGlow 0.8s ease-out;
}

@keyframes liveDotPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; filter: drop-shadow(0 0 6px #10b981); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  animation: liveDotPulse 2s infinite ease-in-out;
}

.matching-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

/* =========================================================
   SOBREPOSIÇÕES ESPECÍFICAS DE IDENTIDADE VISUAL & UX
   ========================================================= */
.sim-question-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 18px rgba(42, 32, 26, 0.05) !important;
  color: var(--text-main) !important;
}

.sim-question-card:hover {
  border-color: #D4A76A !important;
  box-shadow: 0 6px 24px rgba(42, 32, 26, 0.08) !important;
}

.sim-enunciado-input {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  color: var(--text-main) !important;
  font-family: 'Inter', sans-serif !important;
}

.sim-enunciado-input:focus {
  border-color: #D4A76A !important;
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.25) !important;
}

.sim-alt-input {
  color: var(--text-main) !important;
}

.sim-just-dist-input {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}

/* Modais de Cursos, Membros e Admin */
.modal-content {
  background: #FFFFFF !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 40px rgba(42, 32, 26, 0.2) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-color) !important;
}

.modal-header h3 {
  color: var(--text-dark) !important;
  font-family: 'Poppins', sans-serif !important;
}

.modal-footer {
  border-top: 1px solid var(--border-color) !important;
}

/* Tabelas e Estatísticas */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: #F9F8F6 !important;
  color: var(--text-dark) !important;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color) !important;
  padding: 12px 14px !important;
}

td {
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  padding: 12px 14px !important;
}

tr:hover td {
  background: #fcfbfa !important;
}

/* Canvas Hub Cards */
.canvas-hub-card {
  background: #FFFFFF !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-main) !important;
}

.canvas-hub-card h3 {
  color: var(--text-dark) !important;
  font-family: 'Poppins', sans-serif !important;
}

.canvas-toggle-label {
  color: var(--text-main) !important;
}

/* ========================================================
   NOVO MENU LATERAL: ADMIN & USUÁRIO
   ======================================================== */

/* Navegação do Administrador */
.sidebar-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #f5f5f5;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  width: 100%;
  text-align: left;
}

.admin-nav-item:hover {
  background: rgba(123, 36, 59, 0.4);
  color: #FFFFFF;
  border-color: rgba(212, 167, 106, 0.4);
  transform: translateX(2px);
}

.admin-nav-item.active {
  background: #7B243B;
  color: #FFFFFF;
  border: 1px solid #D4A76A;
  box-shadow: 0 4px 12px rgba(123, 36, 59, 0.4);
  font-weight: 700;
}

.admin-nav-icon {
  font-size: 17px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-nav-label {
  flex: 1;
}

/* Accordions Colapsáveis do Usuário */
.sidebar-accordion {
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sidebar-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.sidebar-accordion-header:hover {
  background: rgba(255, 255, 255, 0.06);
}

.accordion-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.accordion-icon {
  font-size: 15px;
}

.accordion-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #D4A76A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accordion-badge {
  background: rgba(212, 167, 106, 0.2);
  color: #D4A76A;
  border: 1px solid rgba(212, 167, 106, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.accordion-chevron {
  font-size: 12px;
  color: #D4A76A;
  transition: transform 0.2s ease;
}

.sidebar-accordion.collapsed .accordion-chevron {
  transform: rotate(-90deg);
}

.sidebar-accordion.collapsed .sidebar-accordion-body {
  display: none;
}

.sidebar-accordion-body {
  padding: 6px 8px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Item de Curso na Sidebar */
.sidebar-course-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

.sidebar-course-row:hover {
  background: rgba(123, 36, 59, 0.45);
  border-color: rgba(212, 167, 106, 0.5);
  transform: translateX(2px);
}

.sidebar-course-row.active {
  background: rgba(123, 36, 59, 0.8);
  border-color: #D4A76A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.course-row-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.course-row-code {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(212, 167, 106, 0.2);
  color: #fef08a;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.course-row-name {
  font-size: 12px;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.badge-course-validated {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  background: #047857;
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 6px rgba(4, 120, 87, 0.6);
}

.badge-status-validated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #10b981;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #eab308;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-course-members-icon {
  background: #FFFFFF;
  border: 1px solid #D4A76A;
  color: #7B243B;
  border-radius: 6px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-course-members-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  display: block;
}

.btn-course-members-icon:hover {
  background: #D4A76A;
  color: #2A201A;
  border-color: #c49658;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(212, 167, 106, 0.45);
}

.badge-role-coordinator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(212, 167, 106, 0.22);
  color: #7c5417;
  border: 1px solid #D4A76A;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-role-professor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(123, 36, 59, 0.1);
  color: #7B243B;
  border: 1px solid rgba(123, 36, 59, 0.3);
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

/* Visualizações Centrais do Admin */
.central-view-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.central-view-pane.active {
  display: block;
}

.admin-central-card {
  background: #FFFFFF;
  border: 1px solid #DDD8D1;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(42, 32, 26, 0.05);
  margin-bottom: 24px;
}

.admin-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #E5DFD7;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-view-title-group h2 {
  font-size: 20px;
  font-weight: 700;
  color: #2A201A;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-view-title-group p {
  font-size: 13px;
  color: #78716c;
  margin: 4px 0 0 0;
}

.btn-view-collab-pill {
  background: #7B243B;
  color: #FFFFFF;
  border: 1px solid #7B243B;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-view-collab-pill:hover {
  background: #932c47;
  border-color: #D4A76A;
  transform: translateY(-1px);
}

/* ========================================================
   INDICADORES DE CARREGAMENTO DE CURSO
   ======================================================== */
.course-loading-bar {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #D4A76A 0%, #7B243B 50%, #D4A76A 100%);
  background-size: 200% 100%;
  animation: courseLoadingShimmer 1.1s infinite linear;
  z-index: 9999;
}

@keyframes courseLoadingShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spinCourseLoader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInDownSmooth {
  0% { opacity: 0; transform: translate(-50%, -12px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

.course-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(212, 167, 106, 0.14);
  border: 1px solid rgba(212, 167, 106, 0.45);
  border-radius: 9999px;
  color: #7c5417;
  font-size: 11.5px;
  font-weight: 600;
  margin-left: 14px;
  box-shadow: 0 2px 6px rgba(212, 167, 106, 0.12);
  animation: fadeInDownSmooth 0.2s ease-out;
}

.course-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(124, 84, 23, 0.25);
  border-top-color: #7c5417;
  border-radius: 50%;
  display: inline-block;
  animation: spinCourseLoader 0.7s linear infinite;
}

.global-course-loading-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(42, 32, 26, 0.94);
  color: #FFFFFF;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 167, 106, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 12px rgba(212, 167, 106, 0.2);
  padding: 9px 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999999;
  pointer-events: none;
  animation: fadeInDownSmooth 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading-toast-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(212, 167, 106, 0.3);
  border-top-color: #D4A76A;
  border-radius: 50%;
  display: inline-block;
  animation: spinCourseLoader 0.7s linear infinite;
}

.sidebar-course-row.loading {
  opacity: 0.75;
  position: relative;
}

.sidebar-course-row.loading .sidebar-course-code::after {
  content: ' • carregando...';
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 10px;
}

/* Seletor de Tipo de Documento (Prova / Gabarito) */
.select-file-type {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #D6D1CA;
  background-color: #FFFFFF;
  color: #2A201A;
  font-family: inherit;
}

.select-file-type.type-prova {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.select-file-type.type-gabarito {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.select-file-type:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(212, 167, 106, 0.25);
}

/* ========================================================
   FLUXO DE AÇÕES DE QUESTÕES (Passo 3: Extração & Revisão)
   ======================================================== */
.question-actions-flow {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.flow-step-item {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-flow-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(42, 32, 26, 0.08);
  border: 1px solid transparent;
  text-decoration: none;
  position: relative;
  text-align: center;
}

/* Botão 1: Extrair Perguntas */
.btn-flow-extract {
  background: linear-gradient(135deg, #2A201A 0%, #44342a 100%);
  color: #FFFFFF;
  border-color: #554235;
}

.btn-flow-extract:hover:not(:disabled) {
  background: linear-gradient(135deg, #382c24 0%, #523f33 100%);
  box-shadow: 0 6px 18px rgba(42, 32, 26, 0.2);
  transform: translateY(-2px);
}

/* Botão 2: Revisar perguntas com IA */
.btn-flow-ai {
  background: linear-gradient(135deg, #7B243B 0%, #932c47 100%);
  color: #FFFFFF;
  border-color: #641c2f;
}

.btn-flow-ai:hover:not(:disabled) {
  background: linear-gradient(135deg, #8d2a44 0%, #a63351 100%);
  box-shadow: 0 6px 20px rgba(123, 36, 59, 0.28);
  transform: translateY(-2px);
}

/* Botão 3: Revisão Manual */
.btn-flow-manual {
  background: linear-gradient(135deg, #D4A76A 0%, #c49658 100%);
  color: #2A201A;
  border-color: #b88a4c;
}

.btn-flow-manual:hover:not(:disabled) {
  background: linear-gradient(135deg, #dcaf73 0%, #ce9f60 100%);
  box-shadow: 0 6px 20px rgba(212, 167, 106, 0.35);
  transform: translateY(-2px);
}

/* Estado Desabilitado dos Botões do Fluxo */
.btn-flow-action:disabled,
.btn-flow-action.disabled,
.btn-flow-action.flow-btn-locked {
  opacity: 0.42;
  cursor: not-allowed !important;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(35%);
}

.flow-step-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D4A76A;
  font-size: 20px;
  font-weight: 800;
  user-select: none;
  padding-top: 12px;
}

@media (max-width: 900px) {
  .flow-step-arrow {
    display: none;
  }
}

.flow-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
}

.flow-checkbox-container input[type="checkbox"] {
  accent-color: var(--accent-secondary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.flow-badge-count {
  background: #7B243B;
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  margin-left: 4px;
}

/* ======================================================================
   PAINEL VISUAL DE LOTES PARALELOS (35 Páginas + 7 Simulados = 42 Itens)
   ====================================================================== */
.batch-dashboard-wrap {
  background: #ffffff;
  border: 1px solid #e5dfd7;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(42, 32, 26, 0.04);
  transition: all 0.25s ease;
}

.batch-dashboard-wrap.collapsed {
  padding: 14px 20px;
  margin-bottom: 18px;
  background: #faf8f5;
}

.batch-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1ece5;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.batch-dashboard-wrap.collapsed .batch-dash-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.batch-dash-title-group h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  color: #7b243b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-dash-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.batch-concurrency-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fdf4f5;
  border: 1px solid #f5d0d6;
  color: #7b243b;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

/* KPI Summary Cards Grid */
.batch-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.batch-kpi-card {
  background: #faf8f5;
  border: 1px solid #e8e2d9;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.batch-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 32, 26, 0.06);
}

.batch-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.batch-kpi-icon {
  font-size: 18px;
}

.batch-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
}

.batch-kpi-sub {
  font-size: 12px;
  color: #64748b;
}

.batch-kpi-card.kpi-done {
  border-left: 4px solid #10b981;
}
.batch-kpi-card.kpi-done .batch-kpi-val {
  color: #065f46;
}

.batch-kpi-card.kpi-active {
  border-left: 4px solid #0284c7;
  background: #f0f9ff;
}
.batch-kpi-card.kpi-active .batch-kpi-val {
  color: #0369a1;
}

.batch-kpi-card.kpi-pending {
  border-left: 4px solid #f59e0b;
}
.batch-kpi-card.kpi-pending .batch-kpi-val {
  color: #b45309;
}

/* 7x6 Matrix Table */
.batch-matrix-box {
  background: #faf8f5;
  border: 1px solid #e8e2d9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.batch-matrix-table-wrap {
  overflow-x: auto;
}

.batch-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 650px;
}

.batch-matrix-table th {
  background: #f1ece5;
  color: #475569;
  font-weight: 700;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #e2dbd0;
  border-right: 1px solid #e2dbd0;
}

.batch-matrix-table th:first-child {
  text-align: left;
  min-width: 150px;
}

.batch-matrix-table th:last-child {
  border-right: none;
  background: #ede8e3;
  color: #7b243b;
}

.batch-matrix-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1ece5;
  border-right: 1px solid #f1ece5;
  text-align: center;
  vertical-align: middle;
}

.batch-matrix-table td:last-child {
  border-right: none;
}

.batch-trilha-row-label {
  text-align: left !important;
  font-weight: 700;
  color: #1e293b;
}

.batch-trilha-row-label span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Item Status Cells */
.bm-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  min-width: 80px;
  min-height: 44px;
  transition: all 0.2s ease;
  user-select: none;
  cursor: default;
}

.bm-cell-done {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  cursor: pointer;
}
.bm-cell-done:hover {
  background: #d1fae5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15);
}

.bm-cell-running {
  background: #f0f9ff;
  border: 1.5px solid #38bdf8;
  color: #0369a1;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  animation: batchCellPulse 1.8s infinite ease-in-out;
}

@keyframes batchCellPulse {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(56, 189, 248, 0.2); }
  50% { transform: scale(1.02); box-shadow: 0 0 14px rgba(56, 189, 248, 0.45); }
  100% { transform: scale(1); box-shadow: 0 0 4px rgba(56, 189, 248, 0.2); }
}

.bm-cell-queued {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
}

.bm-cell-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.bm-cell-title {
  font-size: 11px;
  line-height: 1.2;
}

.bm-cell-meta {
  font-size: 10px;
  opacity: 0.85;
  margin-top: 2px;
}

/* Active Parallel Slots Container */
.batch-slots-section {
  border-top: 1px solid #f1ece5;
  padding-top: 16px;
}

.batch-slots-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.batch-slot-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.batch-slot-card.active {
  background: #ffffff;
  border-color: #bae6fd;
  border-left: 3px solid #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.batch-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-slot-num {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 4px;
}

.batch-slot-item {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.batch-slot-msg {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-slot-bar-wrap {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.batch-slot-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  width: 0%;
  transition: width 0.3s ease;
}
