<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<?php $empresa = $this->Controlador_model->get($this->empresa, 'empresa'); ?>
<?php if ($empresa->tipo == '0') { ?>
  <title><?= substr($empresa->nombre, 0, 18) ?></title>
<?php } else { ?>
  <title><?= substr($empresa->razonsocial, 0, 18) ?></title>
<?php } ?>

<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- jQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!-- jQuery Number Plugin -->
<script src="<?= base_url() . RECURSOS ?>js/jquery.number.js"></script>
<!-- jQuery UI 1.13.2 -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
<!-- jQuery AddClear Plugin -->
<script src="<?= base_url() . RECURSOS ?>js/addclear.min.js"></script>
<!-- Lobibox -->
<script src="<?= base_url() . RECURSOS ?>js/lobibox.js"></script>
<!-- SweetAlert2 -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Select2 -->
<script src="<?= base_url() . RECURSOS ?>assets/select2/select2.min.js"></script>
<!-- Theme style -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap4.min.css">
<!-- overlayScrollbars -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/overlayscrollbars/1.13.0/css/OverlayScrollbars.min.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.14/vue.min.js"></script>
<!-- <script type="text/javascript" src="<?= base_url() . RECURSOS ?>js/loading.js"></script> -->

<!-- Select 2 style -->
<link href="<?= base_url() . RECURSOS ?>assets/select2/select2.css" rel="stylesheet" type="text/css" />

<!-- Custom CSS - Deshabilitado para evitar conflictos con el tema anterior -->
<!-- <link href="<?= base_url() . RECURSOS ?>css/Style-Light.css" rel="stylesheet"> -->
<link href="<?= base_url() . RECURSOS ?>css/Style-Light-Modern.css?v=<?= time() ?>" rel="stylesheet">
<link rel="stylesheet" href="<?= base_url() . RECURSOS ?>dist/css/lobibox.min.css" />

<style>
    /* Estilos base de AdminLTE 3 */
    .main-sidebar { background-color: #343a40 !important; }
    .nav-sidebar .nav-link.active { background-color: #007bff !important; color: #fff !important; }
    
    /* Forzar visibilidad y eliminar bloqueos del tema anterior */
    .content-wrapper { 
        background-color: #f4f6f9 !important; 
        min-height: 100vh !important;
        z-index: 1 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    /* Eliminar cualquier overlay o blur que venga del tema viejo */
    body, .wrapper, .content-wrapper, .main-header, .main-sidebar { 
        filter: none !important;
        -webkit-filter: none !important;
        background-image: none !important;
    }

    /* Ocultar loaders antiguos que bloquean la vista */
    .loader, #loadingimg, .preloader, .sweet-overlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    body::after, body::before, .wrapper::after, .wrapper::before {
        display: none !important;
    }

    /* Asegurar que el texto sea visible */
    body {
        color: #212529 !important;
        background-color: #f4f6f9 !important;
    }
    /* Estilos para el Autocomplete de jQuery UI */
    .ui-autocomplete {
        z-index: 9999 !important;
        border: none !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
        padding: 8px 0 !important;
        background: #fff !important;
    }
    .ui-menu-item {
        padding: 8px 20px !important;
        font-size: 14px !important;
        color: #444 !important;
        cursor: pointer !important;
    }
    .ui-state-active, .ui-widget-content .ui-state-active {
        background: #007bff !important;
        color: #fff !important;
        border: none !important;
        margin: 0 !important;
    }
    .form-control:focus {
        border-color: #2563eb !important;
        background-color: #fff !important;
        outline: none !important;
    }
</style>

<!-- favicon -->
<link rel="icon" type="image/png" href="<?= base_url() ?>assets/adminlte/logo/logo.png">
<link rel="shortcut icon" href="<?= base_url() ?>assets/adminlte/logo/logo.png">

<!-- Material Switch -->
<link href="<?= base_url() . RECURSOS ?>css/material-switch.css" rel="stylesheet" />

<script>
  // Manejador global para ocultar imágenes rotas (404)
  document.addEventListener('error', function (event) {
    if (event.target.tagName.toLowerCase() !== 'img') return;
    event.target.style.display = 'none';
  }, true);
</script>