/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    z-index: 1050 !important;
    transition: transform .25s ease;
}

/* Sidebar oculto en móvil */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-260px);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/* Sidebar header */
.sidebar-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   BOTÓN MÓVIL
   ============================================================ */
.navbar-toggler {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    padding: 0;
    cursor: pointer;
}

.navbar-toggler:hover {
    background: #f3f4f6;
}

/* Ocultar botón en desktop */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
    }
}

/* ============================================================
   OVERLAY
   ============================================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.3) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    transition: opacity .25s ease !important;
    z-index: 1040 !important;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================================
   TOPBAR (FIJO SIEMPRE)
   ============================================================ */
.navbar-top {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 57px;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: .5rem 1rem !important;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrapper {
    margin-left: 260px;
    padding-top: 57px;
    /* altura del topbar */
    padding-bottom: 12px !important;
}

/* ============================================================
   MÓVIL
   ============================================================ */
@media (max-width: 991px) {

    /* Topbar fijo arriba */
    .navbar-top {
        left: 0 !important;
        height: 61px;
    }

    .page-wrapper {
        margin-left: 0;
        padding-top: 61px;
        /* altura móvil */
        padding-bottom: 70px !important;
    }
}

/* ============================================================
   FIX: DROPDOWN SOBRE STICKY
   ============================================================ */
@media (max-width: 768px) {

    /* El topbar sigue fijo, pero permitimos que el dropdown lo supere */
    .menu-usuario {
        position: absolute !important;
        z-index: 4000 !important;
    }

    .sticky-mobile-header {
        position: sticky;
        top: 61px;
        z-index: 1020;
        background: var(--tblr-card-bg, #fff);
    }
}

/* ============================================================
   ESTILOS VARIOS
   ============================================================ */
.card-link {
    transition: background .15s ease, transform .15s ease;
}

.card-link:hover {
    background: #f8fafc;
}

.table-responsive div {
    border: 0;
    box-shadow: none;
}

.foto-cuadrada {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f3f5;
}

.img-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}