* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

:root {
  --font-sans: "Manrope", "Noto Sans", sans-serif;
}

body {
  display: grid;
  grid-template-areas:
    "sidebar navbar"
    "sidebar main";
  grid-template-columns: 280px 1fr;
  grid-template-rows: 70px 1fr;
  height: 100vh;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: #1b3f24;
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  text-align: center;
  margin-top: 10px;
}

.sidebar-header h3 {
  font-size: 1.3rem;
  margin-top: 10px;
  color: white;
}

.sidebar-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  overflow-y: auto;
}

.main-menu {
  list-style: none;
  flex: 1;
}

.menu-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-left-color: white;
}

.menu-item i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-menu h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
}

.course-list {
  list-style: none;
}

.course-item {
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.course-item.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.course-item i {
  width: 20px;
  text-align: center;
}

.no-items {
  color: black;
  font-style: italic;
  padding: 10px 15px;
}

.btn-secondary {
  margin-top: 10px;
}

.btn-export {
  margin-top: 10px;
}

/* Navbar */
.navbar {
  grid-area: navbar;
  background-color: white;
  display: flex;
  align-items: center;
  padding: 0 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 30px;
}

.logo i {
  font-size: 1.5rem;
  color: #2e7d32;
}

.logo h1 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2e7d32;
}

/* Main Content */
.main-content {
  grid-area: main;
  padding: 25px;
  overflow-y: auto;
  background-color: #f5f7fa;
}

.container {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f1f8e9;
  margin-bottom: 25px;
}

section {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #c8e6c9;
}

section.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin-bottom: 20px;
  color: #2e7d32;
  border-bottom: 2px solid #66bb6a;
  padding-bottom: 10px;
  font-size: 1.5rem;
  font-weight: 600;
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 25px;
  background: #f7fff8;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row label {
  min-width: 120px;
  font-weight: 500;
  color: #2e7d32;
}

input,
textarea,
select {
  padding: 12px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.3s;
  width: 100%;
  background-color: #fff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2e7d32;
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  padding: 12px 24px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-weight: 500;
  letter-spacing: 0.5px;
}

button:hover {
  background-color: #2e7d32;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.item {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #2e7d32;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  border: 1px solid #c8e6c9;
}

.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #2e7d32;
}

.item h3 {
  margin-bottom: 10px;
  color: #2e7d32;
  font-size: 1.2rem;
  font-weight: 600;
}

.item p {
  margin-bottom: 10px;
  color: #555;
  line-height: 1.5;
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.item-actions button {
  padding: 8px 16px;
  font-size: 14px;
}

.edit-btn {
  background-color: #7a927b;
}

.edit-btn:hover {
  background-color: #66bb6a;
}

.delete-btn {
  background-color: #43a047;
}

.delete-btn:hover {
  background-color: #2e7d32;
}

.back-btn {
  background-color: #66bb6a;
  margin-bottom: 15px;
}

.back-btn:hover {
  background-color: #2e7d32;
}

/* Vista detalle de curso */
.curso-header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #c8e6c9;
}

.curso-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid #c8e6c9;
  padding-bottom: 10px;
}

.curso-nav button {
  background-color: transparent;
  color: #2e7d32;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 8px 20px;
  font-weight: 500;
  transition: all 0.3s;
}

.curso-nav button:hover {
  background-color: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}

.curso-nav button.active {
  border-bottom-color: #2e7d32;
  font-weight: 600;
  color: #2e7d32;
}

.curso-seccion {
  display: none;
}

.curso-seccion.active {
  display: block;
}

.completada {
  opacity: 0.8;
  background-color: #f0fff4;
  border-left-color: #66bb6a;
}

/* File upload */
.file-upload {
  margin: 15px 0;
}

.file-upload label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #2e7d32;
}

.files-preview {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-preview {
  background: #e9ecef;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-preview i {
  color: #43a047;
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  color: white;
}

.badge-publico {
  background-color: #66bb6a;
  color: white;
}

.badge-privado {
  background-color: #43a047;
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 25px;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s;
  border: 1px solid #c8e6c9;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close {
  color: #7a927b;
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #2e7d32;
}

/* Markdown preview */
.markdown-preview {
  padding: 15px;
  margin-top: 10px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stats-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #2e7d32;
  transition: all 0.3s;
}

.stats-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
  color: #2e7d32;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.stats-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 5px;
}

.stats-card .label {
  color: #666;
  font-size: 0.9rem;
}

.recent-activity {
  grid-column: span 2;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.recent-activity h3 {
  color: #2e7d32;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #c8e6c9;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f8e9;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: #2e7d32;
  font-size: 1.2rem;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 500;
  color: #333;
  margin-bottom: 3px;
}

.activity-date {
  color: #777;
  font-size: 0.85rem;
}

.course-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  border: 1px solid #c8e6c9;
}

.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Reemplaza el estilo .honeycomb-pattern y .course-header con esto: */
.course-header {
  height: 120px;
  position: relative;
  overflow: hidden;
}

.course-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 60px 60px;
  opacity: 0.3;
}

.course-header .header-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.course-card:hover .course-header::before {
  background-size: 70px 70px;
  animation: honeycombMove 2s linear infinite;
}

/* Estilos para iconos de archivos */
.file-icon {
  margin-right: 5px;
  font-size: 1.2em;
  color: #2e7d32;
}

.enlace-item {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.enlace-preview {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.enlace-preview a {
  display: flex;
  align-items: center;
}

@keyframes honeycombMove {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 60px 30px;
  }
}

.course-body {
  padding: 15px;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2e7d32;
  margin-bottom: 5px;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.course-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.course-actions button {
  flex: 1;
  padding: 8px;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    grid-template-areas:
      "navbar"
      "main";
    grid-template-columns: 1fr;
    grid-template-rows: 70px 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 15px;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row label {
    margin-bottom: 5px;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 20px 15px;
  }

  .recent-activity {
    grid-column: span 1;
  }
}

/* Sidebar refinado */
.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(31, 42, 55, 0.04);
  color: var(--color-text);
}

.sidebar-header {
  border-bottom: 1px solid var(--color-border);
  justify-content: flex-start;
  margin-top: 0;
  min-height: 92px;
  padding: 18px 22px;
}

.sidebar-header img,
.sidebar-header .logo-img-small {
  height: auto !important;
  max-height: 58px;
  max-width: 210px;
  object-fit: contain;
}

.sidebar-menu {
  gap: 12px;
  padding: 18px 0;
}

.main-menu {
  flex: 0 0 auto;
  padding: 0 14px;
}

.main-menu h4,
.sidebar-menu h4 {
  color: #6c7f70;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 8px 0 !important;
  padding: 0 8px;
}

.menu-item {
  border-left: 0;
  border-radius: 8px;
  color: #263b2a;
  font-size: 0.98rem;
  gap: 12px;
  margin: 2px 0;
  padding: 11px 12px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.menu-item i {
  color: #2e7d32;
  font-size: 1rem;
  width: 22px;
}

.menu-item:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.menu-item.active {
  background: #e8f5e9;
  color: var(--color-primary-dark);
  font-weight: 700;
}

.menu-item.active i,
.menu-item:hover i {
  color: var(--color-primary-dark);
}

.auth-section {
  border-top: 1px solid var(--color-border);
  margin: 8px 14px 0;
  padding: 16px 0 0;
}

.auth-btn {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  color: white;
  margin: 0 0 12px;
  min-height: 44px;
  width: 100%;
}

.auth-btn:hover {
  background: var(--color-primary-dark);
}

.user-info {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  margin-top: 0;
  padding: 9px 10px;
}

.user-info::before {
  color: var(--color-primary);
}

.sidebar-not-logged {
  color: var(--color-muted);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--color-border) !important;
  color: var(--color-muted) !important;
  padding: 16px 18px !important;
}

.sidebar-footer-copy {
  text-align: center;
}

.sidebar-footer .auth-section {
  margin: 0;
  padding-top: 0;
}

#sidebarWelcomeUser {
  color: var(--color-primary);
  font-weight: 700;
  margin-left: 6px;
  text-transform: none;
}

.sidebar-footer p {
  margin-bottom: 4px;
}

.sidebar-footer strong {
  color: var(--color-primary-dark);
}

@media (max-width: 768px) {
  body.logged-in .sidebar {
    background: #ffffff;
    border-right: 0;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -8px 22px rgba(31, 42, 55, 0.08);
  }

  .menu-item {
    color: #405246;
  }

  .menu-item i {
    color: #2e7d32;
  }

  .menu-item.active {
    background: var(--color-primary-soft);
  }
}

/* Sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
}

.sidebar-header .logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
}

/* Navbar */
.logo-navbar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

/* Auth Modal Styles */
.auth-modal {
  padding: 20px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #c8e6c9;
}

.auth-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  position: relative;
}

.auth-tab.active {
  color: #2e7d32;
  font-weight: 500;
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2e7d32;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #2e7d32;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

.auth-submit:hover {
  background-color: #2e7d32;
}

/* User info styles */
.auth-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: white;
  font-weight: 500;
  text-align: center;
  text-transform: capitalize;
}

.user-info::before {
  content: "\f007";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  /* Necesario para los íconos sólidos */
  color: white;
  margin-right: 5px;
}

.auth-btn {
  width: 80%;
  margin-left: 25px;
  text-align: center;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Estilos para roles */
.role-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
}

.role-student {
  background-color: #2e7d32;
  color: white;
}

.role-teacher {
  background-color: #2ecc71;
  color: white;
}

.role-admin {
  background-color: #344f38;
  color: white;
}

#admin-panel {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f1f8e9;
  margin-bottom: 25px;
}

/* Estilos para el selector de roles */
#admin-user-role {
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #c8e6c9;
  flex: 1;
}

/* Estilos para los items de archivo */
.archivo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fcf8;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #dfeade;
}

.archivo-info {
  flex: 1;
  min-width: 0;
}

.archivo-nombre {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: #2d4532;
}

.archivo-tamaño {
  font-size: 0.8rem;
  color: #6c7f70;
}

.download-btn {
  background-color: #2e7d32;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.download-btn:hover {
  background-color: #2e7d32;
  transform: translateY(-1px);
}

.download-btn i {
  font-size: 0.9rem;
}

/* En style.css */
.welcome-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* Cambiado de center a flex-start */
  padding: 40px 20px;
  background-color: #f5f7fa;
  width: 100%;
  min-height: auto;
  /* Eliminamos la altura mínima fija */
}

.welcome-content {
  max-width: 1200px;
  /* Aumentamos el ancho máximo */
  width: 100%;
  /* Ocupa todo el ancho disponible hasta el máximo */
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
  /* Margen solo arriba y abajo */
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  /* Tarjetas más anchas */
  gap: 30px;
  margin: 40px 0;
}

/* Opcional: Ajustar el contenido para pantallas muy grandes */
@media (min-width: 1400px) {
  .welcome-content {
    padding: 60px;
  }

  .feature {
    padding: 30px;
  }
}

.welcome-content h1 {
  color: #2e7d32;
  margin-bottom: 15px;
  font-size: 2.2rem;
}

.welcome-content p {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.feature {
  padding: 20px;
  border-radius: 8px;
  background: #f9f9f9;
  transition: transform 0.3s;
}

.feature:hover {
  transform: translateY(-5px);
}

.feature i {
  font-size: 2.5rem;
  color: #2e7d32;
  margin-bottom: 15px;
}

.feature h3 {
  color: #2e7d32;
  margin-bottom: 10px;
}

.feature p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.welcome-btn {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 20px;
}

.welcome-btn:hover {
  background: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.welcome-note {
  margin-top: 20px;
  color: #666;
}

.welcome-note a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 500;
}

.welcome-note a:hover {
  text-decoration: underline;
}

/* Ocultar contenido principal cuando se muestra la bienvenida */
body:not(.logged-in) .container {
  display: none;
}

body.logged-in #welcome-section {
  display: none;
}

/* Estilos para el calendario */
#calendar {
  max-width: 900px;
  margin: 20px auto;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Estilos para videochat */
.videochat-container {
  padding: 20px;
  text-align: center;
}

.reunion-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.reunion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.btn-primary {
  margin-bottom: 10px;
}

/* Estilos para calificaciones */
.grades-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

/* Estilos para la sección de participantes */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.participant-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #dfeade;
  transition: all 0.3s;
}

.participant-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.participant-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.participant-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #dfeade;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2e7d32;
  font-size: 1.8rem;
}

.participant-header h4 {
  color: #2e7d32;
  margin: 0;
}

.participant-info {
  margin-bottom: 15px;
}

.participant-info p {
  color: #666;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-actions {
  display: flex;
  justify-content: flex-end;
}

.participant-actions button {
  padding: 8px 16px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.participant-actions button:hover {
  background-color: #2e7d32;
}

/* Estilos para archivos */
.archivos-container {
  margin: 15px 0;
}

.archivos-list,
.archivos-existente {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.archivo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 0.9rem;
}

.archivo-item a {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2e7d32;
  text-decoration: none;
}

.archivo-item a:hover {
  text-decoration: underline;
}

.archivo-item .remove-file {
  color: #e74c3c;
  cursor: pointer;
  margin-left: 8px;
}

.files-preview {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f8e9;
  border-radius: 4px;
  font-size: 0.9rem;
}

.file-preview .remove-file {
  color: #e74c3c;
  cursor: pointer;
  margin-left: auto;
}

.archivo-nombre {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archivo-tamaño {
  color: #666;
  font-size: 0.8rem;
}

/* En style.css */
.curso-presentacion {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.curso-presentacion:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.curso-portada {
  padding: 40px 20px;
  color: white;
  text-align: center;
  background: #23522b;
  position: relative;
  overflow: hidden;
}

.curso-portada h2 {
  padding: 0;
  font-size: 2rem;
  margin-bottom: 15px;
  color: white;
  border-bottom: none;
}

.curso-portada p {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto;
}

.curso-detalles {
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.info-item {
  background: #f5f7fa;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-item i {
  font-size: 1.2rem;
  color: var(--curso-color);
}

.curso-objetivos,
.curso-requisitos {
  background: #f5f7fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.curso-objetivos h3,
.curso-requisitos h3 {
  color: var(--curso-color);
  border-bottom: 2px solid var(--curso-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .curso-detalles {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* Añadir al final del archivo CSS */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--curso-color);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.btn-edit-small {
  padding: 3px 7px;
  background-color: #66bb6a;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-edit-small:hover {
  background-color: #2e7d32;
}

.edit-form-container {
  margin-top: 15px;
}

.edit-form-container textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  margin-bottom: 10px;
}

.edit-form-actions {
  display: flex;
  gap: 10px;
}

.edit-form-actions button {
  padding: 8px 15px;
  font-size: 0.9rem;
}

/* Estilos para la edición de objetivos/requisitos */
.edit-form-container {
  margin-top: 15px;
}

.edit-textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 15px;
  resize: vertical;
}

.edit-form-actions {
  display: flex;
  gap: 10px;
}

/* Estilos para las notificaciones */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 6px;
  color: white;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.toast.success {
  background-color: #2ecc71;
}

.toast.error {
  background-color: #e74c3c;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para enlaces */
.enlaces-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.enlaces-input-container input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #c8e6c9;
  border-radius: 4px;
}

.add-enlace-btn {
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.add-enlace-btn:hover {
  background-color: #2e7d32;
}

.enlaces-preview {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enlace-preview {
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.enlace-preview a {
  color: #2e7d32;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.enlace-preview a:hover {
  text-decoration: underline;
}

.remove-enlace {
  color: #e74c3c;
  cursor: pointer;
  margin-left: 10px;
}

.enlaces-container {
  margin: 15px 0;
}

.enlaces-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.enlace-item {
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.enlace-item a {
  color: #2e7d32;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.enlace-item a:hover {
  text-decoration: underline;
}

.entrega-detalle-modal,
.editar-entrega-modal,
.entregas-tarea-modal,
.calificacion-form-modal {
  max-width: 800px;
  background: white;
  border-radius: 10px;
  padding: 25px;
}

.entrega-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #2e7d32;
}

.entrega-item.calificada {
  border-left-color: #2ecc71;
}

.entrega-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.entrega-estudiante {
  font-weight: 600;
}

.entrega-fecha {
  color: #666;
  font-size: 0.9rem;
}

.enlace-trabajo {
  word-break: break-all;
  color: #a82525;
  text-decoration: none;
}

.enlace-trabajo:hover {
  text-decoration: underline;
}

.comentario-estudiante,
.comentario-calificador {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
}

.calificacion-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid #f39c12;
}

.entrega-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-ver-entrega {
  background: #2e7d32;
  color: white;
}

.btn-editar-entrega {
  background: #f39c12;
  color: white;
}

.btn-calificar {
  background: #2ecc71;
  color: white;
}

.btn-detalle {
  background: #9b59b6;
  color: white;
}

.no-calificacion {
  color: #666;
  font-style: italic;
}

.lista-entregas {
  max-height: 60vh;
  overflow-y: auto;
  margin: 20px 0;
}

.role-assistant {
  background-color: #f39c12;
  /* Color naranja para asistentes */
}

/* Estilos para los controles de búsqueda y filtro */
.participants-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

.search-box {
  flex: 2;
  position: relative;
  max-width: 800px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
}

.search-box input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.search-box input:focus {
  outline: none;
  border-color: #a82525;
}

#participant-role-filter {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  background-color: white;
  min-width: 100px;
  flex: 1;
}

#participant-role-filter:focus {
  outline: none;
  border-color: #a82525;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 4px;
  color: white;
  font-family: 'Arial', sans-serif;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 250px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Tipos de mensaje */
.toast.success {
  background-color: #28a745;
  /* Verde */
  border-left: 4px solid #218838;
}

.toast.error {
  background-color: #dc3545;
  /* Rojo */
  border-left: 4px solid #c82333;
}

.toast.warning {
  background-color: #ffc107;
  /* Amarillo/naranja */
  color: #212529;
  border-left: 4px solid #e0a800;
}

.toast.info {
  background-color: #43a047;
  /* Azul */
  border-left: 4px solid #2e7d32;
}

/* Estilos para el módulo de asistencia */
.asistencia-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

.asistencia-controls .filtros {
  display: flex;
  gap: 10px;
}

.asistencia-controls select,
.asistencia-controls input {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* Colores para los iconos de asistencia */
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-info { color: #43a047; }

/* Tamaño y alineación de los iconos */
.asistencia-table td i {
  font-size: 1.2em;
  vertical-align: middle;
}

/* Efecto hover para los iconos */
.asistencia-table td i:hover {
  transform: scale(1.2);
  transition: transform 0.2s;
}

.clases-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.clase-item {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--curso-color, #2e7d32);
}

.clase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.clase-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.badge.curso-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: white;
}

.clase-meta {
  margin-bottom: 15px;
}

.clase-meta p {
  margin: 5px 0;
  color: #555;
}

.clase-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.wide-modal {
  max-width: 800px;
}

.asistencia-table-container {
  max-height: 500px;
  overflow-y: auto;
  margin: 20px 0;
}

.asistencia-table {
  width: 100%;
  border-collapse: collapse;
}

.asistencia-table th,
.asistencia-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.asistencia-table th {
  background-color: #2e7d32;
  font-weight: 600;
}

.asistencia-table tr:hover {
  background-color: #f9f9f9;
}

.estado-asistencia {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  min-width: 120px;
}

.observaciones-asistencia {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  width: 100%;
}

.estadisticas-asistencia {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--curso-color, #2e7d32);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
}

/* Agrega esto a tu sección de estilos */
.participant-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.participant-card:hover {
  transform: translateY(-3px);
}

.participant-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: #666;
}

.participant-info {
  margin-bottom: 10px;
}

.participant-actions {
  display: flex;
  gap: 8px;
}

.participant-actions button {
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.cursos-inscritos {
  margin-top: 10px;
  font-size: 0.9rem;
}

.cursos-inscritos ul {
  margin: 5px 0 0 0;
  padding-left: 20px;
}

.cursos-inscritos li {
  position: relative;
  margin-bottom: 3px;
}

.remove-inscripcion {
  color: #e74c3c;
  cursor: pointer;
  margin-left: 5px;
  font-size: 0.8rem;
}

.remove-inscripcion:hover {
  opacity: 0.8;
}

.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.participants-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.search-box input {
  width: 100%;
  padding: 8px 10px 8px 30px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.wide-modal {
  max-width: 800px;
}

.asistencia-table-container {
  max-height: 500px;
  overflow-y: auto;
  margin: 15px 0;
}

.asistencia-table {
  width: 100%;
  border-collapse: collapse;
}

.asistencia-table th,
.asistencia-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.asistencia-table th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.asistencia-table tr:hover {
  background-color: #f9f9f9;
}

.estado-asistencia {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.observaciones-asistencia {
  width: 100%;
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

/* Estilos generales para modales y formularios */
.auth-modal {
  max-width: 500px;
  margin: 0 auto;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  color: white;
}

.auth-tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.auth-tab:hover {
  color: white;
  background: #2e7d32 !important;
}

.auth-tab.active {
  background: #2e7d32;
  color: white;
}

.auth-form {
  padding: 25px;
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #2e7d32;
  outline: none;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.auth-submit:hover {
  background: #1b5e20;
}

/* Estilos para tarjetas de cursos */
.course-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 20px;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.course-header {
  height: 120px;
  position: relative;
  background: #f1f8e9;
}

.course-body {
  padding: 20px;
}

.course-title {
  margin: 0 0 10px;
  color: #333;
  font-size: 1.4rem;
}

.course-description {
  color: #666;
  margin: 0 0 15px;
  line-height: 1.5;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 15px;
}

.course-stats {
  margin-left: auto;
}

.course-actions {
  display: flex;
  gap: 10px;
}

.btn-entrar,
.btn-edit,
.btn-delete {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-entrar {
  background: #2e7d32;
  color: white;
}

/* Estilos para items de guías, tareas y cápsulas */
.item {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #2e7d32;
}

.item.completada {
  opacity: 0.8;
  border-left-color: #2ecc71;
}

.item h3 {
  margin: 0 0 10px;
  color: #333;
  font-size: 1.2rem;
}

.meta-info {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 15px;
}

.markdown-preview {
  line-height: 1.6;
  margin-bottom: 15px;
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.edit-btn,
.delete-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  margin-left: 8px;
}

.badge-publico {
  background: #2ecc71;
}

.badge-privado {
  background: #e74c3c;
}

.badge-owner {
  background: #e5be01;
  color: black;
}

.badge-inactivo {
  background: #8fa58f;
}

.badge-puntos {
  background: #2e7d32;
}

/* Enlaces */
.enlaces-container {
  margin: 15px 0;
}

.enlaces-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.enlace-item {
  background: #f5f5f5;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.enlace-item a {
  color: #2e7d32;
  text-decoration: none;
}

.enlace-item a:hover {
  text-decoration: underline;
}

/* Formularios de edición */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row label {
  min-width: 100px;
}

/* Enlaces temporales */
.enlace-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.enlace-input-group input {
  flex: 1;
  padding: 8px 12px;
}

.add-enlace-btn {
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  width: 40px;
  cursor: pointer;
}

.enlaces-preview {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.enlace-preview {
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.enlace-preview a {
  color: #2e7d32;
  text-decoration: none;
}

.remove-enlace {
  color: #e74c3c;
  cursor: pointer;
}

/* Mensajes cuando no hay contenido */
.no-items {
  text-align: center;
  padding: 30px;
  color: black;
  font-style: italic;
}

/* Estilos para el modal de avisos */
.avisos-modal {
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#avisosBtn {
  position: relative;
}

.avisos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.avisos-header h2 {
  margin: 0;
  color: #2e7d32;
}

.avisos-container {
  margin-top: 20px;
}

.aviso-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid #2e7d32;
}

.aviso-header {
  margin-bottom: 10px;
}

.aviso-header h3 {
  margin: 0 0 5px 0;
  color: #333;
}

.aviso-fecha {
  color: #666;
  font-size: 0.85em;
}

.aviso-contenido {
  line-height: 1.6;
  margin-bottom: 10px;
}

.aviso-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Estilos para el navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #2e7d32;
  text-decoration: none;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-links a:hover {
  background-color: rgba(255,255,255,0.1);
}

.nav-links a i {
  margin-right: 5px;
}

.badge-notificacion {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #e74c3c;
  color: white;
  border-radius: 50%;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: bold;
}

/* Estilo para avisos no leídos */
.aviso-item.no-leido {
  border-left: 4px solid #2e7d32;
  background-color: #f8f9fa;
}

.badge-nuevo {
  background-color: #2e7d32;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 10px;
}

/* Estilos responsivos adicionales */
@media (max-width: 1024px) {
  /* Ajustes para tablets */
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .participants-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .curso-detalles {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .modal-content {
    width: 85%;
    margin: 10% auto;
  }
}

@media (max-width: 768px) {
  /* Ajustes para tablets pequeñas y móviles grandes */
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-row label {
    margin-bottom: 8px;
    min-width: auto;
  }
  
  .item-actions, .course-actions, .participant-actions {
    flex-wrap: wrap;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .curso-nav {
    flex-wrap: wrap;
  }
  
  .curso-nav button {
    flex: 1 0 120px;
    text-align: center;
  }
  
  .enlaces-input-container {
    flex-direction: column;
  }
  
  .add-enlace-btn {
    width: 100%;
    padding: 10px;
  }
}

@media (max-width: 576px) {
  /* Ajustes para móviles */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .participants-grid {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    padding: 15px;
  }
  
  .curso-header {
    height: 100px;
  }
  
  .curso-portada h2 {
    font-size: 1.5rem;
  }
  
  .curso-portada p {
    font-size: 1rem;
  }
  
  .participants-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box, #participant-role-filter {
    width: 100%;
  }
  
  .navbar {
    padding: 10px 15px;
  }
  
  .nav-links {
    gap: 10px;
  }
  
  .welcome-features {
    grid-template-columns: 1fr;
  }
  
  .feature {
    padding: 15px;
  }
  
  .aviso-item {
    padding: 12px;
  }
  
  .aviso-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .aviso-actions button {
    width: 100%;
  }
}

@media (max-width: 400px) {
  /* Ajustes para móviles muy pequeños */
  .sidebar {
    width: 100%;
    position: fixed;
    z-index: 1000;
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
  }
  
  .sidebar.active {
    display: flex;
  }
  
  .menu-item, .course-item {
    padding: 10px 15px;
  }
  
  .main-content {
    padding: 15px 10px;
  }
  
  .container, section {
    padding: 15px;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  .btn {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .auth-modal {
    padding: 15px;
  }
  
  .auth-tab {
    padding: 10px;
    font-size: 14px;
  }
  
  .form-group input {
    padding: 10px 12px;
  }
}

/* Estilos para el menú hamburguesa en móviles */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #2e7d32;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    background: white;
    flex-direction: column;
    width: 200px;
    padding: 15px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border-radius: 0 0 0 8px;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-links a {
    padding: 10px;
    color: #333;
  }
}

/* Ajustes para elementos específicos en pantallas pequeñas */
@media (max-width: 480px) {
  .curso-seccion {
    padding: 15px 10px;
  }
  
  .item {
    padding: 15px;
  }
  
  .markdown-preview {
    padding: 10px;
  }
  
  .file-upload label {
    font-size: 14px;
  }
  
  .file-preview {
    font-size: 13px;
    padding: 5px 8px;
  }
  
  .toast {
    max-width: 90%;
    left: 5%;
    right: 5%;
    bottom: 10px;
  }
}

/* Ajustes para orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    max-height: 70vh;
  }
  
  .main-content {
    padding: 10px;
  }
  
  .modal-content {
    margin: 5% auto;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Estilos para las nuevas secciones */
.content-section {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #c8e6c9;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

.section-header i {
  padding: 5px;
}

/* Estilos para el Centro de Ayuda */
.faq-container {
  margin-bottom: 30px;
}

.faq-item {
  margin-bottom: 15px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}

.faq-question {
  width: 100%;
  padding: 15px;
  text-align: left;
  background-color: #f5f7fa;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: #2e7d32;
  transition: all 0.3s;
}

.faq-question:hover {
  background-color: #e8f5e9;
}

.faq-answer {
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  line-height: 1.6;
  color: #555;
}

.faq-answer.show {
  padding: 15px;
  max-height: 500px;
}

.soporte-container ul {
  list-style-type: none;
  padding: 0;
}

.soporte-container li {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  transition: all 0.3s;
}

.soporte-container li:hover {
  background-color: #f5f7fa;
}

.soporte-container i {
  width: 30px;
  margin-right: 15px;
  color: #2e7d32;
  font-size: 1.2rem;
  text-align: center;
}

/* Estilos para Noticias */
.noticias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.noticia-card {
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
  background-color: #fff;
}

.noticia-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #2e7d32;
}

.noticia-header {
  margin-bottom: 15px;
}

.noticia-header h3 {
  color: #2e7d32;
  margin-bottom: 5px;
}

.noticia-fecha {
  font-size: 0.85rem;
  color: #666;
}

.noticia-enlace {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 16px;
  background-color: #2e7d32;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.noticia-enlace:hover {
  background-color: #2e7d32;
  text-decoration: none;
}

/* Estilos para Recursos */
.recursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.recurso-card {
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recurso-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recurso-icon {
  font-size: 2.5rem;
  color: #2e7d32;
  margin-bottom: 20px;
}

.recurso-card h3 {
  color: #2e7d32;
  margin: 15px 0;
  font-size: 1.2rem;
}

.recurso-card p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.btn-descargar, .btn-enlace {
  display: inline-block;
  margin-top: auto;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-descargar {
  background-color: #2e7d32;
  color: white;
}

.btn-descargar:hover {
  background-color: #2e7d32;
  transform: translateY(-2px);
}

.btn-enlace {
  background-color: #f5f7fa;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.btn-enlace:hover {
  background-color: #e8f5e9;
  color: #2e7d32;
}

/* Estilos para Acerca de */
.acerca-container {
  max-width: 1000px;
  margin: 0 auto;
}

.acerca-mision, .acerca-vision, .acerca-equipo, .acerca-contacto {
  margin-bottom: 40px;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
}

.acerca-mision h3, .acerca-vision h3, .acerca-equipo h3, .acerca-contacto h3 {
  color: #2e7d32;
  border-bottom: 2px solid #66bb6a;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.equipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
}

.miembro-equipo {
  text-align: center;
  padding: 20px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.3s;
}

.miembro-equipo:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.miembro-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  background-color: #f5f7fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #2e7d32;
  border: 3px solid #dcedc8;
}

.miembro-equipo h4 {
  color: #2e7d32;
  margin: 15px 0 5px;
}

.miembro-equipo p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.acerca-contacto ul {
  list-style-type: none;
  padding: 0;
}

.acerca-contacto li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.acerca-contacto i {
  width: 30px;
  margin-right: 15px;
  color: #2e7d32;
  font-size: 1.2rem;
  text-align: center;
}

/* Estilos para el modal de enlaces */
.enlaces-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 25px 0;
}

.enlace-item {
  padding: 15px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  background-color: #f5f7fa;
}

.enlace-item:hover {
  background-color: #e8f5e9;
  border-left: 4px solid #2e7d32;
}

.enlace-item i {
  margin-right: 15px;
  color: #2e7d32;
  font-size: 1.5rem;
}

.btn-cerrar {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  font-weight: 500;
}

.btn-cerrar:hover {
  background-color: #2e7d32;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .noticias-grid, .recursos-grid, .equipo-grid {
    grid-template-columns: 1fr;
  }
  
  .content-section {
    padding: 15px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-header i {
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .miembro-avatar {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .content-section {
    padding: 15px 10px;
  }
  
  .faq-question, .soporte-container li {
    padding: 12px;
  }
  
  .recurso-card, .miembro-equipo {
    padding: 15px;
  }
}

/* Estilos del Chatbot */
.chatbot-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #2e7d32;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-height: 80vh;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow: hidden;
}

.chatbot-header {
  background-color: #2e7d32;
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  max-height: 400px;
  background-color: #f9f9f9;
}

.chatbot-message {
  margin-bottom: 10px;
  padding: 10px 15px;
  border-radius: 18px;
  max-width: 80%;
  word-wrap: break-word;
  font-size: 14px;
}

.chatbot-message.user {
  background-color: #e8f5e9;
  margin-left: auto;
  border-bottom-right-radius: 5px;
}

.chatbot-message.bot {
  background-color: #f1f1f1;
  margin-right: auto;
  border-bottom-left-radius: 5px;
}

.chatbot-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #eee;
  background-color: #fff;
}

.chatbot-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

.chatbot-send {
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chatbot-send:hover {
  background-color: #1b5e20;
}

.tabla-asistencia-estudiantes {
  margin-top: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


.asistencia-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.asistencia-table th, .asistencia-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.asistencia-table th {
  background-color: #2e7d32;
  font-weight: 600;
  color: white;
}

.progress-container {
  width: 100%;
  background-color: #a3a1a1; /* Gris claro de fondo */
  border-radius: 4px;
  height: 24px;
  position: relative;
  overflow: hidden; /* Asegura que el borde redondeado se aplique correctamente */
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background-color: #1b5e20; /* Verde moderno y vibrante */
  transition: width 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); /* Sutil profundidad */
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3); /* Mejor legibilidad */
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
    border: 1px solid #c8e6c9; /* Borde sutil a juego con el tema */
    border-radius: 8px; /* Bordes redondeados consistentes */
    -webkit-overflow-scrolling: touch;
}

/* Estructura principal de la tabla */
.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0; /* Eliminado el margen para encajar en el contenedor responsive */
    font-size: 0.9em;
    min-width: 600px; /* Ancho mínimo para forzar el scroll en lugar de comprimir */
    background-color: #fff;
}

/* Encabezado de la tabla, usando el color principal de tu sidebar */
.content-table thead tr {
    background-color: #2e7d32;
    color: #ffffff;
    text-align: left;
    font-weight: 600; /* Coincide con tus encabezados */
}

.content-table th,
.content-table td {
    padding: 14px 18px; /* Un poco más de espaciado para la legibilidad */
    vertical-align: middle;
}

/* Cuerpo de la tabla */
.content-table tbody tr {
    border-bottom: 1px solid #e8f5e9; /* Un borde muy sutil entre filas */
    transition: background-color 0.2s ease-in-out;
}

/* Filas alternas con el color de fondo de tus formularios */
.content-table tbody tr:nth-of-type(even) {
    background-color: #f7fff8;
}

.content-table tbody tr:last-of-type {
    border-bottom: none; /* Sin borde en la última fila */
}

/* Efecto hover consistente con tus otros elementos */
.content-table tbody tr:hover {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* ==========================================================================
   COMPONENTES DENTRO DE LA TABLA
   ========================================================================== */

/* Badges de estado, usando tu paleta de colores */
.badge-puntos { background-color: #2e7d32; }
.estado-completada { background-color: #2ecc71; }
.estado-vencida { background-color: #e74c3c; }
.estado-proxima { background-color: #f39c12; }
.estado-pendiente { background-color: #7a927b; }

/* Información de metadatos (fechas) */
.content-table .meta-info div {
    color: #555;
    font-size: 0.9em;
    white-space: nowrap;
}
.content-table .meta-info .fas,
.content-table .meta-info .far {
    margin-right: 6px;
    color: #2e7d32; /* Iconos con el color de acento */
}

/* Listas de archivos y enlaces */
.content-table .archivos-list a,
.content-table .enlaces-list a {
    color: #2e7d32;
    text-decoration: none;
    transition: color 0.2s;
}
.content-table .archivos-list a:hover,
.content-table .enlaces-list a:hover {
    color: #2e7d32;
    text-decoration: underline;
}

/* Botones de acción (versión de tabla, solo icono) */
.item-actions-table {
    display: flex;
    gap: 8px;
    align-items: center;
}

.item-actions-table button {
    padding: 8px;
    font-size: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Usando tus clases de botones existentes para consistencia */
.item-actions-table .edit-btn {
    background-color: #2e7d32;
}
.item-actions-table .edit-btn:hover {
    background-color: #2e7d32;
}

.item-actions-table .delete-btn {
    background-color: #2e7d32; /* Color de accion para eliminar */
}
.item-actions-table .delete-btn:hover {
    background-color: #2e7d32;
}

/* Sección de Entregas (para Tareas) */
.entregas-section .btn-entregar {
    background-color: #2e7d32;
    color: white;
    padding: 8px 12px;
    font-size: 14px;
    margin-bottom: 10px;
}
.entregas-section .btn-entregar:hover {
    background-color: #2e7d32;
}

.no-items-small {
    font-size: 0.85em;
    color: #777;
    font-style: italic;
}


/* ==========================================================================
   DISEÑO RESPONSIVO (Móviles)
   ========================================================================== */

@media screen and (max-width: 768px) {
    .table-responsive {
        border: none; /* Quitar borde del contenedor en móvil */
    }

    .content-table {
        border: none;
        box-shadow: none;
    }

    /* Ocultar encabezado de tabla */
    .content-table thead {
        display: none;
    }

    .content-table, .content-table tbody, .content-table tr, .content-table td {
        display: block;
        width: 100%;
    }

    /* Cada fila se convierte en una tarjeta, imitando tu clase .item */
    .content-table tr {
        margin-bottom: 20px;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        border: 1px solid #c8e6c9;
        border-left: 4px solid #2e7d32;
        background-color: #fff !important; /* Forzar fondo blanco para todas las filas */
    }
    
    .content-table tr:last-of-type {
        margin-bottom: 0;
    }

    /* Cada celda se convierte en un bloque */
    .content-table td {
        text-align: right;
        padding-left: 45%;
        position: relative;
        border: none;
        padding-bottom: 12px;
        padding-top: 12px;
    }
    
    .content-table td:last-child {
        padding-bottom: 0;
    }

    /* La etiqueta de la columna se genera con el atributo data-label */
    .content-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px; /* Alineado con el padding de la tarjeta */
        width: calc(45% - 20px);
        text-align: left;
        font-weight: 600; /* Consistente con tus labels */
        color: #2e7d32;
    }

    .content-table .markdown-preview {
        max-width: 100%;
        text-align: left; /* Alinear texto a la izquierda en móvil */
    }

    .item-actions-table {
        justify-content: flex-end; /* Alinear botones a la derecha */
    }
}

#lista-participantes {
  display: block; /* Anula cualquier 'display: grid' o 'display: flex' */
  padding: 0; /* Opcional: elimina el padding si el grid lo tenía */
}

/* ==========================================================================
   ESTILOS ADICIONALES PARA LA TABLA DE ASISTENCIA
   ========================================================================== */

/* La tabla de clases hereda de .content-table, aquí solo añadimos personalizaciones */
.clases-table .descripcion-tabla {
  font-size: 0.9em;
  color: #666;
  margin-top: 5px;
  margin-bottom: 0;
  line-height: 1.4;
}

.clases-table .asistencia-badge {
  color: #666;
  font-weight: 600;
  padding: 5px 10px;
}

/* Ajustes para los botones de acción para que tengan texto e icono */
.clases-table .item-actions-table .btn-primary {
  align-items: center;
  color: #ffffff;
  display: flex;
  gap: 0;
  justify-content: center;
  margin-bottom: 0;
  padding: 8px;
  text-decoration: none;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.clases-table .item-actions-table .clase-videollamada-icon {
  justify-content: center;
  min-width: 36px;
  padding: 8px;
  width: 36px;
}

.clases-table .item-actions-table .clase-videollamada-icon i {
  color: #ffffff;
}

.clases-table .item-actions-table .btn-edit.icon-btn {
  align-items: center;
  display: inline-flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.clases-table .item-actions-table .btn-edit.icon-btn i {
  margin: 0;
}

.clases-table .item-actions-table {
  gap: 4px;
  justify-content: flex-start;
  width: fit-content;
}

.clases-table .item-actions-table .btn-delete {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* Estilo para la tabla de resumen de asistencia por estudiante */
.asistencia-table td,
.asistencia-table th {
    text-align: center; /* Centrar contenido de la tabla de resumen */
}
.asistencia-table th:first-child,
.asistencia-table td:first-child {
    text-align: left; /* Alinear el nombre del estudiante a la izquierda */
}

.asistencia-table .asistencia-icon i {
    font-size: 1.2rem;
}

.attendance-student-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attendance-class-card {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.attendance-class-eyebrow {
  color: var(--color-primary);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.attendance-class-card h3 {
  color: var(--color-text);
  margin: 0 0 6px;
}

.attendance-class-meta {
  color: var(--color-muted);
  margin: 0 0 8px;
}

.attendance-class-description {
  color: var(--color-text);
  margin: 0;
}

.attendance-class-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.clase-videollamada-cta {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 999px;
  color: var(--color-primary-dark);
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-width: 140px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.clase-videollamada-cta:hover {
  background: #eaf6eb;
  color: var(--color-primary-dark);
  transform: translateY(-1px);
}

.clase-videollamada-cta i {
  line-height: 1;
}

.clase-sin-enlace {
  white-space: nowrap;
}

/* En móvil, las tarjetas de clase (que ya no existen) se reemplazan por la vista de tabla responsiva */
@media (max-width: 760px) {
  .attendance-class-card {
    flex-direction: column;
  }

  .attendance-class-actions {
    width: 100%;
  }

  .clase-videollamada-cta {
    width: 100%;
  }
}
@media (max-width: 768px) {
  .clases-table .item-actions-table {
    justify-content: flex-end; /* Alinear botones a la derecha en móvil */
  }
}

/* Estilos para el panel de administración */
.config-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* Estilos para el formulario de configuración */
#config-form {
  max-width: 600px;
  margin: 0 auto;
}

/* Estilos para la sección de perfil */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.profile-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  background: #2e7d32;
  color: white;
}

@media (min-width: 768px) {
  .profile-header {
    flex-direction: row;
    padding: 30px;
  }
}

.profile-avatar {
  position: relative;
  margin-right: 0;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .profile-avatar {
    margin-right: 30px;
    margin-bottom: 0;
  }
}

.profile-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.avatar-actions {
  text-align: center;
  margin-top: 15px;
}

.btn-edit-avatar {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
}

.btn-edit-avatar:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-edit-avatar i {
  margin-right: 5px;
}

.profile-info {
  text-align: center;
}

@media (min-width: 768px) {
  .profile-info {
    text-align: left;
  }
}

.profile-info h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.profile-role {
  margin-top: 5px;
}

.profile-details {
  padding: 25px;
}

.detail-item {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.detail-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.detail-item label {
  font-weight: 600;
  color: #555;
  width: 120px;
  display: flex;
  align-items: center;
}

.detail-item label i {
  margin-right: 8px;
  width: 20px;
  text-align: center;
}

.detail-item p {
  margin: 0;
  flex: 1;
  min-width: 200px;
  padding: 8px 0;
}

/* Formulario de avatar */
.form-hint {
  font-size: 13px;
  color: #666;
  margin-top: 5px;
}

.form-hint a {
  color: #2e7d32;
  text-decoration: none;
}

.form-hint a:hover {
  text-decoration: underline;
}

.miembro-avatar-link {
  display: inline-block;
  text-decoration: none;
}

.miembro-avatar-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.miembro-avatar-img:hover {
  transform: scale(1.05);
}

.miembro-avatar {
  position: relative;
  width: 80px;
  height: 80px;
}

.avatar-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 50%;
  color: #555;
  font-size: 2rem;
}

/* Sección Acerca de - Mejorada */
.acerca-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.acerca-seccion {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.acerca-seccion h2 {
  color: #2e7d32;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #66bb6a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.equipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.miembro-equipo {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.miembro-equipo:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.miembro-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #dcedc8;
}

.miembro-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* FAQ mejorado */
.faq-container {
  margin-top: 2rem;
}

.faq-item {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-question {
  width: 100%;
  padding: 1rem 1.5rem;
  background: #f8fcf8;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: #2e7d32;
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
  background: white;
}

.faq-answer.show {
  padding: 1.5rem;
  max-height: 500px;
}

/* Contacto mejorado */
.contacto-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.contacto-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8fcf8;
  border-radius: 8px;
}

.contacto-item i {
  font-size: 1.5rem;
  color: #2e7d32;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dcedc8;
  border-radius: 50%;
}

/* Estilos para el modal de entregas */
.entregas-modal {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.entregas-stats {
  display: flex;
  gap: 15px;
  margin: 20px 0;
}

.stat-card {
  flex: 1;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--curso-color);
}

.stat-label {
  font-size: 14px;
  color: #6c757d;
}

.entregas-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.entregas-table th {
  background-color: var(--curso-color);
  color: white;
  padding: 12px;
  text-align: left;
}

.entregas-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.enlace-entrega {
  color: var(--curso-color);
  text-decoration: none;
}

.enlace-entrega:hover {
  text-decoration: underline;
}

.btn-calificar {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-calificar:hover {
  background-color: #218838;
}

.btn-editar {
  background-color: #43a047;
}

.btn-editar:hover {
  background-color: #2e7d32;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.btn-exportar {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-exportar:hover {
  background-color: #5a6268;
}

/* Estilos para el modal de calificación */
.calificacion-modal {
  max-width: 600px;
  width: 90%;
}

.entrega-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.entrega-info p {
  margin: 8px 0;
}

/* Estilos para el botón "Ver entrega" */
.btn-ver-entrega {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background-color: #f8f9fa;
  color: #2e7d32;
  border: 1px solid #2e7d32;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-ver-entrega:hover {
  background-color: #2e7d32;
  color: white;
  text-decoration: none;
}

.btn-ver-entrega i {
  margin-right: 4px;
  font-size: 10px;
}

/* Añadir esto a tu archivo CSS */
.modal-content {
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}

/* Estilos específicos para el modal de entregas */
.entregas-modal {
  max-width: 800px;
  width: 90%;
}

.entrega-detalle {
  padding: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.entrega-contenido {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 5px;
  margin: 10px 0;
}

/* Pulido visual 2026: sobrio, responsivo y consistente */
:root {
  --color-bg: #f7fbf7;
  --color-surface: #ffffff;
  --color-surface-soft: #fbfefb;
  --color-border: #dfeade;
  --color-border-strong: #cbdccb;
  --color-text: #1f3323;
  --color-muted: #667a68;
  --color-primary: #2e7d32;
  --color-primary-dark: #1b5e20;
  --color-primary-soft: #e8f5e9;
  --color-success: #2f7d5c;
  --color-success-soft: #eaf7f1;
  --color-warning: #a86b13;
  --color-warning-soft: #fff5df;
  --color-danger: #b83b3b;
  --color-danger-soft: #fff0f0;
  --color-info: #2e7d32;
  --color-info-soft: #e8f5e9;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 10px 24px rgba(31, 42, 55, 0.08);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar {
  background: #1b3f24;
  box-shadow: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar,
.container,
section,
.welcome-content,
.modal-content {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.navbar {
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 0;
}

.logo h1 {
  color: var(--color-primary-dark);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  line-height: 1.25;
}

.main-content {
  background: var(--color-bg);
  padding: 24px;
}

.container,
section {
  border-radius: var(--radius);
}

section {
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}

section.active {
  animation: fadeIn 0.18s ease-out;
}

h2 {
  color: var(--color-primary-dark);
  border-bottom: 1px solid var(--color-border);
  font-size: 1.25rem;
}

button,
.auth-submit,
.btn-primary,
.btn-secondary,
.btn-entrar,
.btn-entregas,
.btn-entregar {
  background: var(--color-primary);
  border: 1px solid transparent;
  border-radius: 7px;
  box-shadow: none;
  letter-spacing: 0;
}

button:hover,
.auth-submit:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-entrar:hover,
.btn-entregas:hover,
.btn-entregar:hover {
  background: var(--color-primary-dark);
  box-shadow: none;
  transform: none;
}

.delete-btn,
.btn-delete {
  background: var(--color-danger);
  color: white;
}

.edit-btn,
.btn-edit {
  background: #eef7ee;
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}

.edit-btn:hover,
.btn-edit:hover {
  background: #e2f0e2;
  color: var(--color-text);
}

input,
textarea,
select {
  border-color: var(--color-border-strong);
  border-radius: 7px;
  color: var(--color-text);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.14);
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.stats-card,
.recent-activity,
.stat-card,
.estadisticas-asistencia,
.participant-card,
.reunion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stats-card {
  border-left: 0;
  padding: 18px;
}

.stats-card:hover,
.course-card:hover,
.content-card:hover,
.participant-card:hover,
.curso-presentacion:hover,
.feature:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

.stats-card .value,
.stat-value {
  color: var(--color-primary);
}

.recent-activity {
  grid-column: 1 / -1;
}

.course-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  overflow: hidden;
}

.course-header {
  height: 78px;
  background: #f1f8e9 !important;
  border-bottom: 1px solid var(--color-border);
}

.course-header-strip {
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
}

.course-header .header-icon {
  color: rgba(46, 125, 50, 0.26);
  font-size: 2rem;
  right: 18px;
  bottom: 18px;
}

.course-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.course-title {
  border: 0;
  color: var(--color-text);
  font-size: 1.1rem;
  line-height: 1.25;
  margin: 0;
  padding: 0;
}

.course-description {
  color: var(--color-muted);
  margin: 0;
}

.course-meta,
.content-meta {
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.88rem;
}

.course-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.course-stats span {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-text);
  font-weight: 600;
  padding: 8px;
  text-align: center;
}

.course-actions {
  margin-top: auto;
}

.curso-nav {
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  padding-bottom: 8px;
}

.curso-nav button {
  color: var(--color-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.curso-nav button.active {
  border-bottom-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.curso-presentacion {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.curso-portada {
  background: #23522b !important;
}

.curso-portada .course-header {
  background: transparent !important;
  border: 0;
  height: auto;
  padding: 0;
}

.curso-detalles {
  gap: 20px;
}

.curso-objetivos,
.curso-requisitos,
.info-item,
.form-container {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
}

.content-card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.content-card-top,
.content-footer,
.content-actions,
.item-actions-table {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.content-icon {
  align-items: center;
  background: var(--color-primary-soft);
  border-radius: 7px;
  color: var(--color-primary-dark);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.content-card h3 {
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}

.content-description,
.content-preview {
  color: var(--color-muted);
  line-height: 1.55;
}

.content-preview {
  max-height: 150px;
  overflow: auto;
  padding: 0;
}

.content-resources {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-resources h4 {
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.archivo-item,
.enlace-item,
.file-preview,
.enlace-preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  min-width: 0;
}

.archivo-item a,
.enlace-item a,
.resource-link {
  color: var(--color-primary-dark);
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.resource-link {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 7px;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 12px;
}

.badge {
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 0;
  padding: 5px 9px;
}

.badge-publico,
.estado-presente {
  background: var(--color-success-soft);
  border-color: #b9e1cf;
  color: #1f5f46;
}

.badge-privado,
.estado-ausente,
.badge-video {
  background: var(--color-danger);
  color: white;
}

.badge-owner,
.estado-tardanza {
  background: var(--color-warning-soft);
  border-color: #f0d79f;
  color: #6f4508;
}

.badge-articulo {
  background: var(--color-info-soft);
  border-color: #c8e6c9;
  color: #1b5e20;
}

.badge-presentacion,
.badge-inactivo,
.estado-justificado {
  background: #edf1f5;
  border-color: #d2e5d3;
  color: #3d5942;
}

.asistencia-controls {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.table-responsive,
.asistencia-table-container,
.grades-table {
  overflow-x: auto;
}

.content-table,
.asistencia-table {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-radius: var(--radius);
  border-spacing: 0;
  min-width: 720px;
  overflow: hidden;
}

.content-table th,
.asistencia-table th {
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.content-table td,
.content-table th,
.asistencia-table td,
.asistencia-table th {
  border-bottom: 1px solid var(--color-border);
}

.progress-container {
  background: #e8f2e8;
  border-radius: 999px;
  height: 28px;
  min-width: 120px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  background: var(--color-success);
  height: 100%;
}

.progress-text {
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 700;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.asistencia-icon {
  text-align: center;
}

.welcome-content {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.feature {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
}

.chatbot-btn,
.chatbot-container {
  box-shadow: var(--shadow-md);
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 240px 1fr;
  }

  .dashboard-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .curso-detalles,
  .content-resources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
  }

  .navbar {
    gap: 12px;
    min-height: 70px;
    padding: 10px 14px;
  }

  .nav-links {
    gap: 8px;
  }

  #avisosBtn {
    padding: 9px 10px;
  }

  .main-content {
    padding: 14px;
  }

  .container {
    padding: 14px;
  }

  section.active {
    padding: 0;
  }

  .dashboard-grid,
  .stats-grid,
  .info-grid,
  .participants-grid,
  .content-card-grid {
    grid-template-columns: 1fr;
  }

  .course-stats {
    grid-template-columns: 1fr;
  }

  .course-actions,
  .content-footer,
  .asistencia-controls,
  .asistencia-controls .filtros,
  .participants-controls,
  .enlaces-input-container {
    align-items: stretch;
    flex-direction: column;
  }

  .course-actions button,
  .content-actions button,
  .item-actions-table button {
    width: 100%;
  }

  .welcome-container {
    padding: 14px 0;
  }

  .welcome-content {
    padding: 24px 16px;
  }

  .welcome-content h1 {
    font-size: 1.55rem;
  }

  .curso-portada {
    padding: 28px 16px;
  }

  .curso-portada h2 {
    font-size: 1.45rem;
  }

  .modal-content {
    margin: 6vh auto;
    width: calc(100% - 24px);
  }
}

@media (max-width: 520px) {
  .logo h1 {
    font-size: 0.82rem;
  }

  .nav-links button {
    font-size: 0;
    padding: 10px 12px;
  }

  .nav-links button i {
    font-size: 1rem;
  }

  .content-table,
  .asistencia-table {
    min-width: 620px;
  }

  button {
    padding: 10px 14px;
  }
}

/* Segunda pasada: experiencia completa y navegable en móvil */
.main-menu h4 {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.menu-item {
  border-left-width: 3px;
  border-radius: 0 7px 7px 0;
  margin: 2px 10px 2px 0;
}

.menu-item span,
.course-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item.active,
.course-item.active {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-footer {
  color: rgba(255, 255, 255, 0.72) !important;
}

.section-content {
  color: var(--color-text);
}

.recursos-grid,
.equipo-grid {
  gap: 16px;
}

.recurso-card,
.miembro-equipo,
.acerca-mision,
.acerca-vision,
.acerca-equipo,
.acerca-contacto,
.soporte-container,
.acerca-seccion,
.profile-card,
.aviso-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.recurso-card,
.miembro-equipo {
  align-items: flex-start;
  text-align: left;
}

.recurso-card:hover,
.miembro-equipo:hover {
  box-shadow: var(--shadow-md);
  transform: none;
}

.recurso-icon,
.miembro-avatar,
.participant-avatar {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.recurso-card h2,
.recurso-card h3,
.miembro-equipo h4,
.acerca-container h2,
.acerca-container h3,
.profile-info h3 {
  color: var(--color-primary-dark);
  letter-spacing: 0;
}

.btn-descargar,
.btn-enlace,
.noticia-enlace {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  text-decoration: none;
}

.btn-descargar,
.noticia-enlace {
  background: var(--color-primary);
  color: white;
}

.btn-descargar:hover,
.noticia-enlace:hover {
  background: var(--color-primary-dark);
  transform: none;
}

.btn-enlace {
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  color: var(--color-primary-dark);
}

.acerca-container {
  max-width: none;
  padding: 0;
}

.acerca-mision,
.acerca-vision,
.acerca-equipo,
.acerca-contacto,
.soporte-container,
.acerca-seccion {
  margin-bottom: 16px;
  padding: 22px;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-question {
  background: var(--color-surface-soft);
  color: var(--color-text);
  justify-content: space-between;
  text-align: left;
  width: 100%;
}

.faq-question:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.faq-answer {
  background: white;
  color: var(--color-muted);
  padding: 0 16px;
}

.faq-answer.show {
  padding: 16px;
}

.profile-card {
  overflow: hidden;
}

.profile-header {
  background: #23522b;
}

.profile-details {
  background: var(--color-surface);
}

.detail-item {
  border-bottom: 1px solid var(--color-border);
}

.grades-controls,
.videochat-container,
.grades-container {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
}

.grades-controls {
  align-items: center;
  display: flex;
  gap: 12px;
}

.meeting-link,
.btn-ver-entrega,
.btn-calificar,
.btn-editar-entrega,
.btn-detalle {
  border-radius: 7px;
}

.no-items,
.no-courses-message {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-muted);
}

.no-courses-message {
  grid-column: 1 / -1;
  padding: 34px;
  text-align: center;
}

.no-courses-message i {
  color: var(--color-primary);
  font-size: 2.1rem;
  margin-bottom: 10px;
}

.chatbot-btn {
  background: var(--color-primary);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.chatbot-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chatbot-header {
  background: #23522b;
}

.chatbot-message {
  border-radius: 8px;
  line-height: 1.45;
}

.chatbot-message.user {
  background: var(--color-primary);
}

.chatbot-message.bot {
  background: var(--color-surface-soft);
  color: var(--color-text);
}

/* Ajustes finales de color, botones y notificaciones */
button,
.auth-submit,
.btn-primary,
.btn-secondary,
.btn-entrar,
.btn-entregas,
.btn-entregar,
.btn-descargar,
.noticia-enlace {
  min-height: 40px;
}

.btn-secondary,
.btn-entregas,
.btn-ver-entrega {
  background: white;
  border: 1px solid var(--color-border-strong);
  color: var(--color-primary-dark);
}

.btn-secondary:hover,
.btn-entregas:hover,
.btn-ver-entrega:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.btn-entrar {
  background: var(--color-primary);
  color: white;
}

.btn-entregar {
  background: var(--color-success);
  color: white;
}

.item-actions-table .edit-btn,
.content-actions .edit-btn,
.item-actions-table .delete-btn,
.content-actions .delete-btn,
.course-actions .btn-edit,
.course-actions .btn-delete {
  min-height: 36px;
  padding: 8px 12px;
}

.item-actions-table .btn-edit.icon-btn,
.content-actions .btn-edit.icon-btn {
  align-items: center;
  display: inline-flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
  background: var(--color-primary);
  border: 1px solid transparent;
  color: #ffffff;
}

.item-actions-table .btn-edit.icon-btn:hover,
.content-actions .btn-edit.icon-btn:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
}

.item-actions-table .btn-edit.icon-btn i,
.content-actions .btn-edit.icon-btn i {
  margin: 0;
}

.course-card {
  background: #ffffff;
}

/* Modales: apariencia profesional y consistente */
.modal {
  background:
    radial-gradient(circle at top left, rgba(46, 125, 50, 0.12), transparent 34%),
    rgba(14, 24, 18, 0.58);
  backdrop-filter: blur(8px);
  padding: 24px;
}

.modal[style*="block"] {
  align-items: center;
  display: grid !important;
  justify-items: center;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid rgba(203, 220, 203, 0.95);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(17, 31, 22, 0.24);
  margin: 0;
  max-height: calc(100vh - 48px);
  max-width: min(760px, 100%);
  overflow: hidden;
  padding: 0;
  width: min(92vw, 760px);
}

.modal-content:has(.avisos-modal),
.modal-content:has(.entregas-modal),
.modal-content:has(.wide-modal) {
  max-width: min(980px, 100%);
  width: min(94vw, 980px);
}

.modal-content:has(.calificacion-modal) {
  max-width: min(680px, 100%);
  width: min(92vw, 680px);
}

#modal-content {
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  scrollbar-color: #b9cfba transparent;
  scrollbar-width: thin;
}

.close {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.2rem;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 18px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  width: 36px;
  z-index: 2;
}

.close:hover,
.close:focus-visible {
  background: var(--color-primary-soft);
  border-color: #b7d8b9;
  color: var(--color-primary-dark);
  outline: none;
}

#modal-content > h2,
#modal-content .auth-modal h2,
#modal-content .avisos-header h2,
#modal-content .calificacion-modal h2,
#modal-content .entregas-modal h2,
#modal-content .error-modal h2 {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  display: flex;
  font-size: 1.2rem;
  gap: 10px;
  line-height: 1.3;
  margin: -4px 48px 22px 0;
  padding-bottom: 16px;
}

#modal-content .auth-modal,
#modal-content .avisos-modal,
#modal-content .calificacion-modal,
#modal-content .entregas-modal,
#modal-content .error-modal,
#modal-content .wide-modal {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  max-width: none;
  overflow: visible;
  padding: 0;
  width: 100%;
}

#modal-content .wide-modal,
#modal-content .avisos-modal,
#modal-content .entregas-modal {
  width: 100%;
}

#modal-content .form-container,
#modal-content .entrega-info,
#modal-content .aviso-item,
#modal-content .stat-card,
#modal-content .entrega-detalle,
#modal-content .entrega-contenido,
#modal-content .archivos-existente,
#modal-content .files-preview,
#modal-content .enlaces-preview {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: none;
}

#modal-content .form-container {
  gap: 16px;
  margin: 0;
  padding: 18px;
}

#modal-content .form-group {
  margin-bottom: 16px;
}

#modal-content .form-row {
  align-items: flex-start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(140px, 0.38fr) minmax(0, 1fr);
}

#modal-content label {
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 700;
}

#modal-content input,
#modal-content textarea,
#modal-content select {
  background: #ffffff;
  border-color: var(--color-border-strong);
  font-size: 0.95rem;
  min-height: 42px;
}

#modal-content textarea {
  min-height: 120px;
  resize: vertical;
}

#modal-content input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

#modal-content input[type="file"] {
  background: var(--color-surface);
  padding: 9px 12px;
}

#modal-content .auth-form {
  padding: 0;
}

#modal-content .auth-submit,
#modal-content .form-container > button,
#modal-content .btn-primary,
#modal-content .btn-calificar,
#modal-content .btn-exportar,
#modal-content .btn-cerrar {
  justify-content: center;
  margin-top: 4px;
  min-height: 44px;
}

#modal-content .auth-submit,
#modal-content .form-container > button {
  width: 100%;
}

#modal-content .btn-secondary,
#modal-content .btn-cancelar {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  color: var(--color-primary-dark);
}

#modal-content .btn-secondary:hover,
#modal-content .btn-cancelar:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

#modal-content .modal-actions,
#modal-content .aviso-actions {
  align-items: center;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
}

#modal-content .entregas-stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0;
}

#modal-content .entregas-table {
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
}

#modal-content .entregas-table th {
  background: var(--color-surface-soft);
  color: var(--color-primary-dark);
}

#modal-content .entregas-table td,
#modal-content .entregas-table th {
  border-bottom: 1px solid var(--color-border);
}

#modal-content .avisos-header {
  border-bottom-color: var(--color-border);
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 48px;
}

#modal-content .avisos-header h2 {
  border: 0;
  margin: 0;
  padding: 0;
}

#modal-content .aviso-item {
  border-left: 4px solid var(--color-primary);
}

#modal-content .aviso-header h3 {
  color: var(--color-text);
  font-size: 1.02rem;
  line-height: 1.35;
}

#modal-content .aviso-fecha,
#modal-content .stat-label {
  color: var(--color-muted);
}

#modal-content .error-modal {
  text-align: center;
}

#modal-content .error-modal h2 {
  color: var(--color-danger);
  justify-content: center;
  margin-right: 0;
}

@media (max-width: 768px) {
  .modal {
    align-items: end;
    padding: 12px;
  }

  .modal[style*="block"] {
    align-items: end;
  }

  .modal-content {
    max-height: calc(100vh - 24px);
    width: 100%;
  }

  .modal-content:has(.avisos-modal),
  .modal-content:has(.entregas-modal),
  .modal-content:has(.wide-modal),
  .modal-content:has(.calificacion-modal) {
    max-width: 100%;
    width: 100%;
  }

  #modal-content {
    max-height: calc(100vh - 24px);
    padding: 24px 16px 18px;
  }

  .close {
    right: 12px;
    top: 12px;
  }

  #modal-content > h2,
  #modal-content .auth-modal h2,
  #modal-content .calificacion-modal h2,
  #modal-content .entregas-modal h2,
  #modal-content .error-modal h2 {
    font-size: 1.08rem;
    margin-right: 42px;
  }

  #modal-content .form-row,
  #modal-content .entregas-stats {
    grid-template-columns: 1fr;
  }

  #modal-content .modal-actions,
  #modal-content .aviso-actions,
  #modal-content .avisos-header {
    align-items: stretch;
    flex-direction: column;
  }

  #modal-content .modal-actions button,
  #modal-content .aviso-actions button,
  #modal-content .avisos-header button {
    width: 100%;
  }
}

.course-card:hover {
  border-color: #c8e6c9;
}

.course-header-strip {
  opacity: 0.85;
}

.course-body::before {
  content: "";
  background: var(--color-border);
  display: block;
  height: 1px;
  margin: -18px -18px 2px;
}

.stats-card,
.content-card,
.participant-card,
.recurso-card,
.profile-card,
.stat-card {
  background: #ffffff;
}

.toast {
  align-items: flex-start;
  background: white;
  border: 1px solid var(--color-border);
  border-left-width: 5px;
  border-radius: 8px;
  box-shadow: 0 16px 35px rgba(31, 42, 55, 0.16);
  color: var(--color-text);
  display: flex;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: min(380px, calc(100vw - 28px));
  padding: 13px 16px;
}

.toast.success {
  background: #f7fffb;
  border-color: #b9e1cf;
  border-left-color: var(--color-success);
  color: #184d39;
}

.toast.error {
  background: #fff8f8;
  border-color: #f1c7c7;
  border-left-color: var(--color-danger);
  color: #7d2525;
}

.toast.warning {
  background: #fffbf0;
  border-color: #f0d79f;
  border-left-color: var(--color-warning);
  color: #674206;
}

.toast.info {
  background: #f7fff8;
  border-color: #c8e6c9;
  border-left-color: var(--color-info);
  color: #1b5e20;
}

.badge-puntos {
  background: var(--color-primary-soft);
  border-color: #c8e6c9;
  color: var(--color-primary-dark);
}

.role-badge,
.role-student,
.role-teacher,
.role-admin,
.role-assistant {
  border: 1px solid transparent;
}

.role-student {
  background: var(--color-info-soft);
  border-color: #c8e6c9;
  color: #1b5e20;
}

.role-teacher {
  background: var(--color-success-soft);
  border-color: #b9e1cf;
  color: #1f5f46;
}

.role-assistant {
  background: var(--color-warning-soft);
  border-color: #f0d79f;
  color: #6f4508;
}

.role-admin {
  background: #3d5942;
  color: white;
}

@media (max-width: 768px) {
  body.logged-in {
    grid-template-areas:
      "navbar"
      "main";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding-bottom: 78px;
  }

  body.logged-in .sidebar {
    background: #1b3f24;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    bottom: 0;
    display: flex !important;
    height: 74px;
    left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    position: fixed;
    right: 0;
    top: auto;
    width: 100%;
    z-index: 900;
  }

  body:not(.logged-in) .sidebar {
    display: none !important;
  }

  .sidebar-header,
  .sidebar-footer,
  .auth-section,
  .sidebar-not-logged,
  .main-menu h4,
  .main-menu br {
    display: none !important;
  }

  .sidebar-menu {
    display: flex !important;
    flex: 1;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px 8px;
    scrollbar-width: none;
  }

  .sidebar-menu::-webkit-scrollbar {
    display: none;
  }

  .main-menu {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
  }

  .menu-item {
    align-items: center;
    border-left: 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.84);
    flex: 0 0 86px;
    flex-direction: column;
    font-size: 0.72rem;
    gap: 4px;
    justify-content: center;
    margin: 0;
    min-height: 58px;
    padding: 7px 6px;
    text-align: center;
  }

  .menu-item i {
    font-size: 1rem;
    width: auto;
  }

  .menu-item span {
    max-width: 78px;
  }

  .navbar {
    position: sticky;
    top: 0;
    z-index: 850;
  }

  .nav-links {
    align-items: center;
    background: transparent;
    box-shadow: none;
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    position: static;
    width: auto;
  }

  .content-card,
  .course-card,
  .stats-card,
  .participant-card,
  .recurso-card,
  .profile-card {
    border-radius: 8px;
  }

  .grades-controls,
  .grades-container,
  .videochat-container {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-container {
    padding: 0;
  }

  .detail-item {
    display: block;
  }

  .detail-item label {
    width: auto;
  }

  .chatbot-container {
    bottom: 92px;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .chatbot-btn {
    bottom: 92px;
  }
}

@media (max-width: 520px) {
  .content-card {
    padding: 15px;
  }

  .course-header {
    height: 72px;
  }

  .course-body {
    padding: 15px;
  }

  .form-container,
  .grades-controls,
  .grades-container,
  .videochat-container,
  .asistencia-controls {
    padding: 12px;
  }

  .acerca-mision,
  .acerca-vision,
  .acerca-equipo,
  .acerca-contacto,
  .soporte-container,
  .acerca-seccion,
  .recurso-card {
    padding: 16px;
  }
}

/* Cards de cursos refinadas */
.course-card {
  background: #ffffff;
  border: 1px solid #dcedc8;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 42, 55, 0.05);
  min-height: 0;
  overflow: hidden;
}

.course-card:hover {
  border-color: #a5d6a7;
  box-shadow: 0 8px 20px rgba(31, 42, 55, 0.08);
}

.course-card .course-header,
.course-card .course-header-strip,
.course-card .header-icon {
  display: none;
}

.course-body {
  background: #ffffff !important;
  gap: 14px;
  padding: 18px;
  position: relative;
}

.course-body::before {
  display: none;
}

.course-accent {
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.course-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 4px;
}

.course-kicker {
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.course-title {
  color: #17291b;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.25;
}

.course-description {
  color: #5f7561;
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 44px;
}

.course-card .course-stats {
  background: #f8fcf8;
  border: 1px solid #dcedc8;
  border-radius: 8px;
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.course-card .course-stats span {
  align-items: center;
  background: transparent;
  border: 0;
  border-right: 1px solid #dcedc8;
  border-radius: 0;
  color: #2d3f31;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-height: 58px;
  padding: 9px 6px;
}

.course-card .course-stats span:last-child {
  border-right: 0;
}

.course-card .course-stats strong {
  color: #17291b;
  font-size: 1rem;
  line-height: 1;
}

.course-card .course-stats small {
  color: #667a68;
  font-size: 0.76rem;
  font-weight: 600;
}

.course-card .course-meta {
  border-top: 1px solid #edf7ed;
  color: #667a68;
  font-size: 0.82rem;
  margin-top: 2px;
  padding-top: 10px;
}

.course-card .course-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 0;
}

.course-card .course-actions button {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.86rem;
  height: 34px;
  justify-content: center;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.icon-btn i {
  margin: 0;
}

.course-card .btn-entrar {
  background: var(--color-primary);
  color: white;
}

.course-card .btn-edit {
  background: var(--color-primary);
  border: 1px solid transparent;
  color: #ffffff;
}

.course-card .btn-edit:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
}

.course-card .btn-delete {
  background: #b83b3b;
  border: 1px solid #b83b3b;
  color: white;
}

@media (max-width: 640px) {
  .course-card .course-actions {
    justify-content: flex-end;
  }

  .course-description {
    min-height: auto;
  }
}

/* Crear curso */
.create-course-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  gap: 18px;
  padding: 20px;
}

.create-course-copy {
  border-bottom: 0;
  padding-bottom: 0;
}

.form-eyebrow {
  color: var(--color-primary);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.create-course-copy h3 {
  color: var(--color-text);
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.create-course-copy p {
  color: var(--color-muted);
  font-size: 0.92rem;
  margin: 0;
  margin-bottom: 10px;
}

.create-course-panel .form-row {
  align-items: end;
  display: grid;
  column-gap: 10px;
  row-gap: 14px;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.5fr) 88px;
  margin-top: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-group label {
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 700;
  min-width: 0;
}

.field-group input {
  min-height: 40px;
}

.color-field input[type="color"] {
  cursor: pointer;
  height: 40px;
  padding: 4px;
}

.create-course-btn {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  grid-column: 1 / -1;
  justify-self: end;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .create-course-panel .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .field-group-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .create-course-panel {
    padding: 15px;
  }

  .create-course-panel .form-row {
    grid-template-columns: 1fr;
  }

  .create-course-btn {
    width: 100%;
  }
}

.course-card .course-actions .icon-btn,
.course-card .course-actions .btn-entrar.icon-btn,
.course-card .course-actions .btn-edit.icon-btn,
.course-card .course-actions .btn-delete.icon-btn {
  flex: 0 0 34px;
  height: 34px;
  min-height: 34px;
  min-width: 34px;
  padding: 0;
  width: 34px;
}

@media (max-width: 768px) {
  .course-card .course-actions .icon-btn,
  .course-card .course-actions .btn-entrar.icon-btn,
  .course-card .course-actions .btn-edit.icon-btn,
  .course-card .course-actions .btn-delete.icon-btn {
    width: 34px;
  }
}

/* Sidebar final */
body .sidebar {
  background: #ffffff;
  border-right: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(31, 42, 55, 0.04);
  color: var(--color-text);
}

body .sidebar-header {
  border-bottom: 1px solid var(--color-border);
  justify-content: flex-start;
  min-height: 92px;
  padding: 18px 22px;
}

body .sidebar-header .logo-img-small {
  height: auto !important;
  max-height: 58px;
  max-width: 210px;
  object-fit: contain;
}

body .sidebar-menu {
  padding: 18px 0;
}

body .main-menu {
  padding: 0 14px;
}

body .sidebar-menu h4 {
  color: #6c7f70;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 8px 0 !important;
  padding: 0 8px;
}

body .menu-item {
  border-left: 0;
  border-radius: 8px;
  color: #263b2a;
  margin: 2px 0;
  padding: 11px 12px;
}

body .menu-item i {
  color: #2e7d32;
}

body .menu-item:hover,
body .menu-item.active {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

body .auth-section {
  border-top: 1px solid var(--color-border);
  margin: 8px 14px 0;
  padding-top: 16px;
}

body .auth-btn {
  margin: 0 0 12px;
  width: 100%;
}

body .user-info {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font: inherit;
  text-align: center;
  width: 100%;
}

body .sidebar-footer {
  border-top: 1px solid var(--color-border) !important;
  color: var(--color-muted) !important;
}

body .sidebar-footer strong {
  color: var(--color-primary-dark);
}

@media (max-width: 768px) {
  body.logged-in .sidebar {
    background: #ffffff;
    border-top: 1px solid var(--color-border);
  }
}

/* Calendario */
#calendario-section.active {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

#calendario-section > h2 {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
  margin: -2px -20px 20px;
  padding: 0 20px 16px;
}

#calendar {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: none;
  margin: 0 auto;
  max-width: 1120px;
  padding: 18px;
}

#calendar .fc {
  color: var(--color-text);
}

#calendar .fc-toolbar {
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

#calendar .fc-toolbar-title {
  color: var(--color-primary-dark);
  font-size: 1.45rem;
  font-weight: 800;
  text-transform: capitalize;
}

#calendar .fc-button {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  min-height: 34px;
  padding: 8px 12px;
  text-transform: none;
}

#calendar .fc-button:hover,
#calendar .fc-button:focus {
  background: var(--color-primary-soft);
  border-color: #a5d6a7;
  color: var(--color-primary-dark);
  box-shadow: none;
}

#calendar .fc-button-primary:not(:disabled).fc-button-active,
#calendar .fc-button-primary:not(:disabled):active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

#calendar .fc-prev-button,
#calendar .fc-next-button {
  padding: 0;
  width: 36px;
}

#calendar .fc-prev-button .fc-icon,
#calendar .fc-next-button .fc-icon {
  font-size: 1.05rem;
}

#calendar .fc-prev-button {
  border-radius: 7px 0 0 7px;
}

#calendar .fc-next-button {
  border-left: 0;
  border-radius: 0 7px 7px 0;
}

#calendar .fc-today-button {
  background: #f8fcf8;
  color: #667a68;
  margin-left: 10px !important;
}

#calendar .fc-dayGridMonth-button {
  border-radius: 7px 0 0 7px;
}

#calendar .fc-timeGridWeek-button {
  border-left: 0;
  border-radius: 0;
}

#calendar .fc-timeGridDay-button {
  border-left: 0;
  border-radius: 0 7px 7px 0;
}

#calendar .fc-col-header-cell {
  background: #f8fcf8;
  border-color: var(--color-border);
  padding: 8px 0;
}

#calendar .fc-col-header-cell-cushion {
  color: #334d37;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  text-transform: capitalize;
}

#calendar .fc-theme-standard td,
#calendar .fc-theme-standard th,
#calendar .fc-theme-standard .fc-scrollgrid {
  border-color: var(--color-border);
}

#calendar .fc-daygrid-day {
  background: #ffffff;
}

#calendar .fc-daygrid-day:hover {
  background: #fbfffb;
}

#calendar .fc-daygrid-day-number {
  color: #263b2a;
  font-size: 0.88rem;
  padding: 8px;
  text-decoration: none;
}

#calendar .fc-day-other .fc-daygrid-day-number {
  color: #a8b3bd;
}

#calendar .fc-day-today {
  background: #fff8e8 !important;
}

#calendar .fc-day-today .fc-daygrid-day-number {
  background: var(--color-warning-soft);
  border: 1px solid #f0d79f;
  border-radius: 999px;
  color: #6f4508;
  font-weight: 800;
  margin: 5px;
  padding: 2px 7px;
}

#calendar .fc-event {
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 5px;
}

#calendar .fc-event-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

#calendar .fc-timegrid-slot {
  height: 42px;
}

#calendar .fc-popover {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

@media (max-width: 900px) {
  #calendario-section.active {
    padding: 14px;
  }

  #calendario-section > h2 {
    margin: 0 0 14px;
    padding: 0 0 14px;
  }

  #calendar {
    padding: 12px;
  }

  #calendar .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #calendar .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }

  #calendar .fc-toolbar-title {
    font-size: 1.2rem;
    text-align: center;
  }
}

@media (max-width: 560px) {
  #calendar {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    margin-left: -14px;
    margin-right: -14px;
  }

  #calendar .fc-button {
    font-size: 0.84rem;
    padding: 7px 9px;
  }

  #calendar .fc-daygrid-day-frame {
    min-height: 72px;
  }
}

/* Acerca de: contacto y soporte */
.acerca-contacto,
.soporte-container {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.acerca-contacto h2,
.soporte-container h2 {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 14px;
}

.acerca-contacto h2 i,
.soporte-container h2 i {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.acerca-contacto p,
.soporte-container p {
  color: var(--color-muted);
  margin: 0 0 16px;
}

.contact-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 14px;
}

.contact-icon {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  display: grid;
  flex: 0 0 40px;
  height: 40px;
  place-items: center;
  width: 40px;
}

.contact-icon i {
  display: block;
  font-size: 1rem;
  height: 1em;
  line-height: 1;
  margin: 0;
  text-align: center;
  width: 1em;
}

/* Participantes */
#participantes-section .container {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

#participantes-section .section-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  padding-bottom: 16px;
}

#participantes-section .section-header h2 {
  border-bottom: 0;
  margin: 0;
  padding: 0;
}

#btn-matricular {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

.participants-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 18px;
}

.participant-stat {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
}

.participant-stat strong {
  color: var(--color-primary-dark);
  display: block;
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 5px;
}

.participant-stat span {
  color: var(--color-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.participants-card-grid {
  display: grid;
  gap: 12px;
}

.participant-card-modern {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px 1fr auto;
  padding: 14px;
}

.participant-avatar-modern {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: inline-flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.participant-avatar-modern i {
  line-height: 1;
}

.participant-main {
  min-width: 0;
}

.participant-name-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.participant-name-line h3 {
  color: var(--color-text);
  font-size: 1rem;
  margin: 0;
}

.participant-email {
  color: var(--color-muted);
  display: inline-block;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.participant-email:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.participant-card-actions .item-actions-table {
  justify-content: flex-end;
}

.participant-card-actions .btn-delete {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.participants-empty {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-muted);
  padding: 34px;
  text-align: center;
}

.participants-empty i {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

.participants-empty h3 {
  color: var(--color-text);
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  .participants-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .participant-card-modern {
    grid-template-columns: 44px 1fr;
  }

  .participant-card-actions {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  #participantes-section .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .participants-summary {
    grid-template-columns: 1fr;
  }

  .participant-card-modern {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .participant-card-actions {
    grid-column: auto;
  }
}

/* Detalle de curso */
.curso-header {
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.curso-header .back-btn {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}

.curso-header h2 {
  border-bottom: 0;
  color: var(--color-primary-dark);
  font-size: 1.35rem;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.curso-header p {
  color: var(--color-muted);
  font-size: 0.98rem;
  margin: 0;
}

.curso-nav {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  gap: 4px;
  margin-bottom: 20px;
  padding: 6px;
}

.curso-nav button {
  border-bottom: 0;
  border-radius: 7px;
  color: #5f7561;
  padding: 9px 14px;
}

.curso-nav button:hover {
  background: var(--color-primary-soft);
}

.curso-nav button.active {
  background: var(--color-primary);
  border-bottom: 0;
  color: white;
}

.curso-presentacion {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.curso-portada {
  background: #ffffff !important;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 0;
  text-align: left;
}

.curso-portada .course-header {
  background: #f8fcf8 !important;
  border: 0;
  border-left: 5px solid var(--curso-color, var(--color-primary));
  padding: 26px 30px;
}

.curso-portada h2 {
  color: var(--color-primary-dark);
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 8px;
  text-align: left;
}

.curso-portada p {
  color: var(--color-muted);
  font-size: 1rem;
  margin: 0;
  max-width: 900px;
}

.curso-detalles {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  padding: 26px 30px 30px;
}

.curso-info,
.curso-objetivos,
.curso-requisitos {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: none;
  margin: 0;
  padding: 20px;
}

.curso-info h3,
.curso-objetivos h3,
.curso-requisitos h3 {
  border-bottom: 0;
  color: var(--color-primary-dark);
  font-size: 1.05rem;
  margin: 0;
  padding: 0;
}

.curso-info h3 {
  margin-bottom: 16px;
}

.section-header {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.btn-edit-small {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  color: var(--color-primary-dark);
  padding: 7px 10px;
}

.btn-edit-small:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.info-grid {
  gap: 10px;
  margin-top: 0;
}

.info-item {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  min-height: 56px;
  padding: 13px 14px;
}

.info-item i {
  color: var(--color-primary);
}

#curso-objetivos-content,
#curso-requisitos-content {
  color: var(--color-text);
  line-height: 1.6;
}

.curso-requisitos {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .curso-detalles {
    grid-template-columns: 1fr;
  }

  .curso-requisitos {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .curso-portada .course-header,
  .curso-detalles {
    padding: 18px;
  }

  .curso-portada h2 {
    font-size: 1.35rem;
  }

  .curso-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}

.contact-list strong {
  color: var(--color-text);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.contact-list a,
.contact-list span {
  color: var(--color-muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.support-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Módulo de asistencia */
#asistencia-section.active {
  background: #ffffff;
}

.attendance-hero {
  align-items: center;
  background: #f8fcf8;
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 20px;
}

.attendance-eyebrow {
  color: var(--color-primary);
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.attendance-hero h2 {
  border: 0;
  color: var(--color-primary-dark);
  font-size: 1.35rem;
  margin: 0 0 6px;
  padding: 0;
}

.attendance-hero p {
  color: var(--color-muted);
  margin: 0;
}

.attendance-hero-count {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  min-width: 120px;
  padding: 14px;
  text-align: center;
}

.attendance-hero-count strong {
  color: var(--color-primary-dark);
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.attendance-hero-count span {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.asistencia-controls {
  justify-content: space-between;
  margin-bottom: 16px;
}

.asistencia-controls .filtros {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asistencia-controls label {
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.asistencia-controls input[type="date"] {
  min-height: 40px;
}

.attendance-empty {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-muted);
  margin-bottom: 18px;
  padding: 28px;
  text-align: center;
}

.attendance-empty i {
  color: var(--color-primary);
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.attendance-empty h3 {
  color: var(--color-text);
  margin: 0 0 6px;
}

.attendance-empty p {
  margin: 0;
}

.estadisticas-asistencia,
.tabla-asistencia-estudiantes {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
  padding: 20px;
}

.estadisticas-asistencia h2,
.tabla-asistencia-estudiantes h2 {
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  font-size: 1.15rem;
  margin: 0 0 18px;
  padding: 0 0 12px;
}

.stats-grid {
  gap: 12px;
  margin-top: 0;
}

.stat-card {
  align-items: center;
  background: var(--color-surface-soft);
  display: grid;
  gap: 2px 12px;
  grid-template-columns: 42px 1fr;
  padding: 14px;
  text-align: left;
}

.stat-icon {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  display: flex;
  grid-row: span 2;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.stat-value {
  font-size: 1.35rem;
  line-height: 1;
}

.stat-label {
  color: var(--color-muted);
  font-weight: 700;
}

.attendance-empty-small {
  color: var(--color-muted);
  padding: 18px;
  text-align: center;
}

.tabla-asistencia-estudiantes .table-responsive {
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

@media (max-width: 760px) {
  .attendance-hero,
  .asistencia-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .attendance-hero-count {
    min-width: 0;
  }

  .stat-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .stat-icon {
    grid-row: auto;
    margin: 0 auto 6px;
  }
}

/* Módulo de guías */
#guias-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.guide-form-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  gap: 16px;
  padding: 20px;
}

.guide-form-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  padding: 16px;
}

.guide-form-header h3 {
  color: var(--color-text);
  font-size: 1.08rem;
  margin: 0 0 6px;
}

.guide-form-header p {
  color: var(--color-muted);
  margin: 0;
}

.guide-form-panel textarea {
  min-height: 150px;
}

.guide-subpanel {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

.guide-subpanel > label {
  color: var(--color-text);
  font-weight: 800;
  margin-bottom: 10px;
}

.guide-subpanel .enlaces-input-container {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 42px;
  margin-bottom: 0;
}

.guide-subpanel .add-enlace-btn {
  align-items: center;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.guide-subpanel input[type="file"] {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
}

.guide-form-footer {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto;
}

.guide-form-footer .field-group {
  max-width: 360px;
}

#agregarGuia {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
}

.content-empty {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-muted);
  padding: 34px;
  text-align: center;
}

.content-empty i {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

.content-empty h3 {
  color: var(--color-text);
  margin: 0 0 6px;
}

.content-empty p {
  margin: 0;
}

@media (max-width: 760px) {
  .guide-subpanel .enlaces-input-container,
  .guide-form-footer {
    grid-template-columns: 1fr;
  }

  .guide-subpanel .add-enlace-btn,
  #agregarGuia,
  .guide-form-footer .field-group {
    max-width: none;
    width: 100%;
  }
}

/* Módulo de tareas */
#tareas-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.task-form-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  gap: 16px;
  padding: 20px;
}

.task-form-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  padding: 16px;
}

.task-form-header h3 {
  color: var(--color-text);
  font-size: 1.08rem;
  margin: 0 0 6px;
}

.task-form-header p {
  color: var(--color-muted);
  margin: 0;
}

.task-form-panel textarea {
  min-height: 150px;
}

.task-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 0.35fr);
}

.task-subpanel {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

.task-subpanel > label {
  color: var(--color-text);
  font-weight: 800;
  margin-bottom: 10px;
}

.task-subpanel .enlaces-input-container {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 42px;
  margin-bottom: 0;
}

.task-subpanel .add-enlace-btn {
  align-items: center;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.task-subpanel input[type="file"] {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
}

.task-form-footer {
  display: flex;
  justify-content: flex-end;
}

#agregarTarea {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
}

@media (max-width: 760px) {
  .task-meta-grid,
  .task-subpanel .enlaces-input-container {
    grid-template-columns: 1fr;
  }

  .task-form-footer,
  #agregarTarea,
  .task-subpanel .add-enlace-btn {
    width: 100%;
  }
}

/* Módulo de cápsulas */
#capsulas-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.capsule-form-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  gap: 16px;
  padding: 20px;
}

.capsule-form-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  padding: 16px;
}

.capsule-form-header h3 {
  color: var(--color-text);
  font-size: 1.08rem;
  margin: 0 0 6px;
}

.capsule-form-header p {
  color: var(--color-muted);
  margin: 0;
}

.capsule-meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.35fr);
}

.capsule-url-field {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
}

.capsule-form-panel textarea {
  min-height: 130px;
}

.capsule-form-footer {
  display: flex;
  justify-content: flex-end;
}

#agregarCapsula {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
}

@media (max-width: 760px) {
  .capsule-meta-grid {
    grid-template-columns: 1fr;
  }

  .capsule-form-footer,
  #agregarCapsula {
    width: 100%;
  }
}

/* Crear usuario admin */
#crear-usuario-section.active {
  background: #ffffff;
}

.admin-user-panel {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.admin-user-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px;
}

.page-title-card,
.profile-page-header,
.admin-user-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px;
}

.page-title-card h2,
.profile-page-header h2,
.admin-user-header h2 {
  align-items: center;
  border: 0;
  color: var(--color-primary-dark);
  display: flex;
  font-size: 1.25rem;
  gap: 6px;
  line-height: 1.2;
  margin: 0 0 8px;
  padding: 0;
}

.page-title-card h2 i,
.profile-page-header h2 i,
.admin-user-header h2 i {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--color-primary);
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1rem;
  height: auto;
  line-height: 1;
  width: auto;
}

.page-title-card p,
.profile-page-header p,
.admin-user-header p {
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
}

.admin-user-header h2 {
  border: 0;
  color: var(--color-primary-dark);
  font-size: 1.25rem;
  margin: 0 0 8px;
  padding: 0;
}

.admin-user-header p {
  color: var(--color-muted);
  margin: 0;
}

.admin-user-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.admin-user-submit {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  grid-column: 2;
  justify-content: center;
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
}

.admin-user-submit:disabled {
  cursor: wait;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-user-submit {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}

/* Videochat */
#videochat-section.active {
  background: #ffffff;
}

#videochat-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.videochat-container {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
  text-align: left;
}

.videochat-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

#crearReunionBtn {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.crear-reunion-curso-btn {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  margin: 0;
  white-space: nowrap;
}

.crear-reunion-curso-btn i,
#crearReunionBtn i {
  line-height: 1;
}

.videochat-empty {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-muted);
  padding: 32px;
  text-align: center;
}

.videochat-empty i {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

.videochat-empty h3 {
  color: var(--color-text);
  margin: 0 0 6px;
}

.meetings-summary {
  margin-bottom: 12px;
}

.meetings-summary > div {
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  padding: 10px 12px;
}

.meetings-summary strong {
  color: var(--color-primary-dark);
}

.meetings-summary span {
  color: var(--color-muted);
  font-weight: 700;
}

.meetings-grid {
  display: grid;
  gap: 12px;
}

.meeting-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px 1fr auto;
  padding: 14px;
}

.meeting-icon {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.meeting-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.meeting-title-row h3 {
  color: var(--color-text);
  font-size: 1rem;
  margin: 0;
}

.meeting-content p {
  color: var(--color-muted);
  margin: 0 0 8px;
}

.meeting-meta {
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.88rem;
}

.meeting-actions .item-actions-table {
  justify-content: flex-end;
}

.meeting-actions button {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  padding: 0;
  width: 36px;
}

.btn-unirse {
  background: var(--color-primary);
  color: white;
}

@media (max-width: 760px) {
  .videochat-actions {
    justify-content: stretch;
  }

  #crearReunionBtn {
    justify-content: center;
    width: 100%;
  }

  .meeting-card {
    align-items: flex-start;
    grid-template-columns: 44px 1fr;
  }

  .meeting-actions {
    grid-column: 2;
  }
}

/* Calificaciones */
#calificaciones-section.active {
  background: #ffffff;
}

#calificaciones-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.grades-container {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.grades-controls {
  align-items: end;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  margin-bottom: 16px;
  padding: 14px;
}

.grades-controls .field-group {
  gap: 7px;
}

.grades-controls button {
  margin: 0;
  min-height: 42px;
}

.grades-empty,
.grades-loading {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-muted);
  padding: 34px;
  text-align: center;
}

.grades-empty i,
.grades-loading i {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 10px;
}

.grades-empty h3 {
  color: var(--color-text);
  margin: 0 0 6px;
}

.grades-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  margin-bottom: 14px;
}

.grade-stat {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
}

.grade-stat strong {
  color: var(--color-primary-dark);
  display: block;
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 5px;
}

.grade-stat span {
  color: var(--color-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.grades-book-table th,
.grades-book-table td {
  text-align: center;
}

.grades-book-table th:first-child,
.grades-book-table td:first-child {
  text-align: left;
}

.grade-cell,
.final-grade {
  font-weight: 800;
}

.grade-excellent {
  background: var(--color-success-soft);
  color: #1f5f46;
}

.grade-good {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.grade-average {
  background: var(--color-warning-soft);
  color: #6f4508;
}

.grade-poor {
  background: var(--color-danger-soft);
  color: #7d2525;
}

.no-grade {
  color: var(--color-muted);
}

.grades-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.grades-actions .btn-export {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin: 0;
}

@media (max-width: 760px) {
  .grades-controls,
  .grades-summary {
    grid-template-columns: 1fr;
  }

  .grades-actions .btn-export {
    justify-content: center;
    width: 100%;
  }
}

/* Recursos */
#recursos-section.active {
  background: #ffffff;
}

#recursos-section > h2 {
  align-items: center;
  display: flex;
  gap: 8px;
}

.resources-hero {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px;
}

.resources-hero h3 {
  color: var(--color-text);
  font-size: 1.08rem;
  margin: 0 0 6px;
}

.resources-hero p {
  color: var(--color-muted);
  margin: 0;
  max-width: 760px;
}

.recursos-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 0;
}

.recurso-card {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 18px;
  text-align: left;
}

.recurso-card:hover {
  border-color: #c8e6c9;
  box-shadow: var(--shadow-md);
  transform: none;
}

.recurso-icon {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: flex;
  font-size: 1.4rem;
  height: 46px;
  justify-content: center;
  margin: 0 0 14px;
  width: 46px;
}

.resource-type {
  background: #edf1f5;
  border: 1px solid #d2e5d3;
  border-radius: 999px;
  color: #3d5942;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 10px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.recurso-card h3 {
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  font-size: 1.08rem;
  line-height: 1.35;
  margin: 0 0 12px;
  padding-bottom: 12px;
  width: 100%;
}

.recurso-card p {
  color: var(--color-muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.recurso-card .btn-descargar,
.recurso-card .btn-enlace {
  margin-top: auto;
}

@media (max-width: 560px) {
  .recurso-card {
    min-height: 0;
  }
}

/* Acerca de y perfil refinados */
#acerca-section.active,
#perfil-section.active {
  background: #ffffff;
}

.acerca-container {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  padding: 0;
}

.acerca-mision,
.acerca-vision,
.acerca-equipo,
.acerca-contacto,
.soporte-container {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin: 0;
  padding: 22px;
}

.acerca-equipo,
.soporte-container,
.acerca-contacto {
  grid-column: 1 / -1;
}

.acerca-mision h2,
.acerca-vision h2,
.acerca-equipo h2,
.acerca-contacto h2,
.soporte-container h2 {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dark);
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 14px;
}

.acerca-mision h2 i,
.acerca-vision h2 i,
.acerca-equipo h2 i,
.acerca-contacto h2 i,
.soporte-container h2 i {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.acerca-mision p,
.acerca-vision p {
  color: var(--color-muted);
  line-height: 1.65;
  margin: 0;
}

.equipo-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0 auto;
  max-width: 1200px;
}

.miembro-equipo {
  align-content: center;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: none;
  column-gap: 14px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 120px;
  padding: 16px 18px;
  row-gap: 4px;
  text-align: left;
}

.miembro-avatar {
  border: 0;
  border-radius: 50%;
  display: flex;
  grid-row: 1 / span 2;
  height: 72px;
  margin: 0;
  overflow: hidden;
  width: 72px;
}

.miembro-avatar-img {
  border: 3px solid var(--color-primary-soft);
  border-radius: 50%;
  box-shadow: none;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.miembro-equipo h4 {
  color: var(--color-primary-dark);
  font-size: 1rem;
  line-height: 1.2;
  margin: 0;
}

.miembro-equipo p {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.3;
  margin: 0;
}

@media (max-width: 900px) {
  .equipo-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-width: none;
  }
}

@media (max-width: 600px) {
  .equipo-grid {
    grid-template-columns: 1fr;
  }

  .miembro-equipo {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 0;
    padding: 14px;
  }

  .miembro-avatar {
    height: 64px;
    width: 64px;
  }
}

.faq-item {
  background: var(--color-surface-soft);
}

.profile-container {
  margin: 0 auto;
  max-width: 980px;
  padding: 0;
}

.profile-page-header {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px;
}

.profile-page-header h2 {
  border: 0;
  color: var(--color-primary-dark);
  margin: 0 0 6px;
  padding: 0;
}

.profile-page-header p {
  color: var(--color-muted);
  margin: 0;
}

.profile-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  display: flex;
  gap: 22px;
  padding: 24px;
}

.profile-avatar {
  margin: 0;
}

.profile-avatar img {
  border: 4px solid var(--color-primary-soft);
  box-shadow: none;
  height: 112px;
  width: 112px;
}

.profile-info {
  text-align: left;
}

.profile-info h3 {
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.btn-edit-avatar {
  background: #ffffff;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  color: var(--color-primary-dark);
  margin-top: 12px;
}

.btn-edit-avatar:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.profile-details-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.profile-detail-card {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 14px;
}

.profile-detail-card > span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  display: flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.profile-detail-card label {
  color: var(--color-muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.profile-detail-card p {
  color: var(--color-text);
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .acerca-container,
  .profile-details-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

section > h2,
.section-header > h2,
#participantes-section .section-header > h2,
#calendario-section > h2,
#guias-section > h2,
#tareas-section > h2,
#capsulas-section > h2,
#videochat-section > h2,
#calificaciones-section > h2,
#recursos-section > h2 {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 10px;
  color: var(--color-primary-dark);
  display: flex;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0 0 18px;
  min-height: 52px;
  padding: 10px 16px;
}

section > h2 i,
.section-header > h2 i,
#calendario-section > h2 i,
#guias-section > h2 i,
#tareas-section > h2 i,
#capsulas-section > h2 i,
#videochat-section > h2 i,
#calificaciones-section > h2 i,
#recursos-section > h2 i {
  align-items: center;
  background: var(--color-primary-soft);
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  color: var(--color-primary);
  display: inline-flex;
  font-size: 1rem;
  height: 36px;
  justify-content: center;
  line-height: 1;
  width: 36px;
}

@media (max-width: 600px) {
  section > h2,
  .section-header > h2,
  #participantes-section .section-header > h2,
  #calendario-section > h2,
  #guias-section > h2,
  #tareas-section > h2,
  #capsulas-section > h2,
  #videochat-section > h2,
  #calificaciones-section > h2,
  #recursos-section > h2 {
    font-size: 1.05rem;
    padding: 10px 12px;
  }

  section > h2 i,
  .section-header > h2 i,
  #participantes-section .section-header > h2 i,
  #calendario-section > h2 i,
  #guias-section > h2 i,
  #tareas-section > h2 i,
  #capsulas-section > h2 i,
  #videochat-section > h2 i,
  #calificaciones-section > h2 i,
  #recursos-section > h2 i {
    height: 30px;
    width: 30px;
  }
}

#crear-curso-section h2#course-title {
  align-items: center !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 12px;
  justify-content: flex-start;
  white-space: nowrap;
}

#crear-curso-section h2#course-title > span {
  display: block;
  min-width: 0;
}

#crear-curso-section h2#course-title i {
  align-items: center;
  display: inline-flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  width: 36px;
}

#cursos-section > h2,
#acerca-section > h2 {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  line-height: 1.1;
  padding: 10px 16px;
  white-space: nowrap;
}

#cursos-section > h2 i,
#acerca-section > h2 i {
  align-items: center;
  display: inline-flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  line-height: 0;
  width: 36px;
}

#cursos-section > h2 > *,
#acerca-section > h2 > * {
  min-width: 0;
}

@media (max-width: 600px) {
  #crear-curso-section h2#course-title {
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
  }

  #crear-curso-section h2#course-title i {
    flex-basis: 32px;
    height: 32px;
    width: 32px;
  }

  #cursos-section > h2,
  #acerca-section > h2 {
    gap: 8px;
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 48px;
    padding: 10px 12px;
  }

  #cursos-section > h2 i,
  #acerca-section > h2 i {
    flex-basis: 32px;
    height: 32px;
    width: 32px;
  }
}

/* Capa responsive integral: teléfonos, tablets y escritorio */
html {
  overflow-x: hidden;
}

body {
  min-width: 0;
}

img,
video,
iframe,
canvas {
  max-width: 100%;
}

.main-content,
.navbar,
.container,
section,
.course-card,
.content-card,
.stats-card,
.participant-card,
.recurso-card,
.profile-card,
.form-container,
.grades-container,
.videochat-container,
.soporte-container,
.acerca-container,
.table-responsive,
.asistencia-table-container,
.grades-table,
#calendar {
  min-width: 0;
}

.main-content {
  overflow-x: hidden;
}

.container,
section.active {
  width: 100%;
}

.dashboard-grid,
.stats-grid,
.content-card-grid,
.participants-grid,
.recursos-grid,
.admin-stats-grid,
.clases-container,
.meetings-list,
.acerca-container,
.profile-details-grid,
.welcome-features {
  min-width: 0;
}

.table-responsive,
.asistencia-table-container,
.grades-table,
.entregas-table,
.content-table {
  -webkit-overflow-scrolling: touch;
}

.content-table,
.asistencia-table,
.entregas-table {
  width: 100%;
}

.logo,
.logo h1,
.nav-links,
.section-header,
.course-title,
.content-card h3,
.recurso-card h3,
.meeting-info,
.participant-info,
.profile-info {
  min-width: 0;
}

.logo h1,
.course-title,
.content-card h3,
.recurso-card h3,
.meeting-info h3,
.participant-info h4,
.profile-info h3 {
  overflow-wrap: anywhere;
}

@media (min-width: 1440px) {
  body {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .main-content {
    padding: 30px;
  }

  .container,
  section.active {
    margin-left: auto;
    margin-right: auto;
    max-width: 1440px;
  }

  .dashboard-grid,
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content-card-grid,
  .participants-grid,
  .recursos-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (min-width: 1025px) and (max-width: 1439px) {
  body {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .main-content {
    padding: 22px;
  }

  .dashboard-grid,
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-card-grid,
  .participants-grid,
  .recursos-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .navbar {
    gap: 14px;
  }

  .nav-links {
    gap: 8px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  body {
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: 68px minmax(0, 1fr);
  }

  body .sidebar-header {
    min-height: 82px;
    padding: 14px 16px;
  }

  body .sidebar-header .logo-img-small,
  .sidebar-header img {
    max-height: 48px;
    max-width: 180px;
  }

  body .main-menu {
    padding: 0 10px;
  }

  body .menu-item {
    gap: 9px;
    padding: 10px 9px;
  }

  .main-content {
    padding: 18px;
  }

  .navbar {
    gap: 12px;
    min-width: 0;
    padding: 10px 16px;
  }

  .logo {
    margin-right: 8px;
  }

  .logo h1 {
    font-size: 1rem;
  }

  .nav-links {
    gap: 8px;
    justify-content: flex-end;
  }

  .nav-links button {
    padding: 9px 11px;
    white-space: nowrap;
  }

  .dashboard-grid,
  .stats-grid,
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-card-grid,
  .participants-grid,
  .recursos-grid,
  .clases-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .curso-detalles,
  .attendance-layout,
  .task-subpanel,
  .guide-subpanel,
  .capsula-subpanel,
  .videochat-container,
  .grades-container,
  .profile-details-grid,
  .acerca-container {
    grid-template-columns: 1fr;
  }

  #calendar {
    padding: 14px;
  }

  #calendar .fc-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
  }

  body.logged-in {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .main-content {
    padding: 14px;
  }

  .navbar {
    gap: 10px;
    min-height: 64px;
    padding: 9px 12px;
  }

  .logo {
    flex: 1 1 auto;
    margin-right: 0;
  }

  .logo h1 {
    font-size: clamp(0.78rem, 3.2vw, 1rem);
    line-height: 1.2;
  }

  .logo-navbar {
    flex: 0 0 30px;
    height: 30px;
    width: 30px;
  }

  .nav-links {
    flex: 0 0 auto;
    gap: 6px;
  }

  .nav-links button,
  #avisosBtn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 38px;
    padding: 9px 10px;
    white-space: nowrap;
  }

  .container,
  section.active,
  #calendario-section.active {
    padding: 14px;
  }

  .dashboard-grid,
  .stats-grid,
  .admin-stats-grid,
  .content-card-grid,
  .participants-grid,
  .recursos-grid,
  .clases-container,
  .welcome-features,
  .profile-details-grid,
  .acerca-container,
  .info-grid,
  .curso-detalles,
  .content-resources,
  .attendance-layout,
  .task-subpanel,
  .guide-subpanel,
  .capsula-subpanel,
  .meeting-card,
  .grades-summary,
  .grades-header,
  .resource-upload-grid {
    grid-template-columns: 1fr !important;
  }

  .section-header,
  .content-card-top,
  .content-footer,
  .content-actions,
  .course-actions,
  .item-actions,
  .item-actions-table,
  .participants-controls,
  .asistencia-controls,
  .grades-controls,
  .meeting-actions,
  .recurso-actions,
  .profile-header {
    align-items: stretch;
    flex-direction: column;
  }

  .section-header > *,
  .content-actions button,
  .course-actions button,
  .item-actions button,
  .item-actions-table button,
  .participants-controls > *,
  .asistencia-controls > *,
  .grades-controls > *,
  .meeting-actions button,
  .recurso-actions button {
    width: 100%;
  }

  .curso-nav {
    flex-wrap: nowrap;
    margin-left: -14px;
    margin-right: -14px;
    overflow-x: auto;
    padding: 0 14px 10px;
    scrollbar-width: none;
  }

  .curso-nav::-webkit-scrollbar {
    display: none;
  }

  .curso-nav button {
    flex: 0 0 auto;
    min-width: max-content;
    width: auto;
  }

  .content-table,
  .asistencia-table,
  .entregas-table {
    min-width: 680px;
  }

  #calendar {
    margin-left: -4px;
    margin-right: -4px;
    padding: 10px;
  }

  #calendar .fc-toolbar {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  #calendar .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  #calendar .fc-toolbar-title {
    font-size: 1.12rem;
    text-align: center;
  }

  .chatbot-container {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    max-height: min(620px, calc(100svh - 112px));
    right: 10px;
    width: auto;
  }

  .chatbot-messages {
    max-height: calc(100svh - 250px);
  }

  .chatbot-btn {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 14px;
  }

  .modal {
    padding: 10px;
  }

  .modal-content,
  .modal-content:has(.avisos-modal),
  .modal-content:has(.entregas-modal),
  .modal-content:has(.wide-modal),
  .modal-content:has(.calificacion-modal) {
    max-height: calc(100svh - 20px);
    width: 100%;
  }

  #modal-content {
    max-height: calc(100svh - 20px);
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  body.logged-in .sidebar {
    height: 76px;
  }

  .menu-item {
    flex-basis: 92px;
  }

  .dashboard-grid,
  .stats-grid,
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .content-card-grid,
  .participants-grid,
  .recursos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  body.logged-in {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.logged-in .sidebar {
    height: 70px;
  }

  .sidebar-menu {
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .menu-item {
    flex-basis: 74px;
    font-size: 0.66rem;
    min-height: 54px;
    padding: 6px 4px;
  }

  .menu-item span {
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-content {
    padding: 10px;
  }

  .container,
  section.active,
  #calendario-section.active {
    padding: 12px;
  }

  section > h2,
  .section-header > h2,
  #cursos-section > h2,
  #acerca-section > h2,
  #crear-curso-section h2#course-title {
    font-size: 1rem;
    min-height: 46px;
    white-space: normal;
  }

  .nav-links button,
  #avisosBtn {
    font-size: 0;
    height: 38px;
    padding: 0;
    width: 38px;
  }

  .nav-links button i,
  #avisosBtn i {
    font-size: 1rem;
    margin: 0;
  }

  .course-card .course-stats {
    grid-template-columns: 1fr !important;
  }

  .course-card .course-stats span {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .course-card .course-stats span:last-child {
    border-bottom: 0;
  }

  .content-card,
  .course-card,
  .stats-card,
  .participant-card,
  .recurso-card,
  .profile-card,
  .form-container,
  .grades-container,
  .videochat-container,
  .soporte-container {
    padding: 14px;
  }

  #modal-content {
    padding: 22px 14px 16px;
  }

  .close {
    height: 34px;
    min-height: 34px;
    width: 34px;
  }
}

@media (max-width: 380px) {
  .logo h1 {
    font-size: 0.72rem;
  }

  .logo-navbar {
    height: 28px;
    width: 28px;
  }

  .menu-item {
    flex-basis: 66px;
  }

  .menu-item span {
    max-width: 60px;
  }

  button,
  .auth-submit,
  .btn-primary,
  .btn-secondary,
  .btn-entrar,
  .btn-entregas,
  .btn-entregar {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  body.logged-in {
    padding-bottom: 0;
  }

  body.logged-in .sidebar {
    height: 58px;
  }

  .sidebar-menu {
    padding: 4px 8px;
  }

  .menu-item {
    flex-basis: 82px;
    min-height: 48px;
  }

  .menu-item i {
    font-size: 0.95rem;
  }

  .navbar {
    min-height: 56px;
    padding-bottom: 6px;
    padding-top: 6px;
  }

  .main-content {
    padding: 8px 12px 66px;
  }

  .modal-content,
  .modal-content:has(.avisos-modal),
  .modal-content:has(.entregas-modal),
  .modal-content:has(.wide-modal),
  .modal-content:has(.calificacion-modal) {
    max-height: calc(100svh - 16px);
    width: min(94vw, 980px);
  }

  #modal-content {
    max-height: calc(100svh - 16px);
    padding: 18px 20px;
  }

  .chatbot-container {
    bottom: 68px;
    max-height: calc(100svh - 82px);
  }

  .chatbot-btn {
    bottom: 68px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (min-height: 600px) {
  body.logged-in {
    grid-template-areas:
      "sidebar navbar"
      "sidebar main";
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: 68px minmax(0, 1fr);
    padding-bottom: 0;
  }

  body.logged-in .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--color-border);
    border-top: 0;
    bottom: auto;
    box-shadow: 0 1px 2px rgba(31, 42, 55, 0.04);
    color: var(--color-text);
    display: flex !important;
    grid-area: sidebar;
    height: 100vh;
    left: auto;
    overflow-x: hidden;
    overflow-y: auto;
    position: static;
    right: auto;
    top: auto;
    width: auto;
    z-index: 10;
  }

  .sidebar-header,
  .sidebar-footer,
  .auth-section,
  .sidebar-not-logged,
  .main-menu h4 {
    display: flex !important;
  }

  .main-menu br {
    display: initial !important;
  }

  .sidebar-not-logged,
  .main-menu h4 {
    display: block !important;
  }

  body .sidebar-menu {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 0;
  }

  body .main-menu {
    display: block;
    padding: 0 10px;
  }

  body .menu-item {
    align-items: center;
    color: #263b2a;
    flex: initial;
    flex-direction: row;
    font-size: 0.9rem;
    gap: 9px;
    justify-content: flex-start;
    min-height: 42px;
    padding: 10px 9px;
    text-align: left;
  }

  body .menu-item span {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  body .menu-item i {
    color: var(--color-primary);
    flex: 0 0 22px;
    width: 22px;
  }

  body .sidebar-header {
    min-height: 82px;
    padding: 14px 16px;
  }

  body .sidebar-footer {
    padding: 14px 16px !important;
  }

  .main-content {
    padding-bottom: 18px;
  }

  .chatbot-container {
    bottom: 24px;
    left: auto;
    right: 24px;
    width: min(390px, calc(100vw - 280px));
  }

  .chatbot-btn {
    bottom: 24px;
    right: 24px;
  }
}

/* Correcciones móviles verticales */
.navbar-brand-logo {
  display: none;
  height: 42px;
  max-width: 170px;
  object-fit: contain;
  width: auto;
}

@media (max-width: 767px) and (orientation: portrait) {
  .navbar {
    min-height: 62px;
    padding: 8px 12px;
  }

  .navbar .logo {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
  }

  .navbar-brand-logo {
    display: block;
    flex: 0 1 auto;
    height: 38px;
    max-width: min(175px, 50vw);
  }

  .navbar .logo h1 {
    font-size: 0;
    line-height: 0;
    max-width: 0;
    overflow: hidden;
  }

  .nav-links {
    flex-shrink: 0;
  }

  body.logged-in {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  body.logged-in .sidebar {
    height: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.logged-in .sidebar-menu {
    align-items: stretch;
    display: flex !important;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  body.logged-in .sidebar-menu::-webkit-scrollbar {
    height: 3px;
  }

  body.logged-in .main-menu {
    display: contents;
  }

  body.logged-in .main-menu h4,
  body.logged-in .main-menu br,
  body.logged-in .sidebar-header,
  body.logged-in .sidebar-footer,
  body.logged-in .auth-section,
  body.logged-in .sidebar-not-logged {
    display: none !important;
  }

  body.logged-in .menu-item {
    align-items: center;
    color: #2d3f31;
    display: flex;
    flex: 0 0 68px;
    flex-direction: column;
    font-size: 0.62rem;
    gap: 4px;
    justify-content: center;
    line-height: 1.1;
    margin: 0 2px;
    min-height: 58px;
    padding: 5px 3px;
    scroll-snap-align: start;
    text-align: center;
  }

  body.logged-in .menu-item i {
    color: var(--color-primary);
    font-size: 1rem;
    height: 22px;
    line-height: 22px;
    width: 22px;
  }

  body.logged-in .menu-item span {
    display: -webkit-box;
    max-width: 64px;
    min-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.logged-in .menu-item.active,
  body.logged-in .menu-item:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
  }

  .curso-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .curso-header h2,
  #curso-titulo {
    font-size: 1.12rem;
    line-height: 1.25;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
  }

  .curso-header p,
  #curso-descripcion {
    font-size: 0.92rem;
    line-height: 1.45;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .curso-nav {
    clear: both;
    display: flex;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
  }

  .curso-nav button {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.86rem;
    gap: 6px;
    min-height: 40px;
    padding: 9px 12px;
    width: auto;
  }

  .course-card {
    min-height: auto;
  }

  .course-body {
    gap: 12px;
    padding: 15px;
  }

  .course-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .course-title {
    font-size: 1rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
  }

  .course-description {
    font-size: 0.9rem;
    line-height: 1.42;
  }

  .course-card .course-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .course-card .course-stats span {
    border-bottom: 0;
    border-right: 1px solid var(--color-border);
    min-height: 52px;
    padding: 7px 4px;
  }

  .course-card .course-stats span:last-child {
    border-right: 0;
  }

  .course-card .course-actions {
    align-items: center !important;
    align-self: flex-end;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 2px;
    width: auto !important;
  }

  .course-card .course-actions button,
  .course-card .course-actions .icon-btn,
  .course-card .course-actions .btn-entrar.icon-btn,
  .course-card .course-actions .btn-edit.icon-btn,
  .course-card .course-actions .btn-delete.icon-btn {
    flex: 0 0 40px !important;
    height: 40px;
    min-height: 40px;
    padding: 0 !important;
    width: 40px !important;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .navbar-brand-logo {
    max-width: 145px;
  }

  body.logged-in .menu-item {
    flex-basis: 62px;
    font-size: 0.58rem;
  }

  body.logged-in .menu-item span {
    max-width: 58px;
  }

  .course-card .course-stats small {
    font-size: 0.68rem;
  }
}

/* Sidebar móvil colapsado */
.mobile-sidebar-toggle {
  display: none;
}

@media (max-width: 767px) and (orientation: portrait) {
  .mobile-sidebar-toggle {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    color: var(--color-primary-dark);
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    min-height: 38px;
    padding: 0;
    position: relative;
    width: 38px;
    z-index: 1202;
  }

  body.logged-in {
    grid-template-areas:
      "navbar"
      "main";
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 0;
  }

  body.logged-in .navbar {
    padding-left: 10px;
  }

  body.logged-in .main-content {
    padding-left: 72px;
    padding-bottom: 14px;
  }

  body.logged-in .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--color-border);
    border-top: 0;
    bottom: 0;
    box-shadow: 8px 0 24px rgba(31, 42, 55, 0.08);
    color: var(--color-text);
    display: flex !important;
    height: calc(100svh - 62px);
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    right: auto;
    top: 62px;
    transition: width 0.22s ease, box-shadow 0.22s ease;
    width: 58px;
    z-index: 1000;
  }

  body.sidebar-expanded.logged-in .sidebar {
    box-shadow: 14px 0 38px rgba(31, 42, 55, 0.18);
    width: min(286px, 86vw);
  }

  body.logged-in .sidebar-header,
  body.logged-in .sidebar-footer,
  body.logged-in .auth-section,
  body.logged-in .sidebar-not-logged {
    display: none !important;
  }

  body.logged-in .sidebar-menu {
    align-items: stretch;
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 7px;
    scrollbar-width: none;
  }

  body.logged-in .sidebar-menu::-webkit-scrollbar {
    display: none;
  }

  body.logged-in .main-menu {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 4px;
    padding: 0;
  }

  body.logged-in .main-menu h4,
  body.logged-in .main-menu br {
    display: none !important;
  }

  body.sidebar-expanded.logged-in .main-menu h4 {
    color: var(--color-muted);
    display: block !important;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin: 10px 10px 5px !important;
    overflow: hidden;
    text-transform: uppercase;
    white-space: nowrap;
  }

  body.logged-in .menu-item {
    align-items: center;
    border-radius: 8px;
    color: #2d3f31;
    display: grid;
    flex: initial;
    font-size: 0.95rem;
    gap: 0;
    grid-template-columns: 42px 1fr;
    justify-content: initial;
    line-height: 1.2;
    margin: 0;
    min-height: 42px;
    overflow: hidden;
    padding: 0;
    text-align: left;
    width: 100%;
  }

  body.logged-in .menu-item i {
    align-items: center;
    color: var(--color-primary);
    display: inline-flex;
    font-size: 1rem;
    height: 42px;
    justify-content: center;
    line-height: 1;
    width: 42px;
  }

  body.logged-in .menu-item span {
    display: block;
    max-width: none;
    min-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-right: 10px;
    text-overflow: ellipsis;
    transform: translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
    -webkit-line-clamp: initial;
  }

  body.sidebar-expanded.logged-in .menu-item {
    padding-right: 8px;
  }

  body.sidebar-expanded.logged-in .menu-item span {
    opacity: 1;
    transform: translateX(0);
  }

  body.logged-in .menu-item.active,
  body.logged-in .menu-item:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
  }

  body.sidebar-expanded::after {
    background: rgba(17, 31, 22, 0.28);
    content: "";
    inset: 62px 0 0 0;
    position: fixed;
    z-index: 999;
  }

  body.sidebar-expanded .sidebar {
    z-index: 1001;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  body.logged-in .main-content {
    padding-left: 64px;
  }

  body.logged-in .sidebar {
    width: 54px;
  }

  body.logged-in .menu-item {
    grid-template-columns: 38px 1fr;
    min-height: 40px;
  }

  body.logged-in .menu-item i {
    height: 40px;
    width: 38px;
  }
}

/* Logo oficial */
.navbar-brand-logo,
.sidebar-header .logo-img-small,
.welcome-logo {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  object-fit: contain;
}

.navbar-brand-logo {
  flex: 0 0 auto;
  height: 46px;
  max-width: 190px;
  padding: 0;
  width: auto;
}

.navbar .logo {
  align-items: center;
}

.sidebar-header .logo-img-small {
  height: auto !important;
  max-height: 72px;
  max-width: 228px;
  padding: 0;
  width: 100%;
}

.welcome-logo {
  height: auto;
  margin: 0 auto 24px;
  max-width: min(460px, 92%);
  padding: 0;
  width: 100%;
}

/* Ajuste del nuevo logo horizontal en sidebar */
body .sidebar-header {
  align-items: center;
  justify-content: center;
  min-height: 118px;
  padding: 16px 18px;
}

body .sidebar-header .logo-img-small {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  height: auto !important;
  max-height: 86px;
  max-width: 230px;
  object-fit: contain;
  padding: 0;
  width: 100%;
}

@media (min-width: 768px) and (max-width: 1024px) and (min-height: 600px) {
  body .sidebar-header {
    min-height: 98px;
    padding: 14px;
  }

  body .sidebar-header .logo-img-small {
    max-height: 68px;
    max-width: 202px;
  }
}

@media (min-width: 768px) {
  .navbar .logo h1 {
    margin-left: 4px;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .navbar-brand-logo {
    height: 42px;
    max-width: min(176px, 48vw);
    padding: 0;
  }

  .welcome-logo {
    max-width: min(320px, 94%);
    padding: 0;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .navbar-brand-logo {
    height: 38px;
    max-width: 145px;
  }
}

/* Evita que el breakpoint de tablet deje una columna vacia en telefonos verticales. */
@media (max-width: 767px) and (orientation: portrait) {
  body,
  body:not(.logged-in) {
    grid-template-areas:
      "navbar"
      "main";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
  }

  body:not(.logged-in) .navbar,
  body:not(.logged-in) .main-content {
    grid-column: 1;
    width: 100%;
  }

  body:not(.logged-in) .main-content {
    padding: 10px;
  }

  body:not(.logged-in) .mobile-sidebar-toggle {
    display: none;
  }

  body:not(.logged-in) .welcome-container {
    padding: 10px 0;
    width: 100%;
  }

  body:not(.logged-in) .welcome-content {
    margin: 0;
    max-width: none;
    width: 100%;
  }
}

/* Normalizacion responsive final para telefonos verticales */
@media (max-width: 767px) and (orientation: portrait) {
  body.logged-in {
    grid-template-areas:
      "main";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    min-height: 100svh;
    padding-bottom: 0;
    width: 100%;
  }

  body.logged-in .navbar {
    border-radius: 0;
    grid-area: navbar;
    gap: 8px;
    left: 0;
    min-height: 62px;
    padding: 8px 10px;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 1200;
  }

  body.logged-in .main-content {
    grid-area: main;
    overflow: visible;
    padding: 72px 8px 18px 52px;
    width: 100%;
  }

  body.logged-in .sidebar {
    align-self: start;
    border-top: 0;
    bottom: auto;
    grid-area: sidebar;
    height: calc(100svh - 62px);
    left: 0;
    max-width: calc(100vw - 20px);
    min-height: calc(100svh - 62px);
    position: fixed;
    top: 62px;
    width: 52px;
    z-index: 1100;
  }

  body.sidebar-expanded.logged-in .sidebar {
    height: calc(100svh - 62px);
    left: 0;
    position: fixed;
    top: 62px;
    width: min(300px, 82vw);
  }

  body.logged-in .sidebar-menu {
    gap: 6px;
    height: 100%;
    padding: 30px 6px 10px;
  }

  body.logged-in .main-menu {
    gap: 3px;
    min-width: 0;
    width: 100%;
  }

  body.logged-in .menu-item {
    grid-template-columns: 40px minmax(0, 1fr);
    display: grid !important;
    align-items: center;
    min-height: 42px;
    overflow: hidden;
    width: 100%;
  }

  body.logged-in .menu-item i {
    height: 42px;
    width: 40px;
  }

  body.logged-in .menu-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.sidebar-expanded.logged-in .menu-item {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr);
    padding-right: 10px;
  }

  body.sidebar-expanded.logged-in .menu-item span {
    display: block;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: none;
    white-space: nowrap;
  }

  body.sidebar-expanded.logged-in .auth-section {
    border-top: 1px solid var(--color-border);
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    margin: auto 6px 0;
    padding: 12px 0 2px;
  }

  body.sidebar-expanded.logged-in .auth-btn {
    align-items: center;
    border-radius: 8px;
    display: inline-flex !important;
    font-size: 0.9rem;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
  }

  body.sidebar-expanded.logged-in #loginBtn {
    display: none !important;
  }

  body.sidebar-expanded.logged-in .user-info {
    display: block;
    font-size: 0.78rem;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.sidebar-expanded::after {
    inset: 62px 0 0 0;
  }

  .container,
  section.active,
  #calendario-section.active {
    border-radius: 8px;
    max-width: 100%;
    overflow: visible;
    padding: 10px;
  }

  section > h2,
  .section-header > h2,
  #cursos-section > h2,
  #acerca-section > h2,
  #calendario-section > h2 {
    display: grid;
    font-size: 0.98rem;
    grid-template-columns: 30px minmax(0, 1fr);
    line-height: 1.18;
    min-height: 46px;
    overflow-wrap: anywhere;
    padding: 9px 10px;
    white-space: normal;
  }

  section > h2 i,
  .section-header > h2 i,
  #cursos-section > h2 i,
  #acerca-section > h2 i,
  #calendario-section > h2 i {
    height: 30px;
    width: 30px;
  }

  .acerca-container,
  .profile-container,
  .profile-card,
  .profile-details-grid,
  .acerca-mision,
  .acerca-vision,
  .acerca-equipo,
  .acerca-contacto,
  .soporte-container,
  #calendar {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .acerca-container,
  .profile-details-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .acerca-mision,
  .acerca-vision,
  .acerca-equipo,
  .acerca-contacto,
  .soporte-container {
    overflow: visible;
    padding: 16px;
  }

  .acerca-mision h2,
  .acerca-vision h2,
  .acerca-equipo h2,
  .acerca-contacto h2,
  .soporte-container h2 {
    align-items: center;
    display: grid;
    font-size: 1rem;
    grid-template-columns: 34px minmax(0, 1fr);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .acerca-mision p,
  .acerca-vision p,
  .acerca-contacto p,
  .soporte-container p,
  .faq-answer,
  .faq-answer li,
  .contact-list,
  .contact-list li {
    font-size: 0.95rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .faq-question {
    align-items: center;
    display: grid;
    font-size: 0.92rem;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 18px;
    line-height: 1.25;
    min-height: 44px;
    padding: 10px 12px;
    text-align: left;
    white-space: normal;
  }

  .contact-list li {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: 36px minmax(0, 1fr);
    min-width: 0;
    overflow: visible;
  }

  .contact-list a,
  .contact-list span,
  .contact-list strong {
    overflow-wrap: anywhere;
  }

  .contact-list,
  .support-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-list li > div {
    min-width: 0;
  }

  .profile-page-header {
    margin-bottom: 12px;
    padding: 14px;
  }

  .profile-page-header h2 {
    font-size: 1.05rem;
    line-height: 1.2;
  }

  .profile-header {
    align-items: center !important;
    gap: 14px;
    padding: 18px 14px;
    text-align: center;
  }

  .profile-avatar img {
    height: 96px;
    width: 96px;
  }

  .profile-info {
    max-width: 100%;
    text-align: center;
    width: 100%;
  }

  .profile-info h3 {
    font-size: 1.35rem;
    line-height: 1.2;
  }

  .profile-details-grid {
    padding: 14px;
  }

  .profile-detail-card {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 12px;
  }

  .profile-detail-card > span {
    height: 36px;
    width: 36px;
  }

  .profile-detail-card p {
    font-size: 0.98rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #calendar {
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    padding: 8px;
  }

  #calendar .fc-toolbar {
    gap: 8px;
  }

  #calendar .fc-toolbar-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  #calendar .fc-button {
    font-size: 0.78rem;
    min-height: 34px;
    padding: 6px 8px;
  }

  .chatbot-btn {
    bottom: 18px;
    height: 58px;
    right: 12px;
    width: 58px;
  }

  .chatbot-container {
    bottom: 84px;
    left: 76px;
    max-height: calc(100svh - 112px);
    right: 10px;
    width: auto;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  body.logged-in {
    grid-template-columns: minmax(0, 1fr);
  }

  body.logged-in .main-content {
    padding-left: 48px;
    padding-right: 8px;
  }

  body.logged-in .sidebar {
    width: 48px;
  }

  body.logged-in .menu-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  body.logged-in .menu-item i {
    width: 36px;
  }

  body.sidebar-expanded.logged-in .sidebar {
    width: min(292px, 84vw);
  }

  .acerca-mision,
  .acerca-vision,
  .acerca-equipo,
  .acerca-contacto,
  .soporte-container,
  .profile-details-grid {
    padding: 12px;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .mobile-sidebar-toggle:hover,
  .mobile-sidebar-toggle:focus-visible,
  body.sidebar-expanded .mobile-sidebar-toggle {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #ffffff !important;
  }

  .mobile-sidebar-toggle:hover i,
  .mobile-sidebar-toggle:focus-visible i,
  body.sidebar-expanded .mobile-sidebar-toggle i,
  .mobile-sidebar-toggle:hover i::before,
  .mobile-sidebar-toggle:focus-visible i::before,
  body.sidebar-expanded .mobile-sidebar-toggle i::before {
    color: #ffffff !important;
  }

  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item,
  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item:hover,
  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item.active {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item i {
    align-items: center;
    background: transparent !important;
    border-radius: 8px;
    color: var(--color-primary) !important;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    width: 36px;
  }

  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item:hover i,
  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item.active i {
    background: var(--color-primary) !important;
    color: #ffffff !important;
  }

  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item:hover i::before,
  body.logged-in:not(.sidebar-expanded) .sidebar .menu-item.active i::before {
    color: #ffffff !important;
  }
}

.page-title-card h2 i,
.profile-page-header h2 i,
.admin-user-header h2 i {
  background: transparent !important;
  border: 0 !important;
  color: var(--color-primary) !important;
  flex: 0 0 auto !important;
  height: auto !important;
  width: auto !important;
}
