/* =====================================
RESET BÁSICO
===================================== */
html, body{
    height:100%;
    margin:0;
    padding:0;
    overflow:hidden; /* 🔥 evitamos doble scroll */
    font-family: sans-serif;
}


/* =====================================
LAYOUT APP SaaS
===================================== */
.sb-app{
    display:flex;
    height:100vh;
    width:100%;
}


/* =====================================
SIDEBAR IZQUIERDA
===================================== */
.sb-left{
    width:240px;
    background:#0f172a;
    color:#fff;
    padding:20px;
    overflow-y:auto;
}

.sb-left a{
    display:block;
    padding:10px;
    color:#cbd5f5;
    text-decoration:none;
    border-radius:8px;
    margin-bottom:5px;
}

.sb-left a.active,
.sb-left a:hover{
    background:#1e293b;
    color:#fff;
}


/* =====================================
MAIN (CONTENIDO SCROLLABLE)
===================================== */
.sb-main{
    flex:1;
    overflow-y:auto; /* 🔥 ESTE ES EL FIX REAL */
    padding:30px;
    background:#f1f5f9;
}


/* =====================================
SIDEBAR DERECHA (CHAT)
===================================== */
.sb-right{
    width:320px;
    background:#fff;
    border-left:1px solid #e5e7eb;
    display:flex;
    flex-direction:column;
    height:100vh;
}


/* =====================================
CHAT
===================================== */
.sb-chat-box{
    flex:1;
    overflow-y:auto;
    padding:15px;
}

.sb-chat-input{
    display:flex;
    border-top:1px solid #e5e7eb;
}

.sb-chat-input input{
    flex:1;
    padding:10px;
    border:none;
    outline:none;
}

.sb-chat-input button{
    width:50px;
    border:none;
    background:#2563eb;
    color:#fff;
}


/* =====================================
HERO (CURSO PRINCIPAL)
===================================== */
.sb-hero-course{
    background:linear-gradient(135deg,#1e3a8a,#2563eb);
    color:#fff;
    padding:40px;
    border-radius:20px;
    margin-bottom:30px;
}

.sb-hero-label{
    font-size:14px;
    opacity:.8;
}

.sb-hero-course h2{
    font-size:28px;
    margin:10px 0;
}


/* =====================================
CARDS
===================================== */
.sb-content-card{
    background:#fff;
    padding:20px;
    border-radius:16px;
}

.sb-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:20px;
}

.sb-course-card{
    background:#f8fafc;
    padding:15px;
    border-radius:12px;
}


/* =====================================
PROGRESS
===================================== */
.sb-progress{
    margin:10px 0;
}

.sb-bar{
    width:100%;
    height:6px;
    background:#e5e7eb;
    border-radius:10px;
    overflow:hidden;
}

.sb-fill{
    height:100%;
    background:#2563eb;
}


/* =====================================
BOTONES
===================================== */
.sb-btn{
    display:inline-block;
    background:#2563eb;
    color:#fff;
    padding:10px 15px;
    border-radius:8px;
    text-decoration:none;
    margin-top:10px;
}

.sb-btn.big{
    padding:14px 24px;
    font-size:16px;
}

/* =====================================
CURSOS GRID PRO
===================================== */

.sb-courses-page{
    padding:40px;
}

.sb-title{
    font-size:32px;
    font-weight:700;
    margin-bottom:30px;
}


/* GRID */
.sb-courses-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:25px;
}


/* CARD */
.sb-course-card{
    background:#fff;
    border-radius:16px;
    overflow:hidden;
    box-shadow:0 5px 15px rgba(0,0,0,0.05);
    transition:all .3s ease;
}

.sb-course-card:hover{
    transform:translateY(-5px);
    box-shadow:0 10px 25px rgba(0,0,0,0.1);
}


/* =====================================
IMAGEN
===================================== */
.sb-course-thumb{
    position:relative;
    height:160px;
    overflow:hidden;
}

.sb-course-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
}

/* fallback */
.sb-no-image{
    display:flex;
    align-items:center;
    justify-content:center;
    height:100%;
    background:#e5e7eb;
    color:#64748b;
}


/* BADGE */
.sb-badge-category{
    position:absolute;
    top:10px;
    left:10px;
    background:#facc15;
    color:#000;
    font-size:12px;
    padding:4px 8px;
    border-radius:6px;
}


/* =====================================
PROGRESS OVERLAY
===================================== */
.sb-progress-overlay{
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
    padding:5px 10px;
    background:rgba(0,0,0,0.6);
    color:#fff;
    font-size:12px;
}

.sb-progress-bar{
    width:100%;
    height:4px;
    background:#374151;
    border-radius:10px;
    overflow:hidden;
    margin-bottom:4px;
}

.sb-progress-bar div{
    height:100%;
    background:#22c55e;
}


/* =====================================
BODY
===================================== */
.sb-course-body{
    padding:15px;
}

.sb-course-body h3{
    font-size:16px;
    margin-bottom:10px;
}


/* META */
.sb-course-meta{
    font-size:13px;
    color:#64748b;
    margin-bottom:10px;
}


/* FOOTER */
.sb-course-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:13px;
    margin-bottom:10px;
}

.sb-status{
    padding:4px 8px;
    border-radius:6px;
    font-size:11px;
}

.sb-status.completed{
    background:#22c55e;
    color:#fff;
}

.sb-status.progress{
    background:#3b82f6;
    color:#fff;
}

.sb-status.new{
    background:#64748b;
    color:#fff;
}


/* =====================================
BOTÓN
===================================== */
.sb-course-action .sb-btn{
    width:100%;
    text-align:center;
}