/* === LAYOUTS DEL DASHBOARD BY-LOLA BOUTIQUE === */

.app-container {
    display: flex;
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-dark-base);
}

/* === SIDEBAR DE LUJO === */
.sidebar {
    width: 275px;
    min-width: 275px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--bg-dark-surface);
    border-right: 1px solid var(--border-gold-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1.2rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-dark);
    position: relative;
}

/* Botón para cerrar sidebar en móviles */
.btn-sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dark);
    color: var(--gold-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.btn-sidebar-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.sidebar-logo {
    max-height: 55px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    mix-blend-mode: screen !important;
    background: transparent !important;
    border: none !important;
    filter: brightness(1.15) contrast(1.2);
}

/* === TARJETA DE PERFIL INTERACTIVA === */
.sidebar-user-card {
    margin: 1.1rem 1.1rem 0.5rem 1.1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.sidebar-user-card:hover {
    border-color: var(--border-gold-subtle);
    background: rgba(212, 175, 55, 0.04);
}

.user-avatar-wrapper {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
    flex-shrink: 0;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.user-avatar-wrapper:hover .user-avatar-img {
    transform: scale(1.22);
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.85), 0 0 35px rgba(212, 175, 55, 0.35);
    border-color: #ffd700;
}

.user-avatar-overlay-hint {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--gold-gradient);
    color: #050505;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    opacity: 0.92;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.user-avatar-wrapper:hover .user-avatar-overlay-hint {
    transform: scale(1.15);
    opacity: 1;
}

.user-details {
    overflow: hidden;
    line-height: 1.35;
    flex-grow: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-badge {
    font-size: 0.7rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-family: var(--font-title);
}

/* === MODAL DE FOTO DE PERFIL (MÁXIMO 440PX) === */
.modal-profile-dialog {
    max-width: 440px !important;
    margin: 1.75rem auto;
}

.profile-modal-avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.25rem;
    position: relative;
}

.profile-modal-avatar-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 15%;
    border: 3px solid var(--gold-primary);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5), 0 0 50px rgba(212, 175, 55, 0.2);
    transition: transform 0.3s ease;
}

.profile-modal-avatar-img:hover {
    transform: scale(1.03);
}

.profile-modal-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-modal-name {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.profile-modal-role {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--border-gold-subtle);
    border-radius: 20px;
    color: var(--gold-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* === NAVEGACIÓN DEL SIDEBAR === */
.sidebar-nav {
    flex-grow: 1;
    padding: 1rem 0.85rem;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.nav-item-custom {
    margin-bottom: 6px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.25s ease;
    position: relative;
}

.nav-link-custom svg {
    color: var(--gold-primary);
    opacity: 0.75;
    transition: opacity 0.25s, transform 0.25s;
    flex-shrink: 0;
}

.nav-link-custom:hover {
    color: var(--text-primary);
    background: var(--bg-dark-hover);
}

.nav-link-custom:hover svg {
    opacity: 1;
    transform: translateX(3px);
}

.nav-link-custom.active {
    color: #050505;
    background: var(--gold-gradient);
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.32);
}

.nav-link-custom.active svg {
    color: #050505;
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.15rem;
    border-top: 1px solid var(--border-dark);
}

/* === MARCA DE AGUA QUANTUM BYTES EN EL SOFTWARE === */
.sidebar-quantum-badge {
    text-align: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.quantum-title {
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold-light);
    opacity: 0.8;
}

.app-software-watermark {
    position: fixed;
    bottom: 14px;
    right: 22px;
    pointer-events: none;
    z-index: 5;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.07);
    user-select: none;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.45);
}

/* === CONTENIDO PRINCIPAL === */
.main-wrapper {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at 90% 10%, rgba(212, 175, 55, 0.04) 0%, transparent 60%),
                var(--bg-dark-base);
}

/* Topbar */
.topbar {
    height: 64px;
    background: var(--bg-dark-surface);
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 90;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--gold-primary);
    padding: 6px;
    cursor: pointer;
    font-size: 1.3rem;
}

.page-main-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-main-title span {
    color: var(--gold-light);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-badge-role {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border-gold-subtle);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.date-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Panel de Contenido Dinámico */
.content-body {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
}

.section-panel {
    display: none;
}

.section-panel.active {
    display: block;
    animation: fadeInView 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Overlay móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 95;
}

/* === SISTEMA RESPONSIVE AVANZADO DE LAYOUTS (320px - 1920px) === */

/* Pantallas Medianas y Tablets (<= 991px) */
@media (max-width: 991px) {
    .btn-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-dark);
        font-size: 1.4rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .btn-sidebar-toggle:active {
        background: rgba(212, 175, 55, 0.15);
        border-color: var(--gold-primary);
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(295px, 85vw);
        min-width: auto;
        transform: translateX(-100%);
        z-index: 1050;
        box-shadow: 15px 0 40px rgba(0, 0, 0, 0.85);
    }

    .sidebar.show-mobile,
    .sidebar.open {
        transform: translateX(0) !important;
        visibility: visible !important;
    }

    .btn-sidebar-close {
        display: flex;
    }

    .sidebar-overlay {
        z-index: 1040;
    }

    .sidebar-overlay.active,
    .sidebar-overlay.open {
        display: block !important;
    }

    .content-body {
        padding: clamp(0.75rem, 2vw, 1.25rem);
        -webkit-overflow-scrolling: touch;
    }
}

/* Tablets en Vertical y Celulares Grandes (<= 768px) */
@media (max-width: 768px) {
    .topbar {
        height: 58px;
        padding: 0 1rem;
    }

    .date-indicator {
        display: none;
    }

    .page-main-title {
        font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    }

    .topbar-right {
        gap: 8px;
    }

    .topbar-badge-role {
        font-size: 0.68rem;
        padding: 3px 8px;
    }
}

/* Celulares Comunes y Pequeños (<= 480px) */
@media (max-width: 480px) {
    .topbar {
        height: 54px;
        padding: 0 0.75rem;
    }

    .topbar-left {
        gap: 8px;
    }

    .btn-sidebar-toggle {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 1.25rem;
    }

    .page-main-title {
        font-size: 0.95rem;
    }

    .topbar-badge-role {
        display: none;
    }

    .content-body {
        padding: 0.65rem 0.5rem;
    }

    /* Modal de perfil adaptado */
    .modal-profile-dialog {
        max-width: calc(100vw - 1rem) !important;
        margin: 0.5rem auto;
    }

    .profile-modal-avatar-img {
        width: clamp(130px, 38vw, 170px);
        height: clamp(130px, 38vw, 170px);
    }

    .sidebar-user-card {
        margin: 0.85rem 0.75rem 0.4rem 0.75rem;
        padding: 0.7rem 0.75rem;
        gap: 10px;
    }

    .user-avatar-img {
        width: 40px;
        height: 40px;
    }

    .user-name {
        font-size: 0.8rem;
    }
}

/* Celulares Ultra Pequeños (<= 360px - ej. 320px) */
@media (max-width: 360px) {
    .topbar {
        height: 50px;
        padding: 0 0.5rem;
    }

    .page-main-title {
        font-size: 0.88rem;
    }

    .sidebar {
        width: 88vw;
    }

    .nav-link-custom {
        padding: 0.65rem 0.75rem;
        font-size: 0.82rem;
    }
}
