/* 
   ==========================================================================
   SISTEMA DE ESTILOS PREMIUM - DINÁMICO
   ==========================================================================
   Este archivo controla el LAYOUT y el DISEÑO. 
   Los COLORES se heredan dinámicamente de :root (inyectado en master.blade.php).
*/

body {
    background-color: #f1f5f9 !important;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
}

/* 
   ==========================================================================
   1. MAPEO DE COLORES DINÁMICOS (Restaurando el "Branding")
   ==========================================================================
   Fuerza a las clases de AdminLTE/Bootstrap a usar las variables de la BD.
*/

/* Primario */
.btn-primary, .bg-primary, .badge-primary, .text-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.text-primary { background-color: transparent !important; color: var(--primary) !important; }

/* Success */
.btn-success, .bg-success, .badge-success, .text-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: #fff !important;
}
.text-success { background-color: transparent !important; color: var(--success) !important; }

/* Sidebar & Navy */
.sidebar-dark-navy, .bg-navy, .card-navy.card-outline {
    border-color: var(--dark-navy) !important;
}
.brand-link, .sidebar {
    background-color: var(--dark-navy) !important;
}

/* Sidebar Active State Customization */
.nav-sidebar .nav-link.active {
    background-color: var(--success) !important;
    color: #fff !important;
}

.nav-sidebar .menu-open > .nav-link {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 
   ==========================================================================
   2. DISEÑO PREMIUM (Layout & Componentes)
   ==========================================================================
*/

.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;
}

/* Filtros colapsables */
.filter-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

/* Badges Modernos (Soft Pills) */
.badge-soft-primary {
    background-color: color-mix(in srgb, var(--primary), white 85%) !important;
    color: var(--primary) !important;
    border: 1px solid color-mix(in srgb, var(--primary), white 70%) !important;
}

.badge-soft-success {
    background-color: color-mix(in srgb, var(--success), white 85%) !important;
    color: var(--success) !important;
    border: 1px solid color-mix(in srgb, var(--success), white 70%) !important;
}

.badge-pill-custom {
    padding: 0.5em 1em;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Tabla de Activos Rediseñada */
#activos-table thead th {
    background-color: #f8fafc;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.table-thumbnail {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
}

/* Botones de acción compactos */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}
/* 
   ==========================================================================
   3. BARRA LATERAL (SIDEBAR) & FOOTER CARD
   ==========================================================================
   Con 'layout_fixed_sidebar' => true habilitado en adminlte.php,
   AdminLTE maneja el scroll. Solo fijamos el footer y damos espacio.
*/

.main-sidebar {
    /* El posicionamiento lo maneja AdminLTE (.layout-fixed) */
}

.sidebar .nav-sidebar {
    padding-bottom: 120px !important; /* Incrementado para asegurar visibilidad total */
}

/* 
   ==========================================================================
   3. BARRA LATERAL (SIDEBAR) & CUSTOM AREA NATIVO
   ==========================================================================
   Usamos '.sidebar-custom' de AdminLTE 3 para un área fija al fondo.
*/

.sidebar-custom {
    background: var(--dark-navy) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px 15px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-footer-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.sidebar-custom .btn-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
}

.sidebar-custom .btn-link:hover {
    color: #fff;
}

/* Ajuste del scroll para que no choque con el área fija */
.layout-fixed .main-sidebar .sidebar {
    height: calc(100% - (4rem + 1px) - 50px) !important; /* Ajustado a la nueva altura del custom area */
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.extra-small {
    font-size: 0.65rem;
    line-height: 1.2;
}
