* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 0; background: #f0f4f8; color: #1a1a1a; }
.nav { background: #2c5282; padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; position: relative; }
.nav a { color: #fff; text-decoration: none; }
.nav a:hover { text-decoration: none; opacity: 0.9; }
.nav-logo { font-weight: 600; white-space: nowrap; display: none; }
.nav-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1rem; }
.nav-toggle { display: none; width: 2.25rem; height: 2.25rem; padding: 0; border: none; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 0.35rem; border-radius: 6px; }
.nav-toggle:hover { background: rgba(255,255,255,0.1); }
.nav-toggle-bar { display: block; width: 1.25rem; height: 2px; background: #fff; border-radius: 1px; transition: transform 0.2s, opacity 0.2s; }
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { color: #fff; cursor: pointer; padding: 0; background: none; border: none; font-size: inherit; font-family: inherit; }
.nav-dropdown-trigger:hover { text-decoration: none; opacity: 0.9; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; margin-top: 0.25rem; background: #2c5282; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); min-width: 140px; z-index: 100; padding: 0.35rem 0; }
.nav-dropdown-menu a { display: block; padding: 0.5rem 1rem; margin: 0; color: #fff; white-space: nowrap; border-radius: 4px; }
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
@media (hover: none) {
  .nav-dropdown .nav-dropdown-menu { display: none; }
  .nav-dropdown .nav-dropdown-menu[style*="block"] { display: block !important; }
}
@media (max-width: 500px) {
  .nav-dropdown-menu { left: 0; }
}

/* Menú responsive para móvil */
@media (max-width: 640px) {
  .nav-logo { display: block; font-size: 0.95rem; }
  .nav-toggle { display: flex; }
  .nav-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #2c5282; padding: 0.5rem 0; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 200; gap: 0; border-radius: 0 0 8px 8px; max-height: calc(100vh - 3rem); overflow-y: auto; }
  .nav-menu--open { display: flex; }
  .nav-menu > a { padding: 0.75rem 1rem; border-radius: 0; }
  .nav-menu > a:hover { background: rgba(255,255,255,0.1); }
  .nav-dropdown { position: static; }
  .nav-dropdown-trigger { display: block; width: 100%; text-align: left; padding: 0.75rem 1rem; }
  .nav-dropdown-menu { position: static; box-shadow: none; margin-top: 0; border-radius: 0; padding: 0 0 0 1rem; border-left: 3px solid rgba(255,255,255,0.3); min-width: auto; }
  .nav-dropdown-menu a { padding: 0.5rem 1rem; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(0.37rem) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-0.37rem) rotate(-45deg); }
}
.contenedor { max-width: 800px; margin: 0 auto; padding: 1.5rem; }
h1 { margin-top: 0; color: #2d3748; }
h2 { font-size: 1.1em; margin-top: 0; color: #4a5568; }
.card { background: #fff; border-radius: 10px; padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.form-grupo { margin-bottom: 1rem; }
.form-grupo label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-grupo input[type="text"], .form-grupo input[type="number"], .form-grupo select { width: 100%; max-width: 320px; padding: 0.5rem; border: 1px solid #cbd5e0; border-radius: 6px; }
.form-grupo textarea { width: 100%; max-width: 100%; min-height: 60px; padding: 0.5rem; border: 1px solid #cbd5e0; border-radius: 6px; font-family: inherit; }
.textarea-grande { width: 100%; min-height: 280px; padding: 0.75rem; border: 1px solid #cbd5e0; border-radius: 6px; font-family: inherit; font-size: 14px; }
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: 1rem; text-decoration: none; background: #e2e8f0; color: #2d3748; }
.btn:hover { background: #cbd5e0; }
.btn-primario { background: #2b6cb0; color: #fff; }
.btn-primario:hover { background: #2c5282; }
.btn-peq { font-size: 0.85rem; padding: 0.25rem 0.5rem; margin-left: 0.5rem; }
.btn-eliminar { background: #c53030; color: #fff; }
.btn-eliminar:hover { background: #9b2c2c; }
.mensaje { margin-top: 0.75rem; padding: 0.5rem; border-radius: 4px; }
.mensaje.ok { background: #c6f6d5; color: #22543d; }
.mensaje.info { background: #bee3f8; color: #2c5282; }
.mensaje.aviso { background: #feebc8; color: #c05621; }
.mensaje.error { background: #fed7d7; color: #c53030; }
.enlaces-generado p { margin: 0.5rem 0; }
.lista-ejercicios { list-style: none; padding: 0; margin: 0; }
.lista-ejercicios li { padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.lista-ejercicios a { color: #2b6cb0; }
.meta { color: #718096; font-size: 0.9em; }
.puntuacion { color: #276749; font-weight: 500; }
.puntuacion-badge { display: inline-block; background: #276749; color: #fff; padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 600; font-size: 0.9em; margin-left: 0.35rem; }
.sin-corregir { color: #718096; font-size: 0.9em; margin-left: 0.35rem; }
.resumen-texto { white-space: pre-wrap; background: #f7fafc; padding: 1rem; border-radius: 6px; font-size: 0.95em; max-height: 400px; overflow-y: auto; }
.lista-registros { list-style: none; padding: 0; margin: 0; }
.lista-registros li { padding: 0.6rem 0; border-bottom: 1px solid #e2e8f0; font-size: 0.9em; }
.lista-registros li .meta { display: block; margin-bottom: 0.25rem; }
.seguimiento-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; margin: 0.75rem 0; }
.seguimiento-fotos a { display: block; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.seguimiento-fotos img { width: 100%; height: 120px; object-fit: cover; display: block; }
.seguimiento-detalles summary { cursor: pointer; font-weight: 600; color: #2b6cb0; margin-top: 0.5rem; }
.seguimiento-detalles summary:hover { text-decoration: underline; }
.registro-ia { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.registro-ia li { margin-bottom: 0.35rem; }
.correccion { border-left: 4px solid #2b6cb0; }
.correccion .comentarios { margin: 0.5rem 0; }
.fotos-trabajo-correccion { margin: 0.75rem 0; }
.fotos-trabajo-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.foto-trabajo-link { display: inline-block; }
.foto-trabajo-thumb { max-height: 240px; max-width: min(100%, 400px); border-radius: 8px; border: 1px solid #cbd5e0; vertical-align: top; }
.opciones-foto { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 600px) { .opciones-foto { grid-template-columns: 1fr; } }
.opcion h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.vista-previa { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.no-imprimir { }
@media print { .no-imprimir { display: none !important; } }

/* Log Ollama */
.log-lista { display: flex; flex-direction: column; gap: 1rem; }
.log-entrada { }
.log-cabecera { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0; font-size: 0.9em; }
.log-fecha { color: #718096; }
.log-tipo { background: #e2e8f0; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 500; }
.log-modelo { color: #2b6cb0; }
.log-error { color: #c53030; }
.log-gemini-ok { color: #276749; font-weight: 600; }
.log-entrada-gemini .log-cabecera { flex-wrap: wrap; gap: 0.5rem; }
.log-detalles { margin-top: 0.5rem; }
.log-detalles summary { cursor: pointer; font-weight: 500; color: #2b6cb0; }
.log-texto { background: #f7fafc; padding: 0.75rem; border-radius: 6px; overflow-x: auto; font-size: 12px; line-height: 1.4; max-height: 20em; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.log-vacio { color: #718096; font-style: italic; }
.log-cabecera-imagen { border-bottom: 1px solid #e2e8f0; }
.log-archivo { font-weight: 600; color: #2d3748; }
.log-contenido-imagen { background: #f7fafc; padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.85rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; max-height: 24em; overflow-y: auto; margin: 0; border: 1px solid #e2e8f0; }

/* Calendario inicio */
.calendario-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 1rem 0; max-width: 320px; }
.cal-dia-semana { text-align: center; font-size: 0.75rem; font-weight: 600; color: #718096; padding: 0.25rem 0; }
.cal-celda { min-height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 0.9rem; }
.cal-vacia { background: transparent; }
.cal-dia { background: #edf2f7; color: #2d3748; }
.cal-dia.cal-completado { background: #48bb78; color: #fff; }
.cal-dia.cal-pendiente { background: #ecc94b; color: #744210; }
.cal-dia.cal-sin_ejercicios { background: #edf2f7; color: #718096; }
.cal-dia.cal-hoy { outline: 2px solid #2b6cb0; outline-offset: 1px; font-weight: 700; }
.cal-dia { cursor: pointer; user-select: none; }
.cal-dia:focus { outline: 2px solid #2b6cb0; outline-offset: 2px; }
.cal-dia.cal-seleccionado { box-shadow: inset 0 0 0 2px #2b6cb0; font-weight: 700; }
.card-calendario h3 { font-size: 1rem; margin: 1rem 0 0.5rem; color: #4a5568; }
.fila-tarea { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.fila-tarea select { width: auto; min-width: 180px; }

/* Pie con versión */
.footer-app { margin-top: 2rem; padding: 1rem 0; border-top: 1px solid #e2e8f0; text-align: center; }
.version-app { font-size: 0.85rem; color: #718096; }
