* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: #f4f6f9;
    overflow-x: hidden;
}

/* VARIABLES DE COLOR */
:root {
    --color-primary: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-secondary: #64748b;
    --color-dark: #1f2937;
    --color-border: #e2e8f0;
    --color-text: #334155;
    --sidebar-width: 280px;
    --sidebar-right-width: 280px;
    --navbar-height: 70px;
    --footer-height: 60px;
}

/* NAVBAR - FIXED TOP */
.navbar-custom {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0f172a 100%);
    height: var(--navbar-height);
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toggle-sidebar-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
    margin-left: 10px;
}

.toggle-sidebar-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary-light);
}

.toggle-sidebar-right-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
    margin-right: 10px;
}

.toggle-sidebar-right-btn:hover {
    transform: scale(1.1);
    color: var(--color-primary-light);
}

.navbar-brand {
    color: white;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.navbar-item {
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    position: relative;
}

.navbar-item:hover {
    color: var(--color-primary-light);
}

.nav-bell {
    position: relative;
}

.nav-bell i {
    animation: bell-ring 1.2s ease-in-out infinite;
    transform-origin: top center;
}

.badge-notify {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    animation: badge-pulse 1.5s ease-out infinite;
    min-width: 18px;
    text-align: center;
}

.dropdown-notify .dropdown-menu {
    min-width: 280px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.dropdown-notify .dropdown-header {
    background: linear-gradient(135deg, #4b5563 0%, #111827 100%);
    color: white;
    font-weight: 600;
    padding: 12px 16px;
}

.dropdown-notify .dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 16px;
    white-space: normal;
}

.dropdown-notify .dropdown-item i {
    margin-top: 2px;
    color: var(--color-primary);
}

.dropdown-notify .dropdown-item:active {
    background-color: #e5e7eb;
    color: inherit;
}

.dropdown-notify .dropdown-footer {
    text-align: center;
    padding: 10px 16px;
}

.dropdown-notify .dropdown-footer a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, left 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
}

.sidebar-item {
    margin: 2px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.sidebar-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-primary-light);
    padding-left: 30px;
}

.sidebar-link.active {
    background-color: var(--color-primary-light);
    color: white;
    border-left: 4px solid #60a5fa;
}

/* SIDEBAR DERECHO */
.sidebar-right {
    position: fixed;
    right: 0;
    top: var(--navbar-height);
    width: var(--sidebar-right-width);
    height: calc(100vh - var(--navbar-height) - var(--footer-height));
    background: linear-gradient(180deg, #0f0f0f 0%, #000000 100%);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, right 0.3s ease;
}

.sidebar-right::-webkit-scrollbar {
    width: 8px;
}

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

.sidebar-right::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar-right::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-right-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-right-header h5 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-right-menu {
    list-style: none;
    padding: 12px 0;
}

.sidebar-right-item {
    margin: 2px 0;
}

.sidebar-right-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    font-size: 14px;
}

.sidebar-right-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-right-link:hover {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--color-primary-light);
    padding-right: 30px;
}

.sidebar-right-link.active {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--color-primary-light);
    border-right: 3px solid var(--color-primary-light);
}

/* Submenús del sidebar derecho */
.sidebar-right-submenu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
}

.sidebar-right-item.open .sidebar-right-submenu {
    max-height: 500px;
}

.sidebar-right-submenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 45px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 13px;
}

.sidebar-right-submenu-link:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-primary-light);
    padding-left: 50px;
}

.sidebar-right-submenu-link.active {
    color: var(--color-primary-light);
    background-color: rgba(59, 130, 246, 0.15);
}

.sidebar-right-toggle-icon {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 12px;
}

.sidebar-right-item.open .sidebar-right-toggle-icon {
    transform: rotate(180deg);
}

/* MAIN CONTENT */
.main-wrapper {
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-right-width);
    margin-top: var(--navbar-height);
    margin-bottom: var(--footer-height);
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    transition: margin-left 0.3s ease, margin-right 0.3s ease;
}

.main-content {
    padding: 10px;
}

/* FOOTER - FIXED BOTTOM */
.footer-custom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1010;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.footer-left {
    display: flex;
    gap: 18px;
    align-items: center;
}

.footer-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 6px 10px;
    border-radius: 8px;
}

.footer-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

/* TARJETAS Y CONTENIDO */
.card {
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border-radius: 10px;
}

/* .card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
} */

.page-title {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 25px;
}

.badge-primary {
    background-color: var(--color-primary-light);
}

/* CARD HEADERS CON DEGRADADO */
.card-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0f172a 100%) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 12px 16px !important;
}

.card-header .card-title {
    color: white;
    font-weight: 600;
    margin-bottom: 0;
}

.card-header i {
    margin-right: 8px;
    opacity: 0.95;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 250px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        --sidebar-right-width: 0px;
        --navbar-height: 60px;
        --footer-height: 50px;
    }

    .toggle-sidebar-btn {
        display: block;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        height: calc(100vh - var(--navbar-height));
        margin-bottom: var(--footer-height);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .sidebar-right {
        width: 280px;
        transform: translateX(100%);
        height: calc(100vh - var(--navbar-height));
        margin-bottom: var(--footer-height);
    }

    .sidebar-right.active {
        transform: translateX(0);
        box-shadow: -2px 0 15px rgba(0, 0, 0, 0.3);
    }

    .main-wrapper {
        margin-left: 0;
        margin-right: 0;
    }

    .main-content {
        padding: 20px;
    }

    .navbar-right {
        gap: 15px;
    }

    .footer-left {
        gap: 15px;
        font-size: 12px;
    }

    .footer-link {
        font-size: 12px;
    }

    .toggle-sidebar-btn {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .footer-left {
        flex-direction: column;
        gap: 5px;
    }

    .main-content {
        padding: 15px;
    }

    .page-title {
        font-size: 22px;
    }
}

/* ESTADO COLAPSADO (DESKTOP) */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 0;
}

body.sidebar-right-collapsed .sidebar-right {
    transform: translateX(100%);
}

body.sidebar-right-collapsed .main-wrapper {
    margin-right: 0;
}

/* OCULTAR SIDEBAR EN SUBPÁGINAS (SOLO DESKTOP) */
@media (min-width: 769px) {
    body.hide-sidebar-page .sidebar {
        transform: translateX(-100%);
    }
    
    body.hide-sidebar-page .main-wrapper {
        margin-left: 0;
    }
    
    /* Cuando el usuario lo expande manualmente, se queda visible */
    body.hide-sidebar-page:not(.sidebar-collapsed) .sidebar {
        transform: translateX(0);
    }
    
    body.hide-sidebar-page:not(.sidebar-collapsed) .main-wrapper {
        margin-left: var(--sidebar-width);
    }
}

/* ANIMACIONES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes bell-ring {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(18deg); }
    20% { transform: rotate(-16deg); }
    30% { transform: rotate(12deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(6deg); }
    60% { transform: rotate(-4deg); }
    70% { transform: rotate(2deg); }
    80% { transform: rotate(-1deg); }
    90% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}

@keyframes badge-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Breadcrumb separators */
.breadcrumb-item + .breadcrumb-item::before {
    content: '> ';
    color: inherit;
}

/* Modal Headers - Gradient Global */
.modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Modal Close Button - Light Color */
.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

/* DataTables Export Buttons - Spacing */
.dt-buttons {
    margin-bottom: 20px !important;
}

.dt-button {
    border-radius: 6px !important;
}

/* TABS MINIMALISTA */
.nav-tabs-minimal {
    border-bottom: 1px solid #e0e0e0;
    gap: 1rem;
}
.nav-tabs-minimal .nav-link {
    border: none;
    background: none;
    color: #356199;
    font-weight: 500;
    border-radius: 0;
    padding: 0.75rem 1.2rem;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
}
.nav-tabs-minimal .nav-link.active {
    color: #222;
    border-bottom: 2.5px solid #356199;
    background: none;
}
.nav-tabs-minimal .nav-link:focus {
    outline: none;
    color: #222;
}
@media (max-width: 600px) {
    .nav-tabs-minimal {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .nav-tabs-minimal .nav-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.98rem;
    }
}

/* blockquote PERSONALIZADO */
.inventory-note-wrapper {
    position: relative;
}
.inventory-note {
    margin: 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #356199;
    background: #f4f8ff;
    border-radius: 0.35rem;
    color: #1f2d3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.inventory-note p {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
}
.inventory-note footer {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* ROJO */
.inventory-note-rojo {
    margin: 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #dc2626;
    background: #fee2e2;
    border-radius: 0.35rem;
    color: #1f2d3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.inventory-note-rojo p {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
}
.inventory-note-rojo footer {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* VERDE */
.inventory-note-verde {
    margin: 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #16a34a;
    background: #d1fae5;
    border-radius: 0.35rem;
    color: #1f2d3d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.inventory-note-verde p {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
}
.inventory-note-verde footer {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* CODIGO PARA LAS TARJETAS DE INICIO */
.home-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1200px) {
    .home-cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .home-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .home-cards-grid {
        grid-template-columns: 1fr;
    }
}

.home-card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    background: linear-gradient(135deg, var(--color-primary) 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

.home-card .card-body {
    padding: 1rem 1rem .65rem;
    flex: 1 1 auto;
}

.home-card .card-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: .6rem 1rem .8rem;
    margin-top: auto;
}

.home-card strong,
.home-card .pending-count {
    color: #f8f9fa !important;
}

.home-card .text-muted {
    color: #cbd5e1 !important;
}

.home-card .pending-label {
    color: #9ca3af;
}

.home-card .card-footer a {
    color: #e2e8f0;
}

.home-card .card-footer a:hover {
    color: #ffffff;
}

.home-card.ok {
    border-left: 0;
    background: linear-gradient(135deg, #198754 0%, #0f172a 100%);
}

.home-card.pending {
    border-left: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #0f172a 100%);
}

.tag-estado {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: .3rem .68rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .24);
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}

.tag-estado.ok {
    color: #ffffff;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 6px 14px rgba(21, 128, 61, .35);
}

.tag-estado.pending {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .35), 0 6px 14px rgba(185, 28, 28, .35);
}

.pending-count {
    font-size: 1.8rem;
    line-height: 1;
    font-weight: 700;
    margin: .55rem 0 .2rem;
}

.pending-count-text {
    font-size: .85rem;
    font-weight: 500;
    margin-left: .35rem;
    color: #cbd5e1;
    vertical-align: middle;
}

.pending-label {
    font-size: .85rem;
    color: #6c757d;
    margin: .45rem 0 0;
    text-align: center;
}

/* NAV NAV-TABS VERTICAL */
#tabsVerticalDemo .nav-link{
    border-radius: .375rem;
    margin-bottom: .35rem;
    background-color: var(--bs-light);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}
#tabsVerticalDemo .nav-link:hover{
    background-color: #e9ecef;
}
#tabsVerticalDemo .nav-link.active{
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 4px 0 0 #0b5ed7;
}
@media (max-width: 767.98px){
    #tabsVerticalDemo{
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: .35rem;
        padding-bottom: .25rem;
    }
    #tabsVerticalDemo .nav-item{
        flex: 0 0 auto;
    }
    #tabsVerticalDemo .nav-link{
        margin-bottom: 0;
        white-space: nowrap;
        width: auto !important;
        min-width: 120px;
        text-align: center !important;
    }
    #tabsVerticalDemo .nav-link.active{
        box-shadow: inset 0 -3px 0 #0b5ed7;
    }
}

/* PARA PONER LAS LISTAS EN FORMATO A) */
ol.letras-par {
    list-style: none; 
    padding-left: 0;
}
ol.letras-par li {
    counter-increment: letra;
    position: relative;
    padding-left: 2em;
}
ol.letras-par li::before {
    content: counter(letra, lower-alpha) ")";
    position: absolute;
    left: 0;
}
ol.letras-par {
    counter-reset: letra;
}
