/* Único fix: que nunca queden totalmente ocultos */
.header-logo-wrapper,
.logo-wrapper,
.sidebar-wrapper,
.sidebar-wrapper.close_icon {
    visibility: visible !important;
    opacity: 1 !important;
}

.product-table .btn-xs,
.product-table .btn-xs a {
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 8px;
}

.product-table .btn-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-table .btn-group.btn-group-sm .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem; /* mismo tamaño para ambos */
  line-height: 1.2;
  padding: 0.25rem 0.5rem;
}

/* Logo de empresa en header y sidebar */
.logo-wrapper img {
  max-width: 100%;
  height: auto;
}

.login-left-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 10px;
    width: 100%;
}

/* Contenedor limpio, solo controla tamaño y clipping */
.login-cover-container {
    width: 100%;
    height: 260px;
    margin-top: 44px;
    border-radius: 12px;
    overflow: hidden;              /* recorta lo que sobresalga */
    display: block;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Imagen: SIEMPRE 100% del ancho del contenedor */
.login-cover-img {
    width: 100%;                   /* ocupa todo el ancho */
    height: 100%;                  /* se adapta al alto del contenedor */
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;             /* llena sin dejar huecos (puede recortar un poco) */
    display: block;
    border-radius: 12px;
    border: 3px solid #e0e6ed;     /* único borde visible */
}

/* Logo debajo */
.login-left-logo-img {
    margin-top: 12px;
    margin-bottom: 12px;
    max-width: 140px;
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive: ocultar carátula, logo más grande */
@media (max-width: 992px) {
    .login-cover-container {
        display: none !important;
    }

    .login-left-logo-img {
        max-width: 180px;
        margin-top: 20px;
    }

    .login-left-wrapper {
        padding: 20px 10px;
        justify-content: center;
    }
}
/* Fix para contadores del topbar (que no se vean cortados) */
.nav-right .notification-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-right .notification-box .badge {
    position: absolute !important;
    top: -5px !important;
    right: -10px !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
    min-width: 18px;
    height: 18px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #fff;
    border-radius: 50% !important;
    z-index: 1;
    line-height: 1;
    transform: none !important;
}

/* ==========================================================================
   LAYOUT FINAL: UNA SOLA LÍNEA, LOGO VISIBLE Y CUERPO STRETCH
   ========================================================================== */

/* 1. Header Full Width y alineación */
body #pageWrapper .page-header {
    margin-left: 0 !important;
    width: 100% !important;
    left: 0 !important;
    top: 0 !important;
    position: fixed !important;
    height: 80px !important;
    z-index: 1060 !important;
    background-color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

body #pageWrapper .page-header .header-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    height: 80px !important;
    padding: 0 20px !important;
}

/* 2. Logo y Toggle Grid (Cuatro cuadritos) */
body #pageWrapper .header-logo-wrapper {
    display: flex !important;
    visibility: visible !important;
    height: 80px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

@media (min-width: 1200px) {
    body #pageWrapper .header-logo-wrapper {
        width: 280px !important;
    }
    .mobile-scroll-row {
        width: auto !important;
        flex: 1;
        overflow-x: visible !important;
    }
}

@media (max-width: 1199.98px) {
    /* Ajuste para que el topbar más alto no tape el contenido del dashboard */
    body #pageWrapper .page-header {
        height: auto !important;
        min-height: 80px;
        padding-bottom: 10px !important;
    }
    body #pageWrapper .page-body-wrapper .page-body {
        margin-top: 125px !important;
    }
    body #pageWrapper .sidebar-wrapper {
        top: 125px !important;
        height: calc(100vh - 125px) !important;
        z-index: 1050 !important;
    }
    
    /* Ocultar el logo del sidebar en móviles (ya se muestra en el topbar) */
    body #pageWrapper .sidebar-wrapper .logo-wrapper,
    body #pageWrapper .sidebar-wrapper .logo-icon-wrapper {
        display: none !important;
    }
    
    /* Header en 2 líneas */
    body #pageWrapper .page-header .header-wrapper {
        flex-wrap: wrap !important;
        height: auto !important;
        padding: 10px 15px 5px 15px !important;
    }
    /* Línea 1: Logo y Toggle */
    body #pageWrapper .header-logo-wrapper {
        width: 100% !important;
        justify-content: space-between !important;
        height: auto !important;
        padding-top: 5px !important;
    }
    .header-logo-wrapper .mobile-logo {
        margin-right: auto !important;
    }
    .header-logo-wrapper .toggle-sidebar {
        margin-left: auto !important;
    }
    .mobile-logo img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    /* Línea 2: Scroll horizontal */
    .mobile-scroll-row {
        justify-content: flex-start !important;
    }
    body #pageWrapper .page-header .nav-right .nav-menus {
        flex-wrap: nowrap !important;
        width: max-content !important;
    }
}

body #pageWrapper .header-logo-wrapper img {
    height: 45px !important;
    width: auto !important;
    display: block !important;
}

/* 3. Sidebar debajo del Header y sin espacios */
body #pageWrapper .sidebar-wrapper {
    margin-top: 80px !important;
    top: 0 !important;
    height: calc(100vh - 80px) !important;
    z-index: 1050 !important;
    transition: 0.5s !important;
}

/* Sidebar Ultra-Compacto al cerrar */
body #pageWrapper .sidebar-wrapper.close_icon {
    width: 80px !important;
}

body #pageWrapper .sidebar-main, 
body #pageWrapper #sidebar-menu {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* HIDE TEXT WHEN COLLAPSED */
body #pageWrapper .sidebar-wrapper.close_icon .sidebar-link span,
body #pageWrapper .sidebar-wrapper.close_icon .sidebar-main-title {
    display: none !important;
}

body #pageWrapper .sidebar-wrapper.close_icon .sidebar-list {
    text-align: center !important;
}

body #pageWrapper .sidebar-wrapper.close_icon .sidebar-list i:not(.fa-thumb-tack) {
    margin: 0 !important;
    font-size: 20px !important;
}

/* 4. Cuerpo Stretch / Expansión */
body #pageWrapper .page-body-wrapper {
    padding-top: 80px !important;
    margin-top: 0 !important;
}

body #pageWrapper .page-body {
    margin-top: 0 !important;
}

/* Asegurar que los items del menú no corten lo que sobresale */
.nav-right .nav-menus li {
    overflow: visible !important;
}

/* Control del tamaño del logo al colapsar el sidebar */
.sidebar-wrapper.close_icon:not(:hover) .logo-wrapper {
    display: none !important;
}

.sidebar-wrapper.close_icon:not(:hover) .logo-icon-wrapper {
    display: block !important;
    padding: 10px 0 !important;
}

.sidebar-wrapper.close_icon:not(:hover) .logo-icon-wrapper img {
    max-width: 40px !important;
    height: auto !important;
    margin: 0 auto 5px auto !important;
}

/* Toggle button in collapsed state */
.sidebar-wrapper.close_icon .logo-icon-wrapper .toggle-sidebar {
    display: block !important;
    text-align: center;
    margin-top: 5px;
    cursor: pointer;
}

.sidebar-wrapper.close_icon .logo-icon-wrapper .toggle-sidebar i {
    width: 20px;
    height: 20px;
}

.sidebar-wrapper:hover .logo-wrapper,
.sidebar-wrapper:not(.close_icon) .logo-wrapper {
    display: flex !important;
}

.sidebar-wrapper:hover .logo-icon-wrapper,
.sidebar-wrapper:not(.close_icon) .logo-icon-wrapper {
    display: none !important;
}

/* ==========================================================================
   ESTILOS GLOBALES DE FORMULARIOS: FONDO GRIS CLARO UNIFORME
   ========================================================================== */
.form-control, .form-select {
    background-color: #e8ecef !important;
    border: 1px solid #ced4da !important;
    color: #212529 !important;
    padding: 6px 10px !important;
    transition: all 0.2s ease-in-out !important;
}

.form-check-input {
    background-color: #e8ecef !important;
    border: 1px solid #ced4da !important;
    accent-color: #0d6efd !important;
    cursor: pointer !important;
    transition: all 0.2s ease-in-out !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

.form-control:focus, .form-select:focus {
    background-color: #e8ecef !important;
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

/* Labels con alto contraste y estilo moderno */
.form-label, label.control-label {
    font-weight: 800 !important; /* Máxima negrita */
    color: #000000 !important; /* Negro puro */
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   MENÚ VERTICAL MÓVIL (topbar)
   En <= 1199 px el menú horizontal del topbar queda fuera de pantalla; se
   sustituye por un botón hamburguesa que abre un panel vertical por la derecha.
   ========================================================================== */
.mobile-topmenu-btn,
.mobile-topmenu,
.mobile-topmenu-overlay {
    display: none;
}

@media (max-width: 1199.98px) {
    /* Ocultar el menú horizontal del topbar (su contenido queda fuera del viewport) */
    body #pageWrapper .page-header .nav-right {
        display: none !important;
    }

    /* Botón hamburguesa en la primera línea del topbar */
    body #pageWrapper .mobile-topmenu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin-left: 6px;
        padding: 6px 8px;
        border: 0;
        background: transparent;
        color: #2c323f;
        cursor: pointer;
        line-height: 1;
    }
    body #pageWrapper .mobile-topmenu-btn .fa {
        font-size: 22px;
    }

    .mobile-topmenu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1070;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .mobile-topmenu-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .mobile-topmenu {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        background: #ffffff;
        z-index: 1080;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    .mobile-topmenu.open {
        transform: translateX(0);
    }

    .mobile-topmenu-head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 18px 16px;
        background: #f8f9fa;
        border-bottom: 1px solid #e9ecef;
    }
    .mobile-topmenu-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }
    .mobile-topmenu-user {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .mobile-topmenu-user strong {
        font-size: 15px;
        color: #2c323f;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-topmenu-user small {
        font-size: 12px;
        color: #6c757d;
    }
    .mobile-topmenu-close {
        margin-left: auto;
        border: 0;
        background: transparent;
        color: #6c757d;
        font-size: 20px;
        padding: 6px;
        cursor: pointer;
        line-height: 1;
    }

    .mobile-topmenu-list {
        list-style: none;
        margin: 0;
        padding: 8px 0;
        flex: 1;
    }
    .mobile-topmenu-list li {
        margin: 0;
    }
    .mobile-topmenu-list a,
    .mobile-topmenu-list button {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        padding: 14px 20px;
        border: 0;
        background: transparent;
        color: #2c323f;
        font-size: 15px;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }
    .mobile-topmenu-list a:hover,
    .mobile-topmenu-list button:hover {
        background: #f1f3f5;
    }
    .mobile-topmenu-list .fa {
        width: 22px;
        text-align: center;
        font-size: 17px;
        color: #f39c12;
    }
    .mobile-topmenu-list .badge {
        margin-left: auto;
        background: #dc3545;
    }
    .mobile-topmenu-list .mobile-topmenu-logout,
    .mobile-topmenu-list .mobile-topmenu-logout .fa {
        color: #dc3545;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }
}


