/* Variables de Tema ERP */
:root {
    --pms-neon: var(--primary-color);
    --pms-bg-dark: #0f172a;
    --pms-card: rgba(30, 41, 59, 0.7);
    --pms-input: rgba(15, 23, 42, 0.6);
}

body, html {
    overflow-x: hidden; /* Evita el scroll global */
    width: 100%;
    max-width: 100%;
}

.pms-container {
    width: 100%;
    overflow-x: hidden; 
}

/* Asegura que el contenido principal no empuje el layout */
.main-pms {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Estructura Principal */
.sidebar-pms { 
    width: 260px; 
    height: 100vh; 
    position: fixed; 
    right: 0; 
    top: 0; 
    background: var(--pms-bg-dark); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 2050; 
    border-left: 1px solid rgba(255,255,255,0.05); 
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    padding-top: 120px;
    overflow-y: auto; /* Habilita el scroll vertical */
    overflow-x: hidden; /* Evita scroll horizontal interno */
}

.sidebar-pms.closed { 
    right: -260px; 
    box-shadow: none;
}

.main-pms { 
    margin-right: 260px; 
    transition: 0.3s; 
    padding: 25px; 
    min-height: 100vh; 
    color: #cbd5e1;
}

.main-pms.full { margin-right: 0; }

/* Tarjetas Estilo Neon */
.neo-card { 
    background: var(--pms-card); 
    backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 16px; 
    position: relative; 
    overflow: hidden; 
    color: #FFFFFF;
    transition: transform 0.2s;
}

.neo-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.text-neon { 
    color: var(--pms-neon); 
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.2); 
}

/* Navegación Lateral */
.nav-link-pms { 
    color: #94a3b8; 
    padding: 12px 20px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-radius: 8px; 
    text-decoration: none; 
    transition: 0.2s; 
    margin-bottom: 4px; 
}

.nav-link-pms:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.nav-link-pms.active { 
    background: rgba(var(--primary-rgb), 0.1); 
    color: var(--pms-neon) !important; 
    font-weight: 700; 
    border-right: 3px solid var(--pms-neon); 
}

/* Formularios y Tablas */
.form-label-neon { 
    font-size: 0.7rem; 
    font-weight: 800; 
    color: var(--pms-neon); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    display: block; 
    margin-bottom: 6px; 
}

.table-pms { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0; 
}

.table-pms thead th {
    background: rgba(0,0,0,0.2);
    font-size: 0.8rem;
    color: var(--pms-neon);
    text-transform: uppercase;
}

.table-pms td, .table-pms th { 
    padding: 15px; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
}


.unit-card {
    background: var(--pms-card);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%; /* Para que todas midan lo mismo en la fila */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.unit-card:hover {
    border-color: var(--pms-neon);
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--primary-rgb), 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.unit-card .unit-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: var(--pms-neon);
}


@media (max-width: 768px) {
    .main-pms {
        margin-right: 0 !important; /* Elimina el espacio del sidebar en móvil */
        padding: 15px; /* Reduce el padding para ganar espacio */
    }
    
    .sidebar-pms {
        width: 280px; 
    }

    .sidebar-pms.closed {
        right: -280px;
    }

    .main-pms {
        margin-right: 0 !important; /* El contenido ocupa todo el ancho */
        padding: 15px;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(4px);
        z-index: 2040;
        display: block;
    }
}