/* ============================================================
   MUNDOSABER PREMIUM — DASHBOARD CSS
   © 2026 MundoSaber SpA. Todos los derechos reservados.
   ============================================================ */

/* ---- Tarjeta base del dashboard ---- */
.dash-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  border: 1px solid #f3f4f6;
  margin-bottom: 16px;
}
.dc-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: #1e1b4b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dc-title i { color: #7c3aed; }
.dc-sub { font-size: 0.82rem; color: #6b7280; margin-bottom: 16px; }

/* ========================================================
   PANEL DE PADRES
   ======================================================== */
#screen-parent { background: #f0fdf4; }

.parent-child-tabs {
  display: flex;
  gap: 10px;
  padding: 16px 20px 0;
  overflow-x: auto;
  background: #fff;
  border-bottom: 2px solid #d1fae5;
}
.pct-btn {
  flex-shrink: 0;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 50px 50px 0 0;
  padding: 10px 20px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.pct-btn.active {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
  font-weight: 900;
}

.parent-body { padding: 20px; max-width: 900px; margin: 0 auto; }

/* Resumen del hijo */
.parent-summary {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 2px solid #6ee7b7;
}
.ps-avatar {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 6px 20px rgba(16,185,129,0.3);
  flex-shrink: 0;
}
.ps-info { flex: 1; }
.ps-name { font-family: 'Fredoka One', cursive; font-size: 1.4rem; color: #064e3b; }
.ps-level { font-size: 0.85rem; color: #065f46; margin-bottom: 8px; }
.ps-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.ps-stat {
  background: rgba(255,255,255,0.5);
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Progreso por mundo */
.world-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.world-progress-item:last-child { border-bottom: none; }
.wpi-icon { font-size: 1.8rem; width: 36px; text-align: center; flex-shrink: 0; }
.wpi-info { flex: 1; }
.wpi-name { font-weight: 700; font-size: 0.9rem; color: #1e1b4b; margin-bottom: 4px; }
.wpi-bar { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.wpi-fill { height: 100%; border-radius: 99px; transition: width 0.5s; }
.wpi-pct { font-size: 0.75rem; color: #6b7280; white-space: nowrap; }
.wpi-stars { font-size: 0.8rem; }

/* Ruta diaria para padres */
.parent-route-day {
  margin-bottom: 16px;
}
.prd-day-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.prd-tasks { display: flex; flex-wrap: wrap; gap: 8px; }
.prd-task {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 6px;
}
.prd-task.done { background: #d1fae5; border-color: #10b981; color: #065f46; }
.prd-task.pending { background: #ede9fe; border-color: #a78bfa; color: #5b21b6; }

/* Logros panel padres */
.parent-badge-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pb-chip {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  border-radius: 50px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(245,158,11,0.28);
}
.pb-locked {
  background: #f3f4f6;
  color: #9ca3af;
}

/* Sugerencias */
.suggestion-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: flex-start;
}
.suggestion-item:last-child { border-bottom: none; }
.si-icon { font-size: 1.5rem; flex-shrink: 0; }
.si-text h4 { font-size: 0.92rem; font-weight: 800; color: #1e1b4b; margin-bottom: 3px; }
.si-text p { font-size: 0.83rem; color: #6b7280; line-height: 1.45; }

/* ========================================================
   PANEL DOCENTE / COLEGIO
   ======================================================== */
#screen-school { background: #fffbf0; }

.school-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #fde68a;
  overflow-x: auto;
  position: sticky;
  top: 56px;
  z-index: 100;
}
.stab {
  flex: 1;
  padding: 14px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #6b7280;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.stab:hover { color: #b45309; background: #fef3c7; }
.stab.active { color: #92400e; border-bottom-color: #f59e0b; background: #fffbf0; font-weight: 900; }

.school-tab-content { display: none; padding: 20px; max-width: 1000px; margin: 0 auto; }
.school-tab-content.active { display: block; }
.school-grid { display: grid; gap: 16px; }
@media(min-width:768px) { .school-grid { grid-template-columns: 1fr 1fr; } .full-width { grid-column: 1/-1; } }

/* Stats del aula */
.class-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cs-stat {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 2px solid #fcd34d;
}
.cs-stat.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); border-color: #c4b5fd; }
.cs-stat.green  { background: linear-gradient(135deg, #d1fae5, #a7f3d0); border-color: #6ee7b7; }
.cs-stat.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); border-color: #93c5fd; }
.cs-num { font-family: 'Fredoka One', cursive; font-size: 2.2rem; color: #92400e; line-height: 1; }
.cs-stat.purple .cs-num { color: #5b21b6; }
.cs-stat.green  .cs-num { color: #065f46; }
.cs-stat.blue   .cs-num { color: #1e40af; }
.cs-lbl { font-size: 0.78rem; font-weight: 700; color: #6b7280; margin-top: 3px; }

/* Tabla alumnos */
.students-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 180px;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  padding: 9px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: #f59e0b; }
.filter-select {
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  padding: 9px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: #f59e0b; }

.students-list { display: flex; flex-direction: column; gap: 10px; }
.student-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fafafa;
  border-radius: 14px;
  border: 2px solid #f3f4f6;
  cursor: pointer;
  transition: all 0.2s;
}
.student-row:hover { border-color: #f59e0b; background: #fef9f0; transform: translateX(3px); }
.sr-avatar { font-size: 1.8rem; width: 40px; text-align: center; flex-shrink: 0; }
.sr-info { flex: 1; }
.sr-name { font-weight: 800; font-size: 0.95rem; color: #1e1b4b; }
.sr-detail { font-size: 0.76rem; color: #6b7280; margin-top: 2px; }
.sr-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sr-badge {
  background: #ede9fe; color: #5b21b6;
  border-radius: 50px; padding: 3px 10px;
  font-size: 0.72rem; font-weight: 700;
}
.sr-badge.green { background: #d1fae5; color: #065f46; }
.sr-badge.amber { background: #fef3c7; color: #92400e; }
.sr-badge.red   { background: #fee2e2; color: #991b1b; }
.sr-stars { font-size: 0.8rem; }
.sr-progress { font-size: 0.75rem; color: #6b7280; }
.sr-arrow { font-size: 1.2rem; color: #d1d5db; }

/* Actividad de hoy */
.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fafafa;
  border-radius: 10px;
  border-left: 4px solid #f59e0b;
}
.ti-time { font-size: 0.75rem; color: #9ca3af; min-width: 50px; }
.ti-avatar { font-size: 1.2rem; }
.ti-text { font-size: 0.85rem; font-weight: 700; color: #374151; flex: 1; }
.ti-result { font-size: 0.8rem; }

/* Currículo */
.curriculum-week { display: flex; flex-direction: column; gap: 14px; }
.cw-day {
  background: #fff;
  border-radius: 14px;
  border: 2px solid #fde68a;
  overflow: hidden;
}
.cw-day-header {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 12px 16px;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cw-activities { padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.cw-act {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cw-act.letras   { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.cw-act.numeros  { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.cw-act.memoria  { background: #fce7f3; border-color: #f9a8d4; color: #9d174d; }
.cw-act.colores  { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.cw-act.formas   { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.cw-act.animales { background: #ffedd5; border-color: #fdba74; color: #9a3412; }
.cw-act.especial { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.cw-age-tag {
  background: rgba(0,0,0,0.08);
  border-radius: 50px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Generador de informes */
.report-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.report-output-card {
  background: #f9fafb;
  border-radius: 14px;
  border: 2px solid #e5e7eb;
  padding: 24px;
}
.ro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.ro-title { font-family: 'Fredoka One', cursive; font-size: 1.2rem; color: #1e1b4b; }
.ro-date { font-size: 0.8rem; color: #9ca3af; }
.ro-section { margin-bottom: 14px; }
.ro-section h4 { font-size: 0.88rem; font-weight: 800; color: #6b7280; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.ro-metric { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #e5e7eb; font-size: 0.88rem; }
.ro-metric:last-child { border-bottom: none; }
.ro-metric .label { color: #4b5563; }
.ro-metric .value { font-weight: 800; color: #1e1b4b; }
.ro-note {
  background: #ede9fe;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.85rem;
  color: #5b21b6;
  line-height: 1.5;
  margin-top: 12px;
}

/* Detalle alumno modal */
.student-detail-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px solid #f3f4f6;
  margin-bottom: 16px;
}
.sd-avatar { font-size: 3.5rem; display: block; margin-bottom: 6px; }
.sd-name { font-family: 'Fredoka One', cursive; font-size: 1.5rem; color: #1e1b4b; }
.sd-sub { font-size: 0.85rem; color: #6b7280; }
.sd-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.sd-stat {
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 2px solid #e5e7eb;
}
.sd-stat-val { font-family: 'Fredoka One', cursive; font-size: 1.6rem; color: #7c3aed; }
.sd-stat-lbl { font-size: 0.72rem; color: #9ca3af; }
.sd-world-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sdwb { display: flex; align-items: center; gap: 10px; }
.sdwb-icon { font-size: 1.2rem; width: 28px; text-align: center; }
.sdwb-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.sdwb-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.sdwb-pct { font-size: 0.75rem; font-weight: 700; color: #6b7280; min-width: 30px; text-align: right; }

/* ========================================================
   ALERTA DEL DÍA — PANEL PADRES
   ======================================================== */
.parent-day-alert { margin-bottom: 16px; }
.day-alert {
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 2px solid transparent;
  position: relative;
}
.day-alert.success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #6ee7b7;
  color: #064e3b;
}
.day-alert.progress {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-color: #c4b5fd;
  color: #3730a3;
  flex-wrap: wrap;
}
.day-alert.pending {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fcd34d;
  color: #92400e;
}
.da-icon { font-size: 2rem; flex-shrink: 0; }
.day-alert > div > div { font-weight: 400; font-size: 0.82rem; margin-top: 3px; opacity: 0.85; }
.da-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.4);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.da-bar-fill {
  height: 100%;
  background: #7c3aed;
  border-radius: 99px;
  transition: width 0.5s;
}

/* ========================================================
   MEJORAS RESPONSIVE DASHBOARD
   ======================================================== */
@media(max-width: 480px) {
  .parent-summary { flex-direction: column; text-align: center; }
  .ps-stats { justify-content: center; }
  .parent-body { padding: 12px; }
  .dash-card { padding: 16px; }
  .report-controls { flex-direction: column; }
  .report-controls > * { width: 100%; }
  .day-alert { flex-direction: column; text-align: center; }
  .da-icon { margin-bottom: 4px; }
}

/* ========================================================
   CURRICULUM SEMANA HORIZONTAL (desktop)
   ======================================================== */
@media(min-width: 768px) {
  .curriculum-week {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
}

/* ========================================================
   PANEL PADRES — INFORME RÁPIDO
   ======================================================== */
#parent-report-output {
  margin-top: 14px;
}
#parent-report-output .report-output-card {
  border: 2px solid #ddd6fe;
  background: linear-gradient(135deg, #faf5ff, #fff);
}
