<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="ZLETS - Sistema de Control de Letras para JW DIESEL S.A.C.">
    <title><?= htmlspecialchars($pageTitle ?? 'Dashboard') ?> | ZLETS - JW DIESEL</title>
    
    <!-- Favicon -->
    <link rel="icon" href="<?= BASE_URL ?>favicon.png" type="image/png">

    <!-- Google Fonts: Sora (títulos) + Inter (texto) -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sora:wght@400;600;700;800&display=swap" rel="stylesheet">

    <!-- Tailwind CSS CDN -->
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    fontFamily: {
                        sora: ['Sora', 'sans-serif'],
                        inter: ['Inter', 'sans-serif'],
                    },
                    colors: {
                        primary: {
                            50: '#eef2ff',
                            100: '#dbe4ff',
                            200: '#bfcfff',
                            300: '#93aeff',
                            400: '#6384fc',
                            500: '#3d5af5',
                            600: '#2a3dea',
                            700: '#232ed7',
                            800: '#2228ae',
                            900: '#212789',
                            950: '#161854',
                        },
                        surface: {
                            50: '#f8fafc',
                            100: '#f1f5f9',
                            200: '#e2e8f0',
                            800: '#1e2a3a',
                            850: '#172033',
                            900: '#0f172a',
                            950: '#0a0f1e',
                        }
                    }
                }
            }
        }
    </script>

    <!-- SweetAlert2 -->
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

    <!-- Chart.js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4"></script>

    <!-- Tom Select -->
    <link href="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/css/tom-select.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/js/tom-select.complete.min.js"></script>

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">

    <!-- jQuery (requerido por DataTables) -->
    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

    <!-- DataTables -->
    <link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css">
    <script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>

    <!-- Custom Styles -->
    <link rel="stylesheet" href="<?= BASE_URL ?>assets/css/styles.css">

    <!-- Theme Initialization Script -->
    <script>
        // Check localStorage for theme preference before rendering to prevent FOUC
        if (localStorage.getItem('theme') === 'light') {
            document.documentElement.classList.add('light-theme');
        }
    </script>
</head>
<body class="font-inter bg-surface-950 text-gray-200 min-h-screen">

    <!-- Main Wrapper -->
    <div class="flex min-h-screen" id="app-wrapper">
