/* 
   NextERP Premium Design - Estilos Base 
   Enfoque: Neumorphism Light, Configurable, Moderno.
*/

:root {
    /* Paleta Next House Exacta - Skills locked */
    --color-fondo: #f8fafc;
    --color-sidebar: #ffffff;
    --color-texto: #0f172a;
    --color-texto-secundario: #64748b;
    --color-primario: #001a4d;
    --color-secundario: #fe6500;
    --color-acento: #ffedd5;
    
    /* Sombras "Aire" */
    --sombra-card: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --sombra-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

* { 
    box-sizing: border-box; 
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem; /* Consistencia compacta */
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.tarjeta-neumorfica {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--sombra-card);
    border: 1px solid rgba(255,255,255,0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%; /* Asegurar que no exceda */
}

.tarjeta-neumorfica:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-premium);
}

.sidebar {
    width: 260px;
    background: var(--color-sidebar);
    padding: 2rem 1.5rem;
    border-right: 1px solid #e2e8f0;
}

.sidebar nav a {
    color: var(--color-texto-secundario);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: #ffffff;
    color: var(--color-primario);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Sombra suave para el activo */
}

.sidebar nav a.active i {
    color: var(--color-secundario) !important; /* Icono Naranja cuando está activo */
}

.boton-accion-lateral {
    background: var(--color-secundario);
    color: white;
    padding: 1rem;
    border-radius: 1rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(254, 101, 0, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
}

/* --- Tipografía --- */
h1, h2, h3, h4, h5 {
    color: var(--color-texto);
    font-weight: 800;
}

h1 {
    font-size: 1.7rem; /* Reducido de 2rem */
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--color-primario), var(--color-secundario));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.subtitulo {
    color: var(--color-texto-secundario);
    margin-bottom: 2rem;
}

/* --- Formularios y Entradas (Neumorphism Inset) --- */
.grupo-input {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-texto-secundario);
}

input, select {
    width: 100%;
    padding: 0.6rem 0.8rem; /* Reducido de 0.75rem */
    background: var(--color-fondo);
    border: none;
    border-radius: 0.6rem;
    color: var(--color-texto);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: inset 3px 3px 6px var(--sombra-oscura),
                inset -3px -3px 6px var(--sombra-clara);
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    box-shadow: inset 8px 8px 12px var(--sombra-oscura),
                inset -8px -8px 12px var(--sombra-clara);
}

input::placeholder {
    color: #b0bec5;
}

/* --- Botones --- */
.boton-primario {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--color-secundario), #ea580c);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(254, 101, 0, 0.2);
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.boton-primario:hover {
    background: var(--color-boton-hover);
    transform: translateY(-2px);
    box-shadow: none !important;
}

.boton-primario:active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 8px rgba(0,0,0,0.15),
                inset -4px -4px 8px rgba(255,255,255,0.1);
}

/* --- Alertas --- */
.alerta {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 4px 4px 8px var(--sombra-oscura),
               -4px -4px 8px var(--sombra-clara);
}

.alerta-error {
    background: var(--color-fondo);
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
}

.alerta-exito {
    background: var(--color-fondo);
    color: var(--color-exito);
    border-left: 4px solid var(--color-exito);
}

/* --- Dashboard Specific --- */
.dashboard-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--color-fondo);
}

.layout-contenido {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.barra-superior {
    height: 55px; /* Ligeramente más compacta */
    background: var(--color-primario);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: white;
    font-weight: 700;
    z-index: 100;
    flex-shrink: 0;
}

.barra-inferior {
    padding: 1rem 1.5rem;
    background: var(--color-sidebar);
    color: var(--color-texto-secundario);
    font-size: 0.75rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
}

.contenido-principal {
    flex: 1;
    padding: 1.5rem 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.tarjeta-estadistica {
    background: var(--color-fondo);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 6px 6px 10px var(--sombra-oscura),
               -6px -6px 10px var(--sombra-clara);
}

/* Menu Enlaces */
.sidebar nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.sidebar nav a:hover {
    background: var(--color-primario) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.sidebar nav a:hover i,
.sidebar nav a:hover span {
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .contenido-principal {
        padding: 1rem;
    }
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.75rem;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar h1 span, .sidebar nav span, .sidebar div span {
        display: none;
    }
    .sidebar nav a {
        justify-content: center;
        padding: 1rem 0;
    }
    .sidebar nav a i {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }
    /* Estado expandido en móvil al hacer click en el toggle */
    .sidebar.expandida {
        width: 250px;
        padding: 1.5rem 1rem;
        position: fixed;
        height: 100vh;
        z-index: 100;
        box-shadow: 10px 0 25px rgba(0,0,0,0.15);
    }
    .sidebar.expandida h1 span, .sidebar.expandida nav span, .sidebar.expandida div span {
        display: inline-block;
    }
    .sidebar.expandida nav a {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }

    .ocultar-movil {
        display: none !important;
    }
    
    .barra-superior {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .ocultar-esencial {
        display: none !important;
    }
}

/* --- Tablas Neumórficas --- */
.tabla-contenedor {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    margin-top: 1rem;
}

.tabla-contenedor th {
    padding: 1.25rem 1rem;
    text-align: left;
    background: var(--color-primario);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
}

.tabla-contenedor th:first-child {
    border-radius: 0.75rem 0 0 0.75rem;
}

.tabla-contenedor th:last-child {
    border-radius: 0 0.75rem 0.75rem 0;
}

.fila-neumorfica {
    background: var(--color-fondo);
    transition: all 0.3s ease;
    box-shadow: 4px 4px 8px var(--sombra-oscura),
               -4px -4px 8px var(--sombra-clara);
}

.fila-neumorfica td {
    padding: 1.25rem 1rem;
    color: var(--color-texto);
    font-size: 0.95rem;
}

.fila-neumorfica td:first-child {
    border-radius: 1rem 0 0 1rem;
}

.fila-neumorfica td:last-child {
    border-radius: 0 1rem 1rem 0;
}

.fila-neumorfica:hover {
    transform: scale(1.005);
    box-shadow: 6px 6px 12px var(--sombra-oscura),
               -6px -6px 12px var(--sombra-clara);
}

/* --- Badges --- */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    box-shadow: inset 2px 2px 4px var(--sombra-oscura),
                inset -2px -2px 4px var(--sombra-clara);
}

.badge-superadmin { color: var(--color-primario); background: rgba(0, 210, 255, 0.1); }
.badge-admin-cliente { color: #4a5568; background: rgba(74, 85, 104, 0.05); }
.badge-usuario { color: #a0aec0; background: rgba(160, 174, 192, 0.05); }

/* --- Botones de Acción --- */
.btn-accion {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--color-fondo);
    color: var(--color-texto-secundario);
    cursor: pointer;
    box-shadow: 3px 3px 6px var(--sombra-oscura),
               -3px -3px 6px var(--sombra-clara);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-accion:hover {
    color: var(--color-primario);
    box-shadow: inset 2px 2px 4px var(--sombra-oscura),
                inset -2px -2px 4px var(--sombra-clara);
}

.btn-accion-danger:hover {
    color: var(--color-error);
}

/* --- Login Split Screen Classes --- */
.login-split-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    background: #faf8fe;
}

.login-form-side {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.login-brand-container {
    margin-bottom: 3rem;
}

.login-brand-logo {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-brand-icon {
    width: 3rem;
    height: 3rem;
    background: var(--color-primario);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-brand-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-primario);
    margin: 0;
    letter-spacing: -0.05em;
}

.login-visual-side {
    display: none;
    width: 55%;
    position: relative;
    overflow: hidden;
    background: var(--color-primario);
}

.login-glass-info {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
}

@media (min-width: 1024px) {
    .login-visual-side { display: block; }
}

/* --- Dashboard V2 Modern Styles --- */
.dashboard-header-v2 {
    margin-bottom: 4rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.dashboard-kpi-card {
    padding: 2rem;
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 2rem;
    background: var(--color-fondo);
}

.dashboard-kpi-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.25rem;
    background: rgba(0, 26, 77, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--color-primario);
}

.dashboard-kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primario);
    line-height: 1;
}
