/* =========================================================
   MULTIKA UI V4 — encabezados, formularios, tablas y sidebar
   ========================================================= */

/* Contenedores principales */
.admin-page,
.admin-container,
.firmas-form-page,
.course-form-page{
    width:min(1180px,calc(100% - 32px))!important;
    max-width:1180px!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    box-sizing:border-box!important;
}

/* Cabecera unificada */
.admin-form-premium-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:22px!important;
    margin:0 0 20px!important;
    padding:25px 27px!important;
    border:1px solid #cfdde6!important;
    border-radius:22px!important;
    background:radial-gradient(circle at 90% 0,rgba(104,94,190,.10),transparent 31%),linear-gradient(135deg,#fff,#eef5f8)!important;
    box-shadow:0 12px 30px rgba(39,62,78,.07)!important;
}
.admin-form-premium-kicker{display:inline-flex!important;align-items:center!important;gap:7px!important;color:#625ab5!important;font-size:8px!important;font-weight:900!important;letter-spacing:.13em!important}
.admin-form-premium-copy h1{margin:6px 0 5px!important;color:#294b62!important;font-size:30px!important;font-weight:850!important;line-height:1.1!important}
.admin-form-premium-copy p{max-width:700px;margin:0!important;color:#718794!important;font-size:10px!important;line-height:1.55!important}
.admin-form-premium-back{min-height:43px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;padding:0 15px!important;border:1px solid #d4e0e7!important;border-radius:12px!important;background:#fff!important;color:#365b72!important;text-decoration:none!important;font-size:9px!important;font-weight:850!important;box-shadow:0 7px 16px rgba(40,63,80,.07)!important}

/* Tarjetas de formularios */
.firmas-form-card,
.course-create-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:hidden!important;
    padding:0!important;
    border:1px solid #cfdde6!important;
    border-radius:19px!important;
    background:rgba(255,255,255,.88)!important;
    box-shadow:0 10px 28px rgba(39,62,78,.06)!important;
}
.firmas-form-card .card-header{padding:16px 20px!important;border-bottom:1px solid #dbe5eb!important;background:#f9fbfc!important;color:#31536a!important;font-size:13px!important}
.firmas-form-card .card-body{padding:21px!important}

/* Firma: Bootstrap row se mantiene, pero más compacto */
.firmas-form-page .row.g-3{--bs-gutter-x:20px!important;--bs-gutter-y:16px!important}
.firmas-form-page .form-label{margin-bottom:7px!important;color:#2e5067!important;font-size:10px!important;font-weight:800!important}
.firmas-form-page .form-control,
.firmas-form-page .form-select{min-height:46px!important;border:1px solid #bcd0dc!important;border-radius:11px!important;background:#f9fbfc!important;color:#294b62!important;font-size:10px!important;box-shadow:none!important}
.firmas-form-page .form-control:focus,
.firmas-form-page .form-select:focus{border-color:#5d8faa!important;background:#fff!important;box-shadow:0 0 0 3px rgba(73,126,157,.10)!important}

/* Curso: distribución más profesional */
.course-create-card{padding:22px!important}
.course-create-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:17px 22px!important}
.course-create-form>.form-group{margin:0!important;min-width:0!important}
.course-create-form>.form-group:nth-of-type(1),
.course-create-form>.form-group:nth-of-type(2),
.course-create-form>.form-group:has(textarea),
.course-create-form>.form-actions{grid-column:1 / -1!important}
.course-create-form>.form-row{display:contents!important}
.course-create-form label{display:flex!important;align-items:center!important;gap:7px!important;margin:0 0 7px!important;color:#2e5067!important;font-size:10px!important;font-weight:850!important}
.course-create-form input,
.course-create-form select,
.course-create-form textarea{width:100%!important;max-width:100%!important;min-width:0!important;min-height:46px!important;padding:10px 13px!important;border:1px solid #bcd0dc!important;border-radius:11px!important;background:#f9fbfc!important;color:#294b62!important;font-size:10px!important;box-sizing:border-box!important;outline:none!important}
.course-create-form textarea{min-height:125px!important;resize:vertical!important}
.course-create-form input:focus,
.course-create-form select:focus,
.course-create-form textarea:focus{border-color:#5d8faa!important;background:#fff!important;box-shadow:0 0 0 3px rgba(73,126,157,.10)!important}
.course-create-form .texto-ayuda{display:block!important;margin-top:5px!important;color:#7e919d!important;font-size:8px!important}
.course-create-form .form-actions{display:flex!important;justify-content:flex-end!important;gap:9px!important;margin:4px 0 0!important;padding-top:17px!important;border-top:1px solid #e0e8ed!important}

/* Tablas: scroll dentro del componente, nunca en toda la página */
.students-table-responsive,
.firmas-table-responsive,
.table-container{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:thin!important;
}
.students-table-responsive table,
.firmas-table-responsive table{width:100%!important;min-width:860px!important}

/* Sidebar admin visible también en tablets horizontales / DevTools hasta 720px */
@media (min-width:721px) and (max-width:900px){
    .sidebar-admin{
        width:260px!important;
        transform:translateX(0)!important;
        border-radius:0!important;
    }
    .admin-content{
        margin-left:260px!important;
        padding:24px 16px 30px!important;
        min-width:0!important;
    }
    .btn-menu-admin{display:none!important}
    .admin-overlay{display:none!important}
    .admin-page,
    .admin-container,
    .firmas-form-page,
    .course-form-page{width:calc(100% - 16px)!important}
}

/* Tablet y móvil */
@media(max-width:720px){
    .admin-form-premium-head{grid-template-columns:1fr!important;align-items:start!important;padding:19px!important;border-radius:18px!important}
    .admin-form-premium-copy h1{font-size:24px!important}
    .admin-form-premium-back{justify-self:start!important}
    .course-create-form{grid-template-columns:1fr!important}
    .course-create-form>.form-group,
    .course-create-form>.form-row,
    .course-create-form>.form-actions{grid-column:1!important}
    .course-create-form>.form-row{display:grid!important;grid-template-columns:1fr!important;gap:15px!important}
    .firmas-form-card .card-body,
    .course-create-card{padding:15px!important}
    .firmas-form-actions,
    .course-create-form .form-actions{display:grid!important;grid-template-columns:1fr!important}
    .firmas-form-actions>* ,
    .course-create-form .form-actions>*{width:100%!important}
}

@media(max-width:480px){
    .admin-page,
    .admin-container,
    .firmas-form-page,
    .course-form-page{width:calc(100% - 12px)!important}
    .students-table-responsive table,
    .firmas-table-responsive table{min-width:760px!important}
}
