.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.login-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-box {
  background: white;
  border-radius: 20px;
  padding: 50px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: #667eea;
  margin: 0 0 10px 0;
}

.login-subtitle {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 0 0 30px 0;
}

.error-message {
  background: #fee;
  color: #c33;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid #c33;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
  color: #999;
}

.login-btn {
  padding: 14px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-toggle {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #e0e0e0;
}

.login-toggle p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.toggle-btn {
  background: none;
  border: none;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  margin-left: 5px;
  transition: color 0.3s;
}

.toggle-btn:hover {
  color: #764ba2;
  text-decoration: underline;
}

.demo-credentials {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.demo-credentials p {
  margin: 0 0 5px 0;
  font-size: 13px;
  font-weight: 600;
  color: #667eea;
}

.demo-credentials small {
  color: #999;
  font-size: 12px;
}

.login-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.gradient-1,
.gradient-2,
.gradient-3 {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  filter: blur(40px);
}

.gradient-1 {
  width: 300px;
  height: 300px;
  background: #667eea;
  top: -100px;
  left: -100px;
  animation: float 20s infinite;
}

.gradient-2 {
  width: 200px;
  height: 200px;
  background: #764ba2;
  bottom: -50px;
  right: -50px;
  animation: float 15s infinite reverse;
}

.gradient-3 {
  width: 150px;
  height: 150px;
  background: #667eea;
  bottom: 100px;
  right: 50px;
  animation: float 25s infinite;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

@media (max-width: 768px) {
  .login-box {
    padding: 40px 30px;
  }

  .login-title {
    font-size: 28px;
  }

  .login-form {
    gap: 15px;
  }

  .form-group input {
    padding: 10px 14px;
    font-size: 13px;
  }

  .login-btn {
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 15px;
  }

  .login-box {
    padding: 30px 20px;
    border-radius: 16px;
  }

  .login-title {
    font-size: 24px;
  }

  .login-subtitle {
    font-size: 13px;
  }

  .form-group label {
    font-size: 12px;
  }

  .form-group input {
    padding: 10px 12px;
    font-size: 12px;
  }

  .login-btn {
    padding: 11px 14px;
    font-size: 13px;
  }

  .login-toggle p,
  .demo-credentials p {
    font-size: 13px;
  }
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  cursor: pointer;
  transition: opacity 0.3s;
}

.logo:hover {
  opacity: 0.8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-link {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
}

.logout-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
  }

  .logo {
    font-size: 20px;
  }

  .header-right {
    gap: 10px;
  }

  .user-info {
    display: none;
  }

  .admin-link {
    padding: 6px 12px;
    font-size: 12px;
  }

  .logout-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.course-image {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.course-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.course-card:hover .course-overlay {
  opacity: 1;
}

.see-course-btn {
  padding: 10px 24px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.see-course-btn:hover {
  transform: scale(1.05);
}

.course-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex-grow: 1;
}

.course-info h3 {
  font-size: 18px;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.course-description {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
}

.course-stats {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #999;
}

.stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.course-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  transition: width 0.3s;
}
.course-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
}

.course-completed-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #16a34a;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.progress-fill.complete {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-text {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: #667eea;
}

.dashboard-page {
  width: 100%;
  min-height: 100vh;
  background-color: #f5f7fa;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.welcome-section {
  margin-bottom: 40px;
  text-align: center;
}

.welcome-section h1 {
  font-size: 32px;
  color: #333;
  margin-bottom: 10px;
}

.welcome-section p {
  font-size: 16px;
  color: #666;
}

.search-section {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.search-input {
  width: 100%;
  max-width: 500px;
  padding: 14px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

.courses-section h2 {
  font-size: 24px;
  color: #333;
  margin-bottom: 25px;
}

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

.no-courses {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  color: #999;
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 20px 15px;
  }

  .welcome-section h1 {
    font-size: 24px;
  }

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

/* PAGE ROOT */
.cp-page {
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
}

/* === LOADING === */
.cp-loading {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #667eea;
  font-size: 16px;
}
.cp-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: cp-spin 0.8s linear infinite;
}
@keyframes cp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* === BARRA SUPERIOR DEL CURSO === */
.cp-course-bar {
  background: #1e293b;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  flex-shrink: 0;
}
.cp-back {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.cp-back:hover {
  background: rgba(255, 255, 255, 0.1);
}
.cp-course-bar-center {
  flex: 1 1;
  min-width: 0;
}
.cp-course-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.cp-course-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.cp-bar-track {
  width: 160px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}
.cp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #a78bfa);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.cp-bar-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

/* === LAYOUT PRINCIPAL === */
.cp-layout {
  display: flex;
  flex: 1 1;
  overflow: hidden;
}

/* === SIDEBAR AND NAV === */
.cp-nav {
  width: 300px;
  min-width: 300px;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cp-nav-label {
  padding: 16px 20px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #475569;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}
.cp-nav-list {
  flex: 1 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}
.cp-nav-list::-webkit-scrollbar {
  width: 4px;
}
.cp-nav-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.cp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  width: 100%;
}
.cp-nav-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}
.cp-nav-item--active {
  background: rgba(102, 126, 234, 0.15) !important;
  border-left-color: #667eea !important;
}
.cp-nav-item--done .cp-nav-title {
  color: #475569;
  text-decoration: line-through;
}
.cp-nav-item--done.cp-nav-item--active .cp-nav-title {
  text-decoration: none;
  color: #94a3b8;
}
.cp-nav-item--locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.cp-nav-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  flex-shrink: 0;
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
}
.cp-nav-item--active .cp-nav-icon {
  background: #667eea;
  color: white;
}
.cp-nav-text {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-nav-num {
  font-size: 10px;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cp-nav-title {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cp-nav-item--active .cp-nav-title {
  color: #e2e8f0;
  font-weight: 700;
}

.cp-ring-wrap {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.cp-ring-box {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.cp-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.cp-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.cp-ring-fg {
  stroke: #667eea;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.cp-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
}
.cp-ring-label {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* === CONTENIDO PRINCIPAL === */
.cp-content {
  flex: 1 1;
  overflow-y: auto;
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
}
.cp-content::-webkit-scrollbar {
  width: 6px;
}
.cp-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.cp-empty {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #94a3b8;
  font-size: 16px;
  text-align: center;
}
.cp-empty span {
  font-size: 56px;
}

/* === LECCION === */
.cp-lesson-head {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 2px solid #f1f5f9;
}
.cp-lesson-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cp-lesson-num {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.cp-lesson-done-tag {
  background: #dcfce7;
  color: #16a34a;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.cp-lesson-h1 {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0 0 10px;
}
.cp-lesson-p {
  font-size: 16px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

.cp-lesson-body {
  flex: 1 1;
  margin-bottom: 40px;
}

/* HTML enriquecido */
.cp-html {
  font-size: 16px;
  line-height: 1.85;
  color: #334155;
}
.cp-html h1,
.cp-html h2,
.cp-html h3,
.cp-html h4 {
  color: #0f172a;
  font-weight: 800;
  margin: 28px 0 12px;
}
.cp-html h1 {
  font-size: 26px;
}
.cp-html h2 {
  font-size: 22px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}
.cp-html h3 {
  font-size: 18px;
}
.cp-html p {
  margin-bottom: 14px;
}
.cp-html ul,
.cp-html ol {
  margin: 0 0 14px 24px;
}
.cp-html li {
  margin-bottom: 6px;
}
.cp-html a {
  color: #667eea;
}
.cp-html img {
  max-width: 100%;
  border-radius: 10px;
  margin: 14px 0;
}
.cp-html strong {
  color: #0f172a;
}
.cp-html blockquote {
  border-left: 4px solid #667eea;
  padding: 12px 18px;
  margin: 18px 0;
  background: #f0f4ff;
  border-radius: 0 10px 10px 0;
  color: #4b5563;
  font-style: italic;
}
.cp-html iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 220px;
  border: none;
  border-radius: 10px;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.cp-html iframe[src*="drive.google.com"] {
  aspect-ratio: 16/9;
  min-height: 220px;
}

.cp-drive-embed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.cp-drive-embed iframe {
  margin: 0;
}

.cp-drive-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: -webkit-fit-content;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  background: #111827;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #1f2937;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.cp-drive-open:hover {
  background: #0f172a;
  transform: translateY(-1px);
}

.cp-no-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  background: #f8fafc;
  border-radius: 14px;
  border: 2px dashed #e2e8f0;
  color: #94a3b8;
  font-size: 15px;
  text-align: center;
}
.cp-no-content span {
  font-size: 36px;
}

/* === FOOTER NAVEGACION === */
.cp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 28px;
  border-top: 2px solid #f1f5f9;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cp-video-gate {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  flex-direction: column;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

.cp-video-gate-text {
  margin: 0;
  font-size: 13px;
  color: #9a3412;
  font-weight: 600;
}
.cp-btn-prev,
.cp-btn-next {
  padding: 11px 22px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}
.cp-btn-prev:hover:not(:disabled),
.cp-btn-next:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
  background: #f0f4ff;
}
.cp-btn-prev:disabled,
.cp-btn-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cp-btn-complete {
  flex: 1 1;
  max-width: 260px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
.cp-btn-complete:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
}
.cp-btn-reprint {
  margin-left: 16px;
  padding: 10px 16px;
  background: #f9fafb;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.cp-btn-reprint:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.cp-btn-reprint:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cp-btn-complete--undo {
  background: #f8fafc;
  color: #64748b;
  border: 2px solid #e2e8f0;
  box-shadow: none;
}
.cp-btn-complete--undo:hover:not(:disabled) {
  background: #fff1f2;
  border-color: #fca5a5;
  color: #dc2626;
}
.cp-btn-complete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cp-eval-card {
  margin-top: 40px;
  padding: 24px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.cp-eval-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cp-eval-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #667eea;
  margin-bottom: 8px;
}

.cp-eval-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #0f172a;
}

.cp-eval-head p {
  margin: 0;
  color: #64748b;
}

.cp-eval-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.cp-eval-meta span {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
}

.cp-eval-status.ok {
  background: #dcfce7;
  color: #166534;
}
.cp-eval-status.bad {
  background: #fee2e2;
  color: #991b1b;
}

.cp-eval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cp-eval-question {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  background: #fcfdff;
}

.cp-eval-question h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: #0f172a;
}

.cp-eval-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-eval-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.cp-eval-option:hover {
  border-color: #a5b4fc;
  background: #f8faff;
}

.cp-eval-option input {
  margin-top: 3px;
}

.cp-eval-actions {
  margin-top: 20px;
}

.cp-eval-feedback {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.cp-eval-feedback.ok {
  color: #166534;
}
.cp-eval-feedback.bad {
  color: #991b1b;
}

/* === MODAL FINALIZACION === */
.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: cp-fade 0.3s ease;
}
@keyframes cp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.cp-modal {
  background: white;
  border-radius: 24px;
  padding: 52px 44px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  animation: cp-up 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes cp-up {
  from {
    transform: translateY(40px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.cp-trophy {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
  animation: cp-bounce 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}
@keyframes cp-bounce {
  0% {
    transform: scale(0) rotate(-10deg);
  }
  60% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.cp-modal-h2 {
  font-size: 30px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px;
}
.cp-modal-sub {
  font-size: 15px;
  color: #64748b;
  margin: 0 0 4px;
}
.cp-modal-name {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
  margin: 0 0 24px;
}
.cp-modal-cert {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 10px 26px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 28px;
}
.cp-modal-cta {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.cp-modal-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cp-modal-cta:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cp-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-modal-ghost {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: white;
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cp-modal-ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .cp-nav {
    width: 240px;
    min-width: 240px;
  }
  .cp-content {
    padding: 28px 24px;
  }
  .cp-lesson-h1 {
    font-size: 24px;
  }
  .cp-bar-track {
    width: 100px;
  }
}
@media (max-width: 640px) {
  .cp-layout {
    flex-direction: column;
  }
  .cp-nav {
    width: 100%;
    min-width: 0;
    max-height: 260px;
  }
  .cp-course-bar {
    flex-wrap: wrap;
  }
  .cp-course-bar-right {
    width: 100%;
  }
  .cp-bar-track {
    flex: 1 1;
  }
  .cp-content {
    padding: 20px 16px;
  }
  .cp-footer {
    flex-direction: column;
  }
  .cp-btn-prev,
  .cp-btn-next,
  .cp-btn-complete {
    width: 100%;
    max-width: none;
  }

  .cp-eval-card {
    padding: 18px 16px;
    margin-top: 28px;
  }

  .cp-eval-head h2 {
    font-size: 22px;
  }

  .cp-video-gate {
    align-items: stretch;
  }

  .cp-html iframe {
    border-radius: 8px;
    min-height: 210px;
    margin: 12px 0;
  }

  .cp-html iframe[src*="drive.google.com"] {
    min-height: 210px;
  }

  .cp-drive-embed {
    gap: 8px;
    margin: 12px 0;
  }

  .cp-drive-open {
    width: 100%;
    font-size: 12px;
    padding: 10px 12px;
  }
}

═══════════════════════════════════════════════════════════════ */ * {
  box-sizing: border-box;
}

.cp-page {
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
}

/* ── Loading ─────────────────────────────────────────────────── */
.cp-loading {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #667eea;
  font-size: 16px;
}

.cp-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: cp-spin 0.8s linear infinite;
}

@keyframes cp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Top Bar ─────────────────────────────────────────────────── */
.cp-topbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cp-back-btn {
  background: none;
  border: 1px solid #e2e8f0;
  color: #667eea;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.cp-back-btn:hover {
  background: #f0f4ff;
  border-color: #667eea;
}

.cp-topbar-info {
  flex: 1 1;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.cp-topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.cp-topbar-progress {
  flex: 1 1;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}

.cp-topbar-track {
  flex: 1 1;
  height: 6px;
  background: #e8ecf0;
  border-radius: 3px;
  overflow: hidden;
}

.cp-topbar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.cp-topbar-pct {
  font-size: 12px;
  color: #8892b0;
  white-space: nowrap;
  font-weight: 600;
}

/* ── Body Layout ─────────────────────────────────────────────── */
.cp-body {
  flex: 1 1;
  display: grid;
  grid-template-columns: 300px 1fr;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.cp-sidebar {
  background: #0f172a;
  display: flex;
  flex-direction: column;
  position: -webkit-sticky;
  position: sticky;
  top: 50px;
  height: calc(100vh - 50px);
  overflow: hidden;
}

.cp-sidebar-header {
  padding: 18px 20px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.cp-lessons-scroll {
  flex: 1 1;
  overflow-y: auto;
  padding: 6px 0;
}

.cp-lessons-scroll::-webkit-scrollbar {
  width: 4px;
}
.cp-lessons-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.cp-lessons-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

/* Lesson buttons in sidebar */
.cp-lesson-btn {
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-left-color 0.15s;
}

.cp-lesson-btn:hover:not(.locked) {
  background: rgba(255, 255, 255, 0.05);
}

.cp-lesson-btn.current {
  background: rgba(102, 126, 234, 0.12);
  border-left-color: #667eea;
}

.cp-lesson-btn.done .cp-lesson-btn-title {
  color: #64748b;
  text-decoration: line-through;
  -webkit-text-decoration-color: #334155;
          text-decoration-color: #334155;
}

.cp-lesson-btn.done.current .cp-lesson-btn-title {
  text-decoration: none;
  color: #94a3b8;
}

.cp-lesson-btn.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.cp-lesson-status-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cp-num,
.cp-icon-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.cp-icon-play {
  background: #667eea;
  color: white;
  font-size: 9px;
  padding-left: 2px;
}

.cp-lesson-btn.current .cp-num {
  background: rgba(102, 126, 234, 0.3);
  color: #a5b4fc;
}

.cp-lesson-btn-text {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-lesson-btn-num {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.cp-lesson-btn-title {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cp-lesson-btn.current .cp-lesson-btn-title {
  color: #e2e8f0;
  font-weight: 700;
}

/* Progreso circular en sidebar */
.cp-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cp-sidebar-progress-ring {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
}

.cp-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.cp-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.cp-ring-fill {
  stroke: #667eea;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.cp-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
}

.cp-sidebar-progress-text {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* ── MAIN CONTENT AREA ───────────────────────────────────────── */
.cp-main {
  padding: 40px 52px;
  height: calc(100vh - 50px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cp-main::-webkit-scrollbar {
  width: 6px;
}
.cp-main::-webkit-scrollbar-track {
  background: #f0f2f5;
}
.cp-main::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Lesson header */
.cp-lesson-head {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 2px solid #f1f5f9;
}

.cp-lesson-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.cp-done-badge {
  background: #dcfce7;
  color: #16a34a;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.cp-lesson-title {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0 0 10px;
}

.cp-lesson-desc {
  font-size: 16px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

/* Lesson content */
.cp-lesson-content {
  flex: 1 1;
  margin-bottom: 36px;
}

/* Rich HTML content */
.cp-rich-content {
  font-size: 16px;
  line-height: 1.85;
  color: #334155;
}

.cp-rich-content h1,
.cp-rich-content h2,
.cp-rich-content h3,
.cp-rich-content h4 {
  color: #0f172a;
  font-weight: 800;
  margin: 30px 0 14px;
  line-height: 1.3;
}

.cp-rich-content h1 {
  font-size: 26px;
}
.cp-rich-content h2 {
  font-size: 22px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}
.cp-rich-content h3 {
  font-size: 18px;
}
.cp-rich-content h4 {
  font-size: 16px;
}

.cp-rich-content p {
  margin-bottom: 16px;
}

.cp-rich-content ul,
.cp-rich-content ol {
  margin: 0 0 16px 24px;
}

.cp-rich-content li {
  margin-bottom: 8px;
}

.cp-rich-content a {
  color: #667eea;
  text-decoration: underline;
  transition: color 0.2s;
}

.cp-rich-content a:hover {
  color: #764ba2;
}

.cp-rich-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* YouTube and Video iframe responsivo */
.cp-rich-content iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 10px;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.cp-rich-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 14px;
}

.cp-rich-content code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: monospace;
}

.cp-rich-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.cp-rich-content blockquote {
  border-left: 4px solid #667eea;
  padding: 14px 20px;
  margin: 20px 0;
  background: #f0f4ff;
  border-radius: 0 10px 10px 0;
  color: #4b5563;
  font-style: italic;
}

.cp-rich-content strong {
  color: #0f172a;
}

/* Empty states */
.cp-empty-state {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #94a3b8;
  font-size: 16px;
  padding: 80px 20px;
  text-align: center;
}

.cp-empty-state span {
  font-size: 52px;
}

.cp-no-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 20px;
  color: #94a3b8;
  font-size: 15px;
  background: #f8fafc;
  border-radius: 14px;
  border: 2px dashed #e2e8f0;
  text-align: center;
}

.cp-no-content span {
  font-size: 36px;
}

/* ── Footer navigation ───────────────────────────────────────── */
.cp-lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 28px;
  border-top: 2px solid #f1f5f9;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.cp-btn-nav {
  padding: 11px 22px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 150px;
}

.cp-btn-nav:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
  background: #f0f4ff;
}

.cp-btn-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cp-btn-mark {
  padding: 13px 30px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1 1;
  max-width: 280px;
  text-align: center;
}

.cp-btn-mark.complete {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.cp-btn-mark.complete:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(102, 126, 234, 0.45);
}

.cp-btn-mark.undo {
  background: #f8fafc;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.cp-btn-mark.undo:hover:not(:disabled) {
  background: #fff1f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.cp-btn-mark:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.cp-btn-loading {
  display: inline-block;
  animation: cp-pulse 0.8s ease-in-out infinite;
  letter-spacing: 3px;
}

@keyframes cp-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

/* ── Completion Modal ────────────────────────────────────────── */
.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: cp-fade-in 0.3s ease;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}

@keyframes cp-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cp-modal {
  background: white;
  border-radius: 24px;
  padding: 52px 44px;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  animation: cp-slide-up 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cp-slide-up {
  from {
    transform: translateY(40px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cp-modal-trophy {
  font-size: 76px;
  line-height: 1;
  margin-bottom: 20px;
  animation: cp-bounce 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s both;
}

@keyframes cp-bounce {
  0% {
    transform: scale(0) rotate(-10deg);
  }
  60% {
    transform: scale(1.2) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.cp-modal-title {
  font-size: 32px;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px;
}

.cp-modal-sub {
  font-size: 16px;
  color: #64748b;
  margin: 0 0 6px;
}

.cp-modal-course {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
  margin: 0 0 28px;
}

.cp-modal-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 10px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 30px;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.cp-modal-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.cp-modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cp-body {
    grid-template-columns: 260px 1fr;
  }

  .cp-main {
    padding: 28px 24px;
  }

  .cp-lesson-title {
    font-size: 24px;
  }
}

@media (max-width: 700px) {
  .cp-body {
    grid-template-columns: 1fr;
  }

  .cp-sidebar {
    position: static;
    height: auto;
    max-height: 280px;
  }

  .cp-main {
    padding: 24px 18px;
    height: auto;
  }

  .cp-topbar-title {
    display: none;
  }

  .cp-lesson-footer {
    flex-direction: column;
  }

  .cp-btn-nav,
  .cp-btn-mark {
    width: 100%;
    max-width: none;
    text-align: center;
  }

  .cp-modal {
    padding: 36px 28px;
  }
  .cp-modal-title {
    font-size: 26px;
  }
}

/* LessonEditor - Visual content editor */

.le-wrap {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

/* === TOOLBAR === */
.le-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.le-group {
  display: flex;
  gap: 3px;
}

.le-sep {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

/* keep old name too just in case */
.le-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

.le-btn {
  padding: 6px 10px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
}

.le-btn:hover {
  background: #f0f4ff;
  border-color: #667eea;
  color: #667eea;
}

.le-b {
  font-weight: 900;
}
.le-i {
  font-style: italic;
}
.le-u {
  text-decoration: underline;
}

/* Special buttons */
.le-btn-yt {
  background: #fff0f0;
  border-color: #fca5a5;
  color: #dc2626;
  font-weight: 700;
}
.le-btn-yt:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.le-btn-img {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
  font-weight: 700;
}
.le-btn-img:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

.le-btn-link {
  background: #fefce8;
  border-color: #fde047;
  color: #854d0e;
  font-weight: 700;
}
.le-btn-link:hover {
  background: #ca8a04;
  border-color: #ca8a04;
  color: white;
}

/* Editable area */
.le-editor {
  min-height: 320px;
  padding: 24px 28px;
  font-size: 15px;
  line-height: 1.8;
  color: #334155;
  outline: none;
  overflow-y: auto;
}

/* Placeholder when empty */
.le-editor:empty::before {
  content: attr(data-placeholder);
  color: #bbb;
  pointer-events: none;
  font-size: 14px;
  line-height: 1.6;
}

/* Styled content */
.le-editor h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 22px 0 10px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 6px;
}

.le-editor h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 18px 0 8px;
}

.le-editor p {
  margin-bottom: 12px;
}

.le-editor ul {
  margin: 0 0 12px 24px;
  list-style: disc;
}

.le-editor ol {
  margin: 0 0 12px 24px;
  list-style: decimal;
}

.le-editor li {
  margin-bottom: 6px;
}

.le-editor blockquote {
  border-left: 4px solid #667eea;
  padding: 12px 18px;
  margin: 16px 0;
  background: #f0f4ff;
  border-radius: 0 10px 10px 0;
  color: #4b5563;
  font-style: italic;
}

.le-editor a {
  color: #667eea;
  text-decoration: underline;
}

.le-editor strong,
.le-editor b {
  font-weight: 700;
  color: #0f172a;
}
.le-editor em,
.le-editor i {
  font-style: italic;
}
.le-editor u {
  text-decoration: underline;
}

/* Embedded videos */
.le-editor .le-video-block {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
}

.le-editor iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* Images */
.le-editor img,
.le-editor .le-img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
}

/* Separator */
.le-editor hr,
.le-editor .le-hr {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 24px 0;
}

/* === MODALES === */
.le-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  animation: le-fade 0.2s ease;
}

@keyframes le-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.le-modal {
  background: white;
  border-radius: 16px;
  padding: 32px 36px;
  width: 460px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: le-up 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes le-up {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.le-modal-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.le-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}

.le-modal-desc {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 10px;
}

.le-modal-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.le-modal-input:focus {
  border-color: #667eea;
}

.le-modal-hint {
  font-size: 12px !important;
  color: #94a3b8 !important;
  margin-top: 6px !important;
}

.le-modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.le-modal-cancel {
  padding: 10px 20px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s;
}
.le-modal-cancel:hover {
  background: #e2e8f0;
}

.le-modal-ok {
  padding: 10px 22px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: opacity 0.15s;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
}
.le-modal-ok:hover {
  opacity: 0.88;
}

/* =============================================
   ADMIN PANEL - Professional LMS Design
   ============================================= */

/* Layout */
.admin-page {
  min-height: 100vh;
  background: #f0f2f5;
}

/* USERS and ENROLLMENT */
.users-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
}

.users-list-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.panel-title {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafbfc;
}

.panel-empty {
  padding: 24px;
  color: #aaa;
  text-align: center;
  font-size: 13px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.user-item:hover {
  background: #f8f9ff;
}
.user-item.active {
  background: #eef1ff;
  border-left: 3px solid #667eea;
}

.user-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
}

.user-item-info {
  flex: 1 1;
  min-width: 0;
}
.user-item-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-item-email {
  display: block;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.enrollment-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  min-height: 300px;
}

.enrollment-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #aaa;
  font-size: 14px;
  gap: 10px;
}
.enrollment-empty span {
  font-size: 40px;
}

.enrollment-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.enrollment-header h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #1a1a2e;
}

.enrollment-courses {
  padding: 8px 0;
}

.enrollment-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}
.enrollment-row:hover {
  background: #fafbff;
}
.enrollment-row.enrolled {
  background: #f0fff4;
}

.enrollment-info {
  flex: 1 1;
}
.enrollment-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
}
.enrollment-sub {
  font-size: 12px;
  color: #999;
}

.btn-toggle {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-enroll {
  background: #e8f5e9;
  color: #2e7d32;
}
.btn-enroll:hover {
  background: #c8e6c9;
}
.btn-unenroll {
  background: #fce4ec;
  color: #c62828;
}
.btn-unenroll:hover {
  background: #f8bbd9;
}

.bulk-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 18px;
  margin-bottom: 20px;
}

.bulk-head h3 {
  margin: 0;
  font-size: 16px;
  color: #1a1a2e;
}

.bulk-head span {
  color: #888;
  font-size: 13px;
}

.bulk-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-gap: 16px;
  gap: 16px;
  margin-top: 12px;
}

.bulk-select,
.bulk-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  box-sizing: border-box;
  background: white;
}

.bulk-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.bulk-result {
  margin: 0;
  white-space: pre-wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #475569;
}

.groups-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
}

.groups-list-card,
.group-editor-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.groups-list {
  padding: 8px 0;
  max-height: 520px;
  overflow-y: auto;
}

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.group-item.active {
  background: #eef1ff;
  border-left: 3px solid #667eea;
}

.group-item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.group-item-main strong {
  font-size: 14px;
  color: #1a1a2e;
}

.group-item-main span {
  font-size: 12px;
  color: #888;
}

.group-editor-card {
  padding: 20px;
}

.group-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.group-editor-head h3 {
  margin: 0;
  font-size: 18px;
  color: #1a1a2e;
}

.group-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.group-editor-actions .btn-save-course {
  width: auto;
  padding: 10px 14px;
  font-size: 13px;
}

.group-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
  gap: 16px;
  margin-top: 12px;
}

.picker-card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
}

.picker-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px 0;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  color: #334155;
}

.picker-item input {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .users-layout {
    grid-template-columns: 1fr;
  }
  .bulk-grid {
    grid-template-columns: 1fr;
  }
  .groups-layout {
    grid-template-columns: 1fr;
  }
  .group-pickers {
    grid-template-columns: 1fr;
  }
}

.admin-layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

/* ============ SIDEBAR ============ */
.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: #1e1e2d;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1 1;
  padding: 12px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}
.sidebar-item.active {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  border-left-color: #667eea;
}
.sidebar-icon {
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-back {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.sidebar-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* MAIN CONTENT */
.admin-main {
  flex: 1 1;
  overflow-y: auto;
  min-width: 0;
}

.content-area {
  padding: 32px 36px;
  max-width: 1100px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 20px;
  flex-wrap: wrap;
}

.content-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px 0;
}

.subtitle {
  color: #888;
  font-size: 14px;
  margin: 0;
}

/* ============ BUTTONS ============ */
.btn-create {
  padding: 12px 22px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-create:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.btn-save-course {
  padding: 13px 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  width: 100%;
}
.btn-save-course:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}
.btn-save-course:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-cancel {
  padding: 12px 22px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}
.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  background: #f0f0f0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover {
  background: #e0e0e0;
  transform: scale(1.05);
}
.btn-delete-icon {
  background: #fff0f0;
}
.btn-delete-icon:hover {
  background: #ffd6d6;
}

.btn-add-lesson {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-add-lesson:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn-add-lesson:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-add-lesson-empty {
  margin-top: 10px;
  padding: 10px 18px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: 1px dashed #667eea;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-add-lesson-empty:hover {
  background: rgba(102, 126, 234, 0.18);
}

/* COURSES GRID */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-gap: 20px;
  gap: 20px;
}

.course-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.course-card-img {
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea22, #764ba222);
}
.course-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-card-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.course-card-body {
  padding: 16px;
}
.course-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.course-card-body p {
  font-size: 13px;
  color: #777;
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.course-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
}

.course-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.course-card:hover .course-card-actions {
  opacity: 1;
}

/* EDITOR LAYOUT */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-gap: 0;
  gap: 0;
  min-height: calc(100vh - 70px);
}

.editor-left {
  padding: 28px 32px;
  border-right: 1px solid #e8e8e8;
  overflow-y: auto;
}

.editor-right {
  background: #fafbfc;
  border-left: 1px solid #e8e8e8;
  overflow-y: auto;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: calc(100vh - 70px);
}

.editor-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #888;
}

.breadcrumb-back {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 0;
  transition: color 0.2s;
}
.breadcrumb-back:hover {
  color: #764ba2;
}

.editor-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.editor-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 24px 0;
}

/* FORM FIELDS */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-row {
  display: flex;
  gap: 16px;
}

.img-preview {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-top: 10px;
  border: 1px solid #e0e0e0;
}

.field-hint {
  background: #f8f9ff;
  border: 1px solid #e0e5ff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: #667eea;
  margin-bottom: 20px;
  line-height: 1.6;
}
.field-hint code {
  display: block;
  background: #eef0ff;
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-size: 11px;
  word-break: break-all;
}

/* LESSONS PANEL */
.lessons-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.evaluation-panel-box {
  border-top: 1px solid #e8e8e8;
  padding: 16px 20px 20px;
  background: #fff;
}

.evaluation-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evaluation-panel-head strong {
  display: block;
  font-size: 14px;
  color: #1a1a2e;
}

.evaluation-panel-head span {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.lessons-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e8e8e8;
}

.lessons-panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  background: #667eea;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.lessons-hint {
  padding: 16px 20px;
  font-size: 13px;
  color: #aaa;
  text-align: center;
}

.lessons-empty {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #aaa;
}
.lessons-empty span {
  font-size: 36px;
  margin-bottom: 10px;
}
.lessons-empty p {
  font-size: 14px;
  margin: 0 0 12px 0;
}

.lessons-list {
  flex: 1 1;
  overflow-y: auto;
  padding: 8px 0;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
  cursor: pointer;
}
.lesson-row:hover {
  background: #f8f9ff;
}

.lesson-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #555;
}

.lesson-info {
  flex: 1 1;
  min-width: 0;
}
.lesson-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-desc {
  display: block;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.lesson-row-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.lesson-row:hover .lesson-row-actions {
  opacity: 1;
}

/* LESSON EDITOR */
.lesson-editor-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 860px;
}

.lesson-editor-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 24px 0;
}

.content-hints {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.content-hints span {
  font-size: 12px;
  color: #667eea;
  background: #f0f2ff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: default;
}

.content-editor {
  font-family: "Courier New", monospace !important;
  font-size: 13px !important;
  line-height: 1.6;
  resize: vertical;
  min-height: 240px;
}

.content-preview {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  min-height: 80px;
  font-size: 14px;
  line-height: 1.6;
}
.content-preview iframe {
  max-width: 100%;
  border-radius: 6px;
}
.content-preview h2,
.content-preview h3 {
  color: #1a1a2e;
  margin-top: 16px;
}
.content-preview p {
  color: #555;
}

.lesson-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: center;
}

.evaluation-editor-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 18px;
}

.evaluation-question-card {
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 18px;
  background: #fbfcff;
}

.evaluation-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.evaluation-question-head h3 {
  margin: 0;
  font-size: 16px;
  color: #1a1a2e;
}

.evaluation-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evaluation-option-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-gap: 10px;
  gap: 10px;
  align-items: center;
}

.evaluation-option-row input[type="radio"] {
  width: 16px;
  height: 16px;
}

.evaluation-toolbar {
  margin-top: 16px;
}

.save-success {
  color: #10b981;
  font-weight: 600;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

.save-error {
  color: #ef4444;
  font-weight: 600;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* STATES */
.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: #667eea;
  font-weight: 600;
  font-size: 15px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
}
.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 20px;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}
.empty-state p {
  color: #888;
  margin: 0 0 24px 0;
}

/* USERS TABLE */
.table-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: #f8f9fa;
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e8e8e8;
}
.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  color: #444;
  border-bottom: 1px solid #f0f0f0;
}
.data-table tbody tr:hover {
  background: #fafbff;
}
.table-empty {
  text-align: center;
  color: #aaa;
  padding: 40px !important;
}

.role-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.role-tag.admin {
  background: #fff3cd;
  color: #856404;
}
.role-tag.student {
  background: #d4edda;
  color: #155724;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 20px;
  gap: 20px;
  margin-top: 8px;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: center;
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-3px);
}
.stat-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.stat-number {
  font-size: 40px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 14px;
  color: #888;
  font-weight: 500;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-right {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid #e8e8e8;
  }
  .lessons-panel {
    height: auto;
  }
  .lessons-list {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
    min-width: 60px;
  }
  .sidebar-logo,
  .sidebar-item span:last-child,
  .sidebar-footer {
    display: none;
  }
  .sidebar-item {
    justify-content: center;
    padding: 14px;
  }
  .sidebar-icon {
    font-size: 20px;
  }
  .content-area {
    padding: 20px 16px;
  }
  .editor-left {
    padding: 16px;
  }
  .courses-grid {
    grid-template-columns: 1fr;
  }
  .field-row {
    flex-direction: column;
  }
  .lesson-form-actions {
    flex-direction: column;
  }
}

#root {
  width: 100%;
  height: 100%;
}

main {
  width: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-size: 18px;
  color: #666;
}


/*# sourceMappingURL=main.257268cd.css.map*/