brand); font-weight: 600; }
.sidebar-link.active i { color: var(--brand); }

/* ---------- Topbar ---------- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  height: 64px;
    background: #fff;
      border-bottom: 1px solid var(--border);
        display: flex;
          align-items: center;
            justify-content: flex-end;
              padding: 0 24px;
                gap: 16px;
                  position: sticky;
                    top: 0;
                      z-index: 10;
                      }
                      .app-topbar-actions { display: flex; align-items: center; gap: 14px; }
                      .avatar-circle {
                        width: 36px; height: 36px; border-radius: 50%;
                          background: var(--brand); color: #fff;
                            display: flex; align-items: center; justify-content: center;
                              font-weight: 700;
                              }
                              .app-content { padding: 28px; }
                              
                              /* ---------- Componentes reutilizables ---------- */
                              .stat-card {
                                background: #fff; border: 1px solid var(--border); border-radius: 12px;
                                  padding: 18px; display: flex; align-items: center; gap: 14px;
                                  }
                                  .stat-card .stat-icon {
                                    width: 44px; height: 44px; border-radius: 10px;
                                      display: flex; align-items: center; justify-content: center;
                                        font-size: 1.1rem;
                                        }
                                        .stat-card .stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
                                        .stat-card .stat-label { color: #6b7280; font-size: .82rem; }
                                        
                                        .course-card {
                                          background: #fff; border: 1px solid var(--border); border-radius: 12px;
                                            overflow: hidden; height: 100%; display: flex; flex-direction: column;
                                              transition: box-shadow .15s ease; position: relative;
                                              }
                                              .course-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
                                              .course-card .course-cover {
                                                height: 140px; background: linear-gradient(135deg, #fde3cf, #f3711b33);
                                                  display: flex; align-items: center; justify-content: center;
                                                    color: var(--brand); font-size: 2rem;
                                                    }
.course-cover img { object-position: top; }
                                                    .course-card .course-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
                                                    .course-card .progress { height: 6px; }
                                                    
                                                    .badge-nivel { background: #eef2ff; color: #4338ca; }
                                                    .badge-categoria { background: #e0f2fe; color: #075985; }
                                                    
                                                    .btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
                                                    .btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
                                                    
                                                    .lesson-row {
                                                      display: flex; align-items: center; justify-content: space-between;
                                                        padding: 12px 14px; border-radius: 8px; text-decoration: none; color: inherit;
                                                        }
                                                        .lesson-row:hover { background: #f8f9fb; }
                                                        .lesson-row.active { background: #fdece0; }
                                                        .lesson-row .lesson-num {
                                                          width: 26px; height: 26px; border-radius: 50%; background: #eee;
                                                            display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0;
                                                            }
                                                            .lesson-row.completed .lesson-num { background: #16a34a; color: #fff; }
                                                            
                                                            .video-embed { position: relative; width: 100%; padding-top: 56.25%; background: #0b1220; border-radius: 10px; overflow: hidden; }
                                                            .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
                                                            
                                                            .login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-body); }
                                                            .login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 36px; border: 1px solid var(--border); }
                                                            :root {
  --brand: #f3711b;
    --brand-dark: #d95e0e;
      --sidebar-w: 250px;
        --bg-body: #f5f6f8;
          --border: #e6e8eb;
          }
          
          body {
            background: var(--bg-body);
              font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
                color: #1f2937;
                }
                
                .app-shell { display: flex; min-height: 100vh; }
                
                /* ---------- Sidebar ---------- */
                .app-sidebar {
                  width: var(--sidebar-w);
                    flex-shrink: 0;
                      background: #fff;
                        border-right: 1px solid var(--border);
                          min-height: 100vh;
position: sticky;
top: 0;
align-self: flex-start;
overflow-y: auto;
                            padding: 20px 14px;
                            }
                            .sidebar-brand {
                              font-weight: 700;
                                font-size: 1.1rem;
                                  color: var(--brand);
                                    padding: 6px 8px 20px;
                                    }
                                    .sidebar-section-title {
                                      font-size: .7rem;
                                        text-transform: uppercase;
                                          letter-spacing: .05em;
                                            color: #9aa1ab;
                                              padding: 16px 10px 6px;
                                              }
                                              .sidebar-link {
                                                display: flex;
                                                  align-items: center;
                                                    gap: 10px;
                                                      padding: 9px 10px;
                                                        border-radius: 8px;
                                                          color: #374151;
                                                            text-decoration: none;
                                                              font-size: .92rem;
                                                                margin-bottom: 2px;
                                                                }
                                                                .sidebar-link i { width: 18px; text-align: center; color: #9aa1ab; }
                                                                .sidebar-link:hover { background: #f8f4f0; color: var(--brand-dark); }
                                                                .sidebar-link.active { background: #fdece0; color: var(--brand); font-weight: 600; }

/* ---------- Barra inferior fija Powered by ZAYNFER ---------- */
.zaynfer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 6px 16px;
  text-align: center;
  font-size: .75rem;
  color: #9aa1ab;
}
.zaynfer-bar a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.zaynfer-bar a:hover { color: var(--brand-dark); text-decoration: underline; }
body { padding-bottom: 34px; }


/* ============================================================
   Responsive: menú lateral colapsable en móvil/tablet (<992px)
   El sidebar fijo de 250px se ocultaba fuera de pantalla pero
   seguía ocupando espacio, dejando el contenido (incluido el
   selector de lecciones/video) aplastado en una franja angosta.
   Ahora se convierte en panel off-canvas que se abre con el
   botón hamburguesa del topbar.
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
}
.sidebar-backdrop.show { display: block; }

#btnToggleSidebar {
  font-size: 1.1rem;
  padding: 4px 10px;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(var(--sidebar-w), 82vw);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1050;
    box-shadow: 2px 0 16px rgba(0,0,0,0.2);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-topbar {
    padding: 0 14px;
    gap: 10px;
  }
  .app-topbar-actions {
    gap: 8px;
  }
}
