/* ==========================================================================
   M FITNESS ACADEMY - DESIGN SYSTEM & THEME (LIGHT LUXURY PALETTE)
   Paleta de Colores:
     - #f5e6d3 (Crema / Light Almond Cream - Base y Fondo Principal)
     - #c18791 (Rosa Viejo / Dusty Rose - Color Principal)
     - #d4af37 (Oro / Gold - Acentos de Lujo y Detalles)
     - #7b1e3d (Vino Tinto / Burgundy - Énfasis y Puntos Focales)
     - #111111 (Negro Carbón / Charcoal - Textos y Contrastes)

   Tipografías:
     - Great Vibes (Manuscripta de Lujo)
     - Montserrat (Títulos, Subtítulos, Botones, Labels)
     - Open Sans (Cuerpo, Párrafos, Formularios)
   ========================================================================== */

/* 1. GOOGLE FONTS */
@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap");

/* 2. VARIABLES GLOBALES */
:root {
    --mf-cream: #f5e6d3;
    --mf-cream-light: #faf4ec;
    --mf-cream-rgb: 245, 230, 211;

    --mf-rose: #c18791;
    --mf-rose-light: #dfb2bb;
    --mf-rose-dark: #9d5d68;
    --mf-rose-rgb: 193, 135, 145;

    --mf-gold: #d4af37;
    --mf-gold-light: #faebb8;
    --mf-gold-dark: #b08d23;
    --mf-gold-rgb: 212, 175, 55;

    --mf-burgundy: #7b1e3d;
    --mf-burgundy-light: #c18791;
    --mf-burgundy-dark: #581229;
    --mf-burgundy-rgb: 123, 30, 61;

    --mf-dark: #111111;
    --mf-dark-rgb: 17, 17, 17;
    --mf-text-muted: #6b635b;

    /* Sobrescritura de variables nativas de Bootstrap 5 */
    --bs-primary: #c18791;
    --bs-primary-rgb: 193, 135, 145;

    --bs-secondary: #7b1e3d;
    --bs-secondary-rgb: 123, 30, 61;

    --bs-warning: #d4af37;
    --bs-warning-rgb: 212, 175, 55;

    --bs-light: #f5e6d3;
    --bs-light-rgb: 245, 230, 211;

    --bs-dark: #111111;
    --bs-dark-rgb: 17, 17, 17;

    --bs-body-font-family:
        "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    --bs-body-color: #2b2523;
    /* --bs-body-bg: #f5e6d3; */

    /* Tipografías Custom */
    --font-script: "Great Vibes", cursive;
    --font-heading: "Montserrat", sans-serif;
    --font-body: "Open Sans", sans-serif;
}

/* 3. REGLAS BASE & TIPOGRAFÍA */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    font-family: var(--font-body);
    /* background-color: var(--mf-cream); */
    background-color: #fff;
    color: #2b2523;
    min-height: 100vh;
    letter-spacing: 0.1px;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #221c1e;
    letter-spacing: -0.2px;
}

.font-script {
    font-family: var(--font-script) !important;
}
.font-heading {
    font-family: var(--font-heading) !important;
}
.font-body {
    font-family: var(--font-body) !important;
}

/* 4. CLASES DE COLOR Y UTILIDADES */
.text-burgundy {
    color: var(--mf-burgundy) !important;
}
.text-rose {
    color: var(--mf-rose-dark) !important;
}
.text-gold {
    color: var(--mf-gold-dark) !important;
}
.text-cream {
    color: var(--mf-cream) !important;
}
.text-dark-charcoal {
    color: var(--mf-dark) !important;
}
.text-muted-custom {
    color: var(--mf-text-muted) !important;
}

.bg-burgundy {
    background-color: var(--mf-burgundy) !important;
}
.bg-rose {
    background-color: var(--mf-rose) !important;
}
.bg-gold {
    background-color: var(--mf-gold) !important;
}
.bg-cream {
    background-color: var(--mf-cream) !important;
}
.bg-cream-light {
    background-color: var(--mf-cream-light) !important;
}

/* 5. BOTONES PERSONALIZADOS */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    /* border-radius: 8px; */
    /* padding: 11px 24px; */
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--mf-rose);
    border: 1.5px solid var(--mf-rose-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(193, 135, 145, 0.35);
}

.btn-primary[disabled] {
    background-color: var(--mf-rose-light);
    border: 1.5px solid var(--mf-rose);
    color: #000000;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--mf-burgundy) !important;
    border-color: var(--mf-gold) !important;
    color: var(--mf-gold-light) !important;
    box-shadow: 0 6px 18px rgba(123, 30, 61, 0.4) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background-color: transparent;
    border: 1.5px solid var(--mf-rose-dark);
    color: var(--mf-burgundy) !important;
    box-shadow: 0 4px 12px rgba(193, 135, 145, 0.35);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--mf-burgundy) !important;
    border-color: var(--mf-gold) !important;
    color: var(--mf-gold-light) !important;
    box-shadow: 0 6px 18px rgba(123, 30, 61, 0.4) !important;
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, #d4af37 0%, #b88d22 100%);
    border: none;
    color: #111111;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #faebb8 0%, #d4af37 100%);
    color: #111111;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
    transform: translateY(-1px);
}

.btn-burgundy {
    background: var(--mf-burgundy);
    border: none;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(123, 30, 61, 0.35);
}
.btn-burgundy:hover,
.btn-burgundy:focus,
.btn-burgundy:active {
    background: var(--mf-burgundy-dark);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(123, 30, 61, 0.5);
    transform: translateY(-1px);
}

/* 6. FORMULARIOS Y CAMPOS DE ENTRADA */
.form-control,
.form-select {
    font-family: var(--font-body);
    background-color: #ffffff;
    border: 1.5px solid rgba(193, 135, 145, 0.45);
    color: #221c1e;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--mf-gold-dark);
    color: #111111;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.2);
}

.form-control::placeholder {
    color: #a89d97;
    font-size: 0.92rem;
}

.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 6px;
}

/* Select pequeño */
.form-select-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.form-label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #382c30;
    margin-bottom: 6px;
    font-size: 0.88rem;
}
.input-group {
    border-radius: 6px;
}
.input-group-text {
    background-color: #faf4ec;
    border: 1.5px solid rgba(193, 135, 145, 0.45);
    border-right: none;
    color: var(--mf-gold-dark);
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-left: none;
}

.input-group .form-control:focus + .input-group-text,
.input-group .form-control:focus {
    border-color: var(--mf-gold-dark);
}

.input-group .form-control {
    border-radius: 0 !important;
}

.input-group *:first-child {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
}

.input-group *:last-child {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

/* 7. TARJETAS DE LUJO */
.card-luxury {
    background: #ffffff;
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    box-shadow:
        0 20px 45px rgba(123, 30, 61, 0.08),
        0 8px 20px rgba(193, 135, 145, 0.12);
    overflow: hidden;
}

.divider-gold {
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--mf-gold),
        transparent
    );
    margin: 20px 0;
    opacity: 0.85;
}

.divider-rose {
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--mf-rose),
        transparent
    );
    margin: 20px 0;
    opacity: 0.85;
}

/* 8. BADGES Y ENLACES */
.badge-gold {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--mf-gold-dark);
    border: 1px solid rgba(212, 175, 55, 0.5);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.badge-rose {
    background-color: rgba(193, 135, 145, 0.18);
    color: var(--mf-rose-dark);
    border: 1px solid rgba(193, 135, 145, 0.5);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
}

a.link-gold {
    color: var(--mf-gold-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

a.link-gold:hover {
    color: var(--mf-burgundy);
}

a.link-rose {
    color: var(--mf-rose-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a.link-rose:hover {
    color: var(--mf-burgundy);
}

/* Enlace Creation Web */
.link-creation-web {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    background: linear-gradient(
        135deg,
        rgba(250, 244, 236, 0.9) 0%,
        rgba(245, 230, 211, 0.6) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(123, 30, 61, 0.05);
}

.link-creation-web:hover {
    background: #ffffff;
    border-color: var(--mf-gold);
    box-shadow:
        0 4px 12px rgba(212, 175, 55, 0.25),
        0 2px 6px rgba(123, 30, 61, 0.1);
    transform: translateY(-1px);
}

/* 9. CONTENEDOR DE AUTENTICACIÓN (LOGIN) */
.auth-wrapper {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    background: radial-gradient(
        circle at 15% 15%,
        #faf0e4 0%,
        #f5e6d3 50%,
        #ecd6be 100%
    );
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(
        circle,
        rgba(193, 135, 145, 0.25) 0%,
        rgba(212, 175, 55, 0.15) 50%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

.auth-wrapper::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(
        circle,
        rgba(212, 175, 55, 0.2) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

.auth-card {
    max-width: 960px;
    width: 100%;
    position: relative;
    z-index: 10;
    box-shadow:
        0 22px 55px rgba(123, 30, 61, 0.484),
        0 8px 22px rgba(123, 30, 61, 0.356) !important;
}

/* Panel Izquierdo: Fondo Crema #f5e6d3 con marcos Oro y Rosa para que el logo resalte al máximo */
.auth-brand-side {
    background: linear-gradient(160deg, #faf4ec 0%, #f5e6d3 55%, #edd9c4 100%);
    position: relative;
    padding: 50px 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border-right: 1.5px solid rgba(212, 175, 55, 0.35);
}

.auth-brand-side::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(193, 135, 145, 0.15) 1px,
        transparent 1px
    );
    background-size: 16px 16px;
    pointer-events: none;
}

.auth-form-side {
    padding: 55px 45px;
    background-color: #ffffff;
}

/* Logo destacado y de gran tamaño */
.brand-logo-img {
    max-height: 220px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(123, 30, 61, 0.12));
    transition: transform 0.3s ease;
}

.brand-logo-img:hover {
    transform: scale(1.03);
}

/* ==========================================================================
   10. MODO MÓVIL / RESPONSIVE OPTIMIZADO (PANTALLAS PEQUEÑAS)
   ========================================================================== */
@media (max-width: 991.98px) {
    .auth-wrapper {
        padding: 15px 12px !important;
        align-items: center !important;
    }

    .auth-card {
        border-radius: 16px !important;
        box-shadow:
            0 14px 38px rgba(123, 30, 61, 0.22),
            0 4px 15px rgba(123, 30, 61, 0.12) !important;
    }

    .auth-form-side {
        padding: 24px 20px !important;
    }

    /* Logo más grande y protagonista en móvil */
    .brand-logo-img-mobile {
        max-height: 120px !important;
        width: auto !important;
        filter: drop-shadow(0 4px 10px rgba(123, 30, 61, 0.15)) !important;
        margin-bottom: 6px !important;
    }

    /* Títulos y textos compactos para 2 campos */
    .auth-form-side h2 {
        font-size: 1.25rem !important;
        margin-bottom: 2px !important;
    }

    .auth-form-side .form-subtitle {
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
    }

    .auth-header-mobile {
        margin-bottom: 14px !important;
    }

    /* Campos de entrada e iconos compactos */
    .form-label {
        font-size: 0.78rem !important;
        margin-bottom: 3px !important;
    }

    .form-control {
        padding: 8px 12px !important;
        font-size: 0.88rem !important;
        border-radius: 6px !important;
    }

    .input-group-text {
        padding: 8px 11px !important;
        font-size: 0.85rem !important;
        border-radius: 6px 0 0 6px !important;
    }

    .input-group button.input-group-text {
        border-radius: 0 6px 6px 0 !important;
    }

    .link-rose {
        font-size: 0.78rem !important;
    }

    /* Reducción de espacios entre elementos */
    .form-group-compact {
        margin-bottom: 12px !important;
    }

    /* Botón compacto */
    .btn-submit-compact {
        padding: 8px 18px !important;
        font-size: 0.9rem !important;
        border-radius: 6px !important;
    }

    /* Divisor y pie compactos */
    .divider-compact {
        margin: 12px 0 !important;
    }

    .footer-text-compact {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 420px) {
    .auth-form-side {
        padding: 20px 16px !important;
    }

    .brand-logo-img-mobile {
        max-height: 105px !important;
    }

    .auth-form-side h2 {
        font-size: 1.18rem !important;
    }
}

/* ==========================================================================
   11. DASHBOARD / LAYOUT AUTENTICADO
   ========================================================================== */
.app-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: var(--mf-cream);
}

/* Sidebar con scroll independiente */
.app-sidebar {
    width: 260px;
    min-width: 260px;
    height: 100svh;
    background: #111111;
    color: var(--mf-cream);
    display: flex;
    flex-direction: column;
    border-right: 1.5px solid rgba(212, 175, 55, 0.35);
    z-index: 1040;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    background: linear-gradient(145deg, #faf4ec 0%, #f5e6d3 100%);
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.4);
}

.sidebar-logo-img {
    /* max-height: 48px; */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
    width: 70%;
}

/* Área de navegación con scroll vertical independiente */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px;
}

/* Scrollbar estilizado para el sidebar */
.sidebar-body::-webkit-scrollbar {
    width: 5px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: var(--mf-gold);
}

.sidebar-heading {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mf-rose);
    padding: 8px 14px 4px;
    font-weight: 700;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    color: rgba(245, 230, 211, 0.85);
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 4px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.sidebar-link i {
    width: 24px;
    font-size: 1.05rem;
    color: var(--mf-rose-light);
    transition: color 0.25s ease;
}

.sidebar-link:hover {
    background: rgba(193, 135, 145, 0.18);
    color: #ffffff;
    border-color: rgba(212, 175, 55, 0.25);
}

.sidebar-link:hover i {
    color: var(--mf-gold);
}

.sidebar-link.active {
    background: linear-gradient(
        135deg,
        rgba(123, 30, 61, 0.85) 0%,
        rgba(193, 135, 145, 0.5) 100%
    );
    color: #ffffff;
    font-weight: 600;
    border-left: 3.5px solid var(--mf-gold);
    box-shadow: 0 4px 12px rgba(123, 30, 61, 0.35);
}

.sidebar-link.active i {
    color: var(--mf-gold);
}

.sidebar-link-logout {
    color: #ff85a1 !important;
}

.sidebar-link-logout:hover {
    background: rgba(123, 30, 61, 0.35) !important;
    color: #ffffff !important;
    border-color: rgba(212, 175, 55, 0.3) !important;
}

.sidebar-link-logout:hover i {
    color: #ff85a1 !important;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    background: #0c0c0c;
}

/* Área Principal (Header + Content) */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* Barra Superior (Top Header) */
.app-topbar {
    height: 65px;
    min-height: 65px;
    background: #ffffff;
    border-bottom: 1.5px solid rgba(193, 135, 145, 0.35);
    box-shadow: 0 4px 15px rgba(123, 30, 61, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 1020;
}

.topbar-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #faf4ec 0%, #f5e6d3 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(123, 30, 61, 0.06);
    transition: all 0.25s ease;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--mf-burgundy);
    color: var(--mf-gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(123, 30, 61, 0.3);
}

.topbar-user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--mf-burgundy);
    letter-spacing: 0.3px;
}

/* Área de contenido con scroll independiente */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    /* background: radial-gradient(
        circle at 10% 10%,
        var(--mf-cream-light) 0%,
        var(--mf-cream) 60%,
        #eedbc7 100%
    ); */
    background: var(--mf-cream-light);
}

/* Overlay móvil */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1035;
}

.app-sidebar {
    margin-left: -260px;
}

.app-sidebar.show {
    margin-left: 0;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        margin-left: 0;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        margin-left: 0;
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }

    .app-topbar {
        padding: 0 16px;
    }

    .app-content {
        padding: 20px 0px;
    }
    .container {
        padding: 0px;
    }
}

/* Estilo para todos los campos requeridos */
.form-label:has(+ input[required])::after,
.form-label:has(+ select[required])::after,
.form-label:has(+ textarea[required])::after,
.form-label:has(+ .input-group input[required])::after,
.form-label:has(+ div input[required])::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Si el input está dentro de un div con clase input-group */
.input-group:has(input[required]) .form-label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.dropdown-custom .dropdown-custom-menu {
    display: none;
    position: fixed;
    z-index: 9999;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
}

.dropdown-custom .dropdown-item {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.table-sm {
    font-size: 0.8rem;
}

.table-primary {
    width: 100%;
    border-collapse: collapse;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-size: 0.9rem;
}

.table-primary thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.table-primary thead th {
    color: #475569;
    font-weight: 600;
    /* font-size: 0.75rem; */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
}

.table-primary tbody tr {
    border-bottom: 1px solid #d5d5d5;
    transition: background-color 0.2s ease;
}

.table-primary tbody th,
.table-primary tbody td {
    background: transparent;
}

.table-striped tr:nth-child(even) {
    background-color: #f2f2f2 !important;
}

.table-striped tbody tr:nth-child(odd) > * {
    --bs-table-bg-type: transparent !important;
}

.table-primary thead tr,
.table-primary thead td {
    background: linear-gradient(
        135deg,
        var(--bs-primary) 0%,
        var(--bs-primary) 100%
    ) !important;
    position: relative !important;
    overflow: hidden !important;
}

.table-primary thead th,
.table-primary thead td {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.75rem;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    padding: 8px 10px !important;
    border: none !important;
    background: transparent !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    z-index: 1 !important;
}

.table-primary thead th:first-child,
.table-primary thead td:first-child {
    border-radius: 10px 0 0 0 !important;
}

.table-primary thead th:last-child,
.table-primary thead td:last-child {
    border-radius: 0 10px 0 0 !important;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
}

.btn-sm {
    padding: 5px 16px;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.dt-container {
}

/* ===== BÚSQUEDA ===== */
.dt-container .dt-search {
    display: flex;
    justify-content: end;
}
.dt-container .dt-search input {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px !important;
    padding: 8px 16px 8px 36px !important;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: #f8fafc
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
        no-repeat 12px center;
    background-size: 16px;
    outline: none;
    width: 220px;
}

.dt-container .dt-search input:focus {
    border-color: var(--bs-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 0px rgba(59, 130, 246, 0.1);
}

/* ===== SELECTOR DE CANTIDAD ===== */
.dt-container .dt-length select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 28px 6px 12px;
    font-size: 0.85rem;
    background-size: 10px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dt-container .dt-length select:focus,
.dt-container .dt-length select:focus-visible {
    border-color: var(--bs-primary) !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 0px rgba(59, 130, 246, 0.1);
}

/* ===== INFORMACIÓN ===== */
.dt-container .dt-info {
    color: #64748b;
    font-size: 0.85rem;
    padding: 10px 0;
}

/* .dt-container .dt-paging > nav {
    display: flex;
    justify-content: end;
} */

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dt-container .dt-search input {
        width: 160px;
    }
}

/* ===== PAGINACIÓN SUTIL ===== */
.dt-container .dt-paging {
    display: flex;
    justify-content: end;
    /* gap: 4px; */
    /* flex-wrap: wrap; */
}

.dt-container .dt-paging .dt-paging-button {
    /* border: none !important; */
    border: 1px solid #c1879153 !important;
    border-radius: 0px !important;
    padding: 5px 12px !important;
    font-size: 0.85rem !important;
    color: var(--mf-burgundy) !important;
    background: transparent !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    min-width: 32px !important;
    text-align: center !important;
    margin: 0px !important;
}

.dt-container .dt-paging .dt-paging-button:hover {
    /* background: #f1f5f9; */
    background: #c187911e !important;
    --dt-paging-button_color-hover: var(--mf-burgundy) !important;
}

.dt-container .dt-paging .dt-paging-button.current {
    --dt-paging-button_color-current: #f1f5f9;
    font-weight: 600;
    background: #9d5d68 !important;
}

.dt-container .dt-paging .dt-paging-button.current:hover {
    --dt-paging-button_color-current-hover: #f1f5f9;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    /* opacity: 0.3; */
    cursor: not-allowed;
    pointer-events: none;

    --dt-paging-button_color-disabled: var(--mf-burgundy) !important;
    background: #c187913a !important;
}

.dt-container .dt-paging > nav[aria-label="pagination"] button:first-child {
    border-top-left-radius: 5px !important;
    border-bottom-left-radius: 5px !important;
}

.dt-container .dt-paging > nav[aria-label="pagination"] button:last-child {
    border-top-right-radius: 5px !important;
    border-bottom-right-radius: 5px !important;
}

.loading-container {
    display: flex;
    align-items: center;
}
.loading-container span {
    margin-left: 4px;
}

.spinner-wait {
    border: 4px solid var(--bs-gray-300);
    border-top: 4px solid var(--bs-primary);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.dropzone {
    border: 2px dashed #6c757d;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    color: #6c757d;
    position: relative;
    cursor: pointer;
    transition:
        background-color 0.3s,
        border-color 0.3s;
}
.dropzone:hover {
    background-color: #e8e6e6;
}
.dropzone.dragover {
    background-color: #e8e6e6;
    border-color: #0d6efd;
}
.dropzone iconify-icon {
    font-size: 48px;
    color: #6c757d;
}
.dropzone img {
    max-width: 150px;
    margin-top: 15px;
    border-radius: 10px;
}
.dropzone .file-info {
    margin-top: 10px;
    font-size: 14px;
    color: #495057;
}

.box-dashed {
    border: 2px dashed #6c757d;
    border-radius: 15px;
    padding: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 15px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.youtube-share-blocker {
    position: absolute;
    left: 0;
    bottom: 5px;
    width: 100px;
    height: 60px;
    z-index: 9999;
    background: transparent;
    pointer-events: auto;
}

.hover-lift {
    transition:
        transform 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
}
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15) !important;
}

.border-primary {
    border: 1px solid var(--bs-primary) !important;
}

.fs-7 {
    font-size: 0.875rem !important;
}
.fs-8 {
    font-size: 0.75rem !important;
}
.fs-9 {
    font-size: 0.625rem !important;
}
.fs-10 {
    font-size: 0.5rem !important;
}

/* Sidebar scroll */
.sticky-top::-webkit-scrollbar {
    width: 4px;
}
.sticky-top::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.sticky-top::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* Clases en lista */
.class-item {
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 6px !important;
}
.class-item:hover {
    background-color: #f3f4f6 !important;
}
.class-item.active {
    background-color: var(--mf-rose-light) !important;
    border-left: 3px solid #0d6efd !important;
    color: black;
}
.class-item .badge {
    transition: all 0.15s ease;
}

/* Accordion custom */
.accordion-button {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
}
.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: var(--mf-burgundy);
    box-shadow: none;
}
.accordion-button:focus {
    border-color: transparent;
    box-shadow: none;
}
.accordion-button .badge {
    font-size: 0.7rem;
}

/* Video overlay */
#contentOverlay {
    backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 991px) {
    .sticky-top {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
    }
    .sticky-top .p-3 {
        max-height: none !important;
    }
    .ratio-16x9 {
        aspect-ratio: 16/9;
    }
}

.rounded-circle.p-1 {
    padding: 0;
    width: 1.2rem;
    height: 1.2rem;
}

.ratio::before {
    padding: 0;
}

.card-link {
    text-decoration: none;
}

@media (max-width: 500px) {
    .btn-sm {
        padding: 1px 8px !important;
        font-size: 0.75rem !important;
    }
}

.app-content > .container {
    max-width: 90vw;
}

@media (max-width: 991px) {
    .app-content > .container {
        max-width: 97vw;
    }
    .app-topbar {
        height: 50px;
        min-height: 50px;
    }

    .topbar-user-avatar {
        width: 25px;
        height: 25px;
    }

    .topbar-user-badge {
        padding: 3px 10px;
    }
}
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.form-control-xs {
    height: calc(1.5em + 0.5rem);
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}

.form-label-sm {
    font-size: 0.775rem;
}

.exam-timer {
    position: fixed;
    z-index: 10;
    right: 18px;
    bottom: 18px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    animation: timerPulse 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

@keyframes timerPulse {
    0%,
    100% {
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    }
    50% {
        box-shadow:
            0 8px 40px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(255, 255, 255, 0.9),
            0 0 0 2px rgba(255, 255, 255, 0.8) inset;
    }
}

.mx-auto {
    margin-right: auto !important;
    margin-left: auto !important;
}

.principal-footer {
    background: radial-gradient(
        circle at 50% 15%,
        #faf0e4 0%,
        #f5e6d3 50%,
        #ecd6be 100%
    );
    height: 40px;
}

/* ====== HERO DEL MÓDULO ====== */
.module-hero {
    background-color: #1c1f2b;
}

.module-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(var(--mf-rose-rgb), 0.45) 0%,
            transparent 45%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(var(--mf-burgundy-rgb), 0.55) 0%,
            transparent 55%
        ),
        radial-gradient(
            circle at 50% 110%,
            rgba(var(--mf-gold-rgb), 0.22) 0%,
            transparent 60%
        ),
        linear-gradient(135deg, var(--mf-burgundy-dark) 0%, var(--mf-dark) 100%);
    z-index: 1;
}

.module-hero-overlay {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.025) 0,
        rgba(255, 255, 255, 0.025) 1px,
        transparent 1px,
        transparent 14px
    );
    z-index: 1;
}

.class-step-icon {
    width: 56px;
    height: 56px;
}

.class-step-number {
    position: absolute;
    bottom: -6px;
    right: -6px;
    font-size: 0.65rem;
    padding: 0.35em 0.6em;
    letter-spacing: 0.5px;
}

.class-divider {
    opacity: 0.08;
    border-top: 2px dashed #1c1f2b;
}

/* ====== TARJETAS DE MEDIA ====== */
.class-media-card {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.class-media-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1) !important;
}

.class-media-img {
    display: block;
    max-height: 560px;
    object-fit: cover;
}

.class-media-hint {
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

/* ====== TEXTO ====== */
.class-text-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2c2f3a;
}

.class-text-content p:last-child {
    margin-bottom: 0;
}

.class-text-content strong {
    color: #1c1f2b;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 576px) {
    .module-hero h1 {
        font-size: 1.75rem;
    }

    .class-step-icon {
        width: 48px;
        height: 48px;
        font-size: 1.1rem !important;
    }

    .class-text-content {
        font-size: 1rem;
        line-height: 1.7;
    }
}

.plyr {
    border-radius: var(--bs-border-radius-xl) !important;
}

/* Contenedor relativo para posicionar las capas sobre Plyr */
.plyr-shield-wrapper {
    position: relative !important;
    width: 100%;
}

/* Escudo superior: Bloquea el título, canal y botón "Más opciones" */
.plyr-shield-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    z-index: 10;
    background: transparent;
    pointer-events: auto;
    cursor: default;
}

/* Asegura que los controles y menús de Plyr se dibujen SIEMPRE por encima del escudo */
.plyr--youtube .plyr__controls {
    z-index: 20 !important;
}

.plyr__menu__container {
    z-index: 30 !important;
}
