/* M52.turmas-v2 — modal central de turma com alunos + acesso + produtos + CSV */

.cf-ta-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: cfta-fade .15s ease-out;
}
.cf-ta-modal {
  position: relative;
  background: #fff;
  width: min(1100px, 96vw);
  height: min(820px, 92vh);
  max-height: 92vh;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15,23,42,.35);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cfta-pop .2s cubic-bezier(.16,1,.3,1);
}
@keyframes cfta-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfta-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.cf-ta-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px;
  border: none; background: rgba(255,255,255,.9);
  border-radius: 8px; color: #64748b; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
  z-index: 2;
}
.cf-ta-close:hover { background: #f1f5f9; color: #0f172a; }

.cf-ta-body { flex: 1; overflow-y: auto; padding: 24px 28px 28px; background: #fafbfd; }

.cf-ta-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #e2e8f0; margin-bottom: 18px;
}
.cf-ta-eyebrow {
  font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600;
}
.cf-ta-title {
  font-size: 20px; color: #0f172a; margin: 4px 0 6px;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600;
}
.cf-ta-meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #64748b;
}
.cf-ta-meta strong { color: #0f172a; }
.cf-ta-actions { display: flex; gap: 6px; }
.cf-ta-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: #1E5BAA; color: #fff;
  border: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: filter .12s;
}
.cf-ta-btn:hover { filter: brightness(.92); }

/* KPIs */
.cf-ta-kpis {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.cf-ta-kpi {
  background: #fff; padding: 10px 12px; border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
  border-left: 3px solid var(--c, #94a3b8);
}
.cf-ta-kpi strong {
  display: block; font-size: 18px; color: #0f172a; font-family: 'IBM Plex Sans', sans-serif;
}
.cf-ta-kpi small { font-size: 10.5px; color: #64748b; }

/* Filtros */
.cf-ta-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.cf-ta-filter {
  padding: 5px 11px;
  background: #fff; color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.cf-ta-filter:hover { background: #f1f5f9; }
.cf-ta-filter.is-active {
  background: #1E5BAA; color: #fff; border-color: #1E5BAA;
}
.cf-ta-filter-n {
  background: rgba(255,255,255,.85); color: #475569;
  font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 600;
}
.cf-ta-filter.is-active .cf-ta-filter-n {
  background: rgba(255,255,255,.25); color: #fff;
}

.cf-ta-section {
  background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
}
.cf-ta-section h3 {
  font-size: 13px; color: #0f172a; margin: 0 0 12px;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600;
}
.cf-ta-section h3 small {
  font-size: 11px; color: #94a3b8; font-weight: 400;
}

.cf-ta-empty {
  text-align: center; padding: 24px 12px; color: #94a3b8; font-size: 12px;
}
.cf-ta-empty i { display: block; margin: 0 auto 8px; }

/* Tabela de alunos */
.cf-ta-table-wrap { overflow-x: auto; }
.cf-ta-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.cf-ta-table thead th {
  text-align: left; padding: 8px 10px;
  font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid #f1f5f9; font-weight: 600;
}
.cf-ta-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.cf-ta-table tbody tr:hover { background: #fafbfd; }

.cf-ta-pill {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
}
.cf-ta-btn-mini {
  width: 24px; height: 24px;
  border: none; background: #f1f5f9; color: #475569;
  border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.cf-ta-btn-mini:hover { background: #1E5BAA; color: #fff; }
.cf-ta-copy { color: #64748b; transition: color .12s; }
.cf-ta-copy:hover { color: #1E5BAA; }

/* Produtos vinculados */
.cf-ta-prod-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: #fafbfd; border-radius: 8px; margin-bottom: 8px;
}
.cf-ta-prod-card:last-child { margin-bottom: 0; }
.cf-ta-prod-card code {
  background: #e2e8f0; padding: 1px 5px; border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
}

@media (max-width: 900px) {
  .cf-ta-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .cf-ta-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .cf-ta-kpis { grid-template-columns: repeat(2, 1fr); }
}
