/* ============================================
   Área do Professor — Estilos Específicos
   ============================================ */

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.bg-blue  { background: var(--primary-light); color: var(--primary); }
.bg-green { background: var(--success-light); color: var(--success); }
.bg-yellow { background: var(--warning-light); color: var(--warning); }
.bg-red   { background: var(--danger-light); color: var(--danger); }

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1;
}

.stat-card-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 0.2rem;
}

/* ── TOOLBAR ── */
.toolbar-card {
  padding: 1rem 1.25rem !important;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-width: 220px;
  flex: 1;
  max-width: 320px;
}

.search-box i { color: var(--gray-400); font-size: 0.85rem; }

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: var(--gray-700);
  width: 100%;
}

.select-filtro {
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--gray-700);
  background: var(--gray-50);
  cursor: pointer;
  outline: none;
}

.select-filtro:focus {
  border-color: var(--primary);
}

/* ── TABLE HEADER ── */
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.badge-count {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-weight: 600;
}

/* ── TABELA ── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.results-table thead {
  background: var(--gray-50);
}

.results-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}

.results-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.results-table th.sortable:hover {
  color: var(--primary);
}

.sort-icon { margin-left: 0.25rem; opacity: 0.5; font-size: 0.7rem; }
.sort-asc .sort-icon, .sort-desc .sort-icon { opacity: 1; color: var(--primary); }

.results-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: #f0f9ff;
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── BADGES DE DESEMPENHO ── */
.badge-perf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-excelente { background: #dcfce7; color: #166534; }
.badge-bom       { background: #dbeafe; color: #1d4ed8; }
.badge-regular   { background: #fef3c7; color: #92400e; }
.badge-ruim      { background: #fee2e2; color: #991b1b; }

/* BARRA DE PROGRESSO NA TABELA */
.mini-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
  width: 80px;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.fill-excelente { background: #22c55e; }
.fill-bom       { background: #3b82f6; }
.fill-regular   { background: #f59e0b; }
.fill-ruim      { background: #ef4444; }

/* ── PAGINAÇÃO ── */
.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.25rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.pag-btn {
  min-width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--gray-600);
  transition: all 0.2s;
  padding: 0 0.5rem;
}

.pag-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pag-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); font-weight: 700; }
.pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── MODAL ── */
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 1.1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}

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

.modal-body {
  overflow-y: auto;
  padding: 1.5rem;
  flex: 1;
}

/* Modal detalhes questões */
.modal-aluno-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.modal-info-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.modal-info-item .lbl { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.2rem; }
.modal-info-item .val { font-size: 0.92rem; font-weight: 600; color: var(--gray-800); }

.questoes-gabarito {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gabarito-item {
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  font-size: 0.85rem;
}

.gabarito-item.certo {
  background: var(--success-light);
  border-color: #86efac;
}

.gabarito-item.errado {
  background: var(--danger-light);
  border-color: #fca5a5;
}

.gabarito-item.sem-resposta {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.gabarito-item .g-enunciado {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.gabarito-item .g-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}

.gabarito-item .g-certo { color: var(--success); font-weight: 600; }
.gabarito-item .g-errado { color: var(--danger); font-weight: 600; }

/* ── BOTÃO EXCEL ── */
.btn-excel {
  background: #16a34a;
  color: #fff;
}
.btn-excel:hover { background: #15803d; }

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar-row { flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { max-width: 100%; }
  .modal-aluno-info { grid-template-columns: 1fr; }
}
