<?php
session_start();
$host = 'localhost';
$db = 'trabajadores';
$username = 'root';
$password = 'root';

if (!isset($_SESSION['usuario'])) {
    header("Location: index.html");
    exit;
}

try {
    $conn = new mysqli($host, $username, $password, $db);

    if ($conn->connect_error) {
        die("Conexión fallida: " . $conn->connect_error);
    }

    $usuario = $_SESSION['usuario'];

    $sql = "SELECT NOMBRE, ROL FROM personal WHERE USUARIO = '$usuario'";
    $result = $conn->query($sql);

    if ($result->num_rows > 0) {
        $row = $result->fetch_assoc();
        $nombre = $row['NOMBRE'];
        $rol = $row['ROL'];


        function obtenerIniciales($nombreCompleto)
        {
            $partes = explode(' ', $nombreCompleto);
            $iniciales = '';

            foreach ($partes as $parte) {
                if (!empty($parte)) {
                    $iniciales .= strtoupper($parte[0]);
                }
            }
            return $iniciales;
        }


        $inicialesUsuario = obtenerIniciales($nombre);
    } else {
        $nombre = "Usuario";
        $rol = "Usuario";
        $inicialesUsuario = "US";
    }

    $conn->close();
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>
<!DOCTYPE html>
<html lang="es" class="layout-navbar-fixed layout-compact layout-menu-fixed" dir="ltr" data-theme="theme-default" data-assets-path="../assets/" data-template="vertical-menu-template">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
    <title>Calendario</title>
    <meta name="description" content="" />
    <!-- Favicon -->
    <link rel="icon" type="image/x-icon" href="../assets/img/favicon/favicon.ico" />
    <!-- Fonts -->
    <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=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet" />

    <!-- Icons. Uncomment required icon fonts -->
    <link rel="stylesheet" href="../assets/vendor/fonts/boxicons.css" />

    <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap4.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
    <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
    <link rel="stylesheet" href="../css/estilosdetablas.css">
    <link rel="stylesheet" href="../css/botonesfiltros.css">
    <link rel="stylesheet" href="../css/botonexportar.css">


    <!-- Core CSS -->
    <link rel="stylesheet" href="../assets/vendor/css/core.css" class="template-customizer-core-css" />
    <link rel="stylesheet" href="../assets/vendor/css/theme-default.css" class="template-customizer-theme-css" />
    <link rel="stylesheet" href="../assets/css/demo.css" />

    <!-- Vendors CSS -->
    <link rel="stylesheet" href="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />

    <link rel="stylesheet" href="../assets/vendor/libs/apex-charts/apex-charts.css" />
    <link rel="stylesheet" href="https://demos.themeselection.com/sneat-bootstrap-html-admin-template/assets/vendor/libs/apex-charts/apex-charts.css" />



    <!-- Page CSS -->
     <link rel="stylesheet" href="https://demos.themeselection.com/sneat-bootstrap-html-admin-template/assets/vendor/css/pages/app-calendar.css" />

    <!-- Helpers -->
    <script src="../assets/vendor/js/helpers.js"></script>
    <script src="../assets/js/config.js"></script>



    <!-- Animate.css -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">

    <style>
        .wow {
            visibility: hidden;
        }

        #productList li,
        #productList li * {
            cursor: auto !important;
        }

        #servicioList li,
        #servicioList li * {
            cursor: auto !important;
        }

        #clienteList li,
        #clienteList li * {
            cursor: auto !important
        }

        #vendedorList li,
        #clienteList li * {
            cursor: auto !important
        }
    </style>

</head>

<body>
    <!-- Layout wrapper -->
    <div class="layout-wrapper layout-content-navbar">
        <div class="layout-container">
            <!-- Menu -->

            <aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
                <div class="app-brand demo">
                    <a href="index.html" class="app-brand-link">
                        <span class="app-brand-logo demo">
                            <svg
                                version="1.1"
                                xmlns="http://www.w3.org/2000/svg"
                                xmlns:xlink="http://www.w3.org/1999/xlink"
                                x="0px"
                                y="0px"
                                viewBox="0 0 2000 2000"
                                style="enable-background:new 0 0 2000 2000;"
                                xml:space="preserve"
                                width="100"
                                height="100">
                                <style type="text/css">
                                    .st0 {
                                        display: none;
                                    }

                                    .st1 {
                                        fill: #009DFF;
                                    }
                                </style>
                                <g id="Capa_1" class="st0">
                                    <image style="display:inline;overflow:visible;" width="2550" height="1558" transform="matrix(1 0 0 1 494.3726 289.1373)"></image>
                                </g>
                                <g id="Capa_2">
                                    <g>
                                        <rect x="183.89" y="18.31" class="st1" width="1632.23" height="526.02" />
                                        <polygon class="st1" points="1031.3,1629.99 1031.3,1711.86 1308.44,1711.86 1308.44,1825.3 1031.3,1825.3 1031.3,1907.13 1308.44,1907.13 1308.44,1981.69 691.56,1981.69 691.56,682.4 1308.44,682.4 1308.44,1629.99" />
                                    </g>
                                </g>
                                <g id="Capa_3" class="st0"></g>
                            </svg>
                        </span>
                        <span class="app-brand-text demo menu-text fw-bolder ms-2">Trax</span>
                    </a>


                    <a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto d-block d-xl-none">
                        <i class="bx bx-chevron-left bx-sm align-middle"></i>
                    </a>
                </div>

                <div class="menu-inner-shadow"></div>

                <ul class="menu-inner py-1">



                    <!-- Layouts -->
                    <li class="menu-item active open">


                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-layout"></i>
                            <div data-i18n="Layouts">Inicio</div>
                        </a>

                        <ul class="menu-sub ">
                            <li class="menu-item active">
                                <a href="tablero.php" class="menu-link">
                                    <div data-i18n="Without menu">Tablero</div>
                                </a>
                            </li>
                            <!--

                            <li class="menu-item">
                                <a href="nuevo_cliente.php" class="menu-link">
                                    <div data-i18n="Without navbar">Agregar Cliente</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="nuevo_proveedor.php" class="menu-link">
                                    <div data-i18n="Container">Agregar Proveedor</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="nueva_cotizacion.php" class="menu-link">
                                    <div data-i18n="Fluid">Agregar Cotizacion</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="nuevo_producto.php" class="menu-link">
                                    <div data-i18n="Blank">Agregar Producto</div>
                                </a>
                            </li>

                            <li class="menu-item">
                                <a href="nueva_compra.php" class="menu-link">
                                    <div data-i18n="Blank">Agregar Compra</div>
                                </a>
                            </li>

                            <li class="menu-item">
                                <a href="nueva_factura.php" class="menu-link">
                                    <div data-i18n="Blank">Agregar Factura</div>
                                </a>
                            </li>
                                -->
                        </ul>
                    </li>

                    <li class="menu-header small text-uppercase">
                        <span class="menu-header-text">Aspel SAE</span>
                    </li>
                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-line-chart"></i>
                            <div data-i18n="Account Settings">Ventas</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item ">
                                <a href="facturas.php" class="menu-link">
                                    <div data-i18n="Account">Facturas</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="notasdeventa.php" class="menu-link">
                                    <div data-i18n="Notifications">Notas de Venta</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="trasladoscartaporte.php" class="menu-link">
                                    <div data-i18n="Connections">Carta Porte</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="remisiones.php" class="menu-link">
                                    <div data-i18n="Connections">Remisiones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="pedidos.php" class="menu-link">
                                    <div data-i18n="Connections">Pedidos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="cotizaciones.php" class="menu-link">
                                    <div data-i18n="Connections">Cotizaciones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="devoluciones.php" class="menu-link">
                                    <div data-i18n="Connections">Devoluciones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="notasdecredito.php" class="menu-link">
                                    <div data-i18n="Connections">Notas de Crédito</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="parcialidades.php" class="menu-link">
                                    <div data-i18n="Connections">Parcialidades</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="comprobantesdepago.php" class="menu-link">
                                    <div data-i18n="Connections">Comprobantes</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="estadisticas.php" class="menu-link">
                                    <div data-i18n="Connections">Estadisticas</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="estadisticascli.php" class="menu-link">
                                    <div data-i18n="Connections">Ventas X Cliente</div>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-user"></i>
                            <div data-i18n="Authentications">Clientes</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="clientes.php" class="menu-link">
                                    <div data-i18n="Basic">Clientes</div>
                                </a>
                            </li>
                            <li class="menu-item ">
                                <a href="correos.php" class="menu-link">
                                    <div data-i18n="Basic">Correos</div>
                                </a>
                            </li>

                            <li class="menu-item">
                                <a href="cuentasxcobrar.php" class="menu-link">
                                    <div data-i18n="Basic">Cuentas X Cobrar</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="clientespoliza.php" class="menu-link">
                                    <div data-i18n="Basic">Clientes con Póliza</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="clientestimbres.php" class="menu-link">
                                    <div data-i18n="ClientStamps">Clientes Timbres</div>
                                </a>
                            </li>

                            <li class="menu-item">
                                <a href="clientesistemas.php" class="menu-link">
                                    <div data-i18n="ClientSystems">Clientes Sistemas</div>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-package"></i>
                            <div data-i18n="Misc">Inventarios</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="productos.php" class="menu-link">
                                    <div data-i18n="Error">Productos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="existencias.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Existencias</div>
                                </a>
                            </li>
                        </ul>
                    </li>


                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-shopping-bag"></i>
                            <div data-i18n="Misc">Compras</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="compras.php" class="menu-link">
                                    <div data-i18n="Error">Compras</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="recepciones.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Recepciones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="ordenes.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Ordenes</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="requisiciones.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Requisiciones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="devolucionescom.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Devoluciones</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="estadisticasprove.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Compras X Proveedor</div>
                                </a>
                            </li>
                        </ul>
                    </li>


                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-group"></i>
                            <div data-i18n="Misc">Proveedores</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="proveedores.php" class="menu-link">
                                    <div data-i18n="Error">Proveedores</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="cuentasxpagar.php" class="menu-link">
                                    <div data-i18n="Under Maintenance">Cuentas X Pagar</div>
                                </a>
                            </li>
                        </ul>
                    </li>


                    <!-- Aspel COI -->
                    <li class="menu-header small text-uppercase"><span class="menu-header-text">Aspel COI</span></li>

                    <!-- Extended components -->
                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-copy"></i>
                            <div data-i18n="Extended UI">Cuentas y Pólizas</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="cuentas.php" class="menu-link">
                                    <div data-i18n="Perfect Scrollbar">Cuentas</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="polizas.php" class="menu-link">
                                    <div data-i18n="Text Divider">Pólizas</div>
                                </a>
                            </li>
                            <li class="menu-item ">
                                <a href="activos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Activos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="auxiliares.php" class="menu-link">
                                    <div data-i18n="Text Divider">Auxiliares</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="presupuestos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Presupuestos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="presupuestosPD.php" class="menu-link">
                                    <div data-i18n="Text Divider">Presupuestos DP</div>
                                </a>
                            </li>
                            <li class="menu-item ">
                                <a href="monedas.php" class="menu-link">
                                    <div data-i18n="Text Divider">Monedas</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="departamentos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Departamentos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="otrosimpuestos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Otros Impuestos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="activosgenerales.php" class="menu-link">
                                    <div data-i18n="Text Divider">Activos Generales</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="saldos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Saldos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="saldosDP.php" class="menu-link">
                                    <div data-i18n="Text Divider">Saldos DP</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="rubros.php" class="menu-link">
                                    <div data-i18n="Text Divider">Rubros</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="ccostos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Centro de Costos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="concepto.php" class="menu-link">
                                    <div data-i18n="Text Divider">Conceptos</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="regpol.php" class="menu-link">
                                    <div data-i18n="Text Divider">Registro de Pólizas</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="impuestos.php" class="menu-link">
                                    <div data-i18n="Text Divider">Impuestos</div>
                                </a>
                            </li>
                            <li class="menu-item ">
                                <a href="timbres.php" class="menu-link">
                                    <div data-i18n="Text Divider">Timbres</div>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- Aspel BANCO -->
                    <li class="menu-header small text-uppercase"><span class="menu-header-text">Aspel BANCO</span></li>
                    <!-- Forms -->
                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-credit-card"></i>
                            <div data-i18n="Form Elements">Movimientos</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item ">
                                <a href="movimientos.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Movimientos</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="moneda.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Moneda</div>
                                </a>

                            </li>
                            <li class="menu-item ">
                                <a href="beneficiosxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Beneficios</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="cuentasxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Cuentas ban</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="formadepagoxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Forma de pago</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="parametrosxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Partidas de movimientos</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="comprobantedeldocumentoxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Comprobante del documento</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="centrodecuentasxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Conceptos de movimientos</div>
                                </a>

                            </li>
                            <li class="menu-item">
                                <a href="historialxban.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Historial</div>
                                </a>

                            </li>
                        </ul>
                    </li>
                    <li class="menu-header small text-uppercase">
                        <span class="menu-header-text">Mantenimiento y Soporte</span>
                    </li>
                    <li class="menu-item">
                        <a href="#" class="menu-link menu-toggle">
                            <i class="menu-icon tf-icons bx bx-credit-card"></i>
                            <div data-i18n="Form Elements">Mantenimiento</div>
                        </a>
                        <ul class="menu-sub">
                            <li class="menu-item">
                                <a href="ordenservicio.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Ordenes de Servicio</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="registrossemana.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Registros</div>
                                </a>
                            </li>
                            <li class="menu-item">
                                <a href="estadisticasord.php" class="menu-link">
                                    <div data-i18n="Basic Inputs">Estadisticas</div>
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </aside>
            <!-- / Menu -->

            <!-- Layout container -->
            <div class="layout-page">
                <!-- Navbar -->
                <nav class="layout-navbar container-xxl navbar-detached navbar navbar-expand-xl align-items-center bg-navbar-theme" id="layout-navbar">
                    <div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
                        <a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
                            <i class="bx bx-menu bx-sm"></i>
                        </a>
                    </div>

                    <div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
                        <!-- Search -->
                        <div class="navbar-nav align-items-center">
                            <div class="nav-item d-flex align-items-center">
                                <i class="bx bx-search fs-4 lh-0"></i>
                                <input
                                    type="text"
                                    class="form-control border-0 shadow-none"
                                    placeholder="Buscar..."
                                    data-bs-toggle="modal"
                                    data-bs-target="#modalBusqueda" />

                                <!-- Resultados -->
                                <ul id="searchResults" class="list-group search-dropdown"></ul>
                            </div>
                        </div>
                        <style>
                            /* Estilos para el desplegable */
                            .search-dropdown {
                                position: absolute;
                                top: 100%;
                                left: 0;
                                right: 0;
                                z-index: 9999;
                                margin-top: 0.2rem;
                                background: white;
                                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
                                border-radius: 0.25rem;
                                overflow-y: auto;
                                max-height: 300px;
                            }

                            .search-dropdown li {
                                cursor: pointer;
                            }

                            .search-dropdown li:hover {
                                background-color: #f0f0f0;
                            }
                        </style>

                        <!-- /Search -->

                        <ul class="navbar-nav flex-row align-items-center ms-auto">


                            <!-- icono de idioma  -->
                            <li class="nav-item dropdown-language dropdown me-2 me-xl-0">
                                <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown" aria-expanded="false">
                                    <i class="icon-base bx bx-globe icon-md"></i>
                                </a>
                                <ul class="dropdown-menu dropdown-menu-end" data-bs-popper="static">
                                    <li>
                                        <a class="dropdown-item active" href="javascript:void(0);" data-language="en" data-text-direction="ltr">
                                            <span>English</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item" href="javascript:void(0);" data-language="fr" data-text-direction="ltr">
                                            <span>French</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item" href="javascript:void(0);" data-language="ar" data-text-direction="rtl">
                                            <span>Arabic</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item" href="javascript:void(0);" data-language="de" data-text-direction="ltr">
                                            <span>German</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>


                            <!-- Icono de modo oscuro -->
                            <li class="nav-item dropdown me-2 me-xl-0">
                                <a class="nav-link dropdown-toggle hide-arrow" id="nav-theme" href="javascript:void(0);" data-bs-toggle="dropdown" aria-label="Toggle theme (light)">
                                    <i class="bx-sun icon-base bx icon-md theme-icon-active"></i>
                                    <span class="d-none ms-2" id="nav-theme-text">Toggle theme</span>
                                </a>


                                <!-- Submenu de modo oscuro -->
                                <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-theme-text" data-bs-popper="static">
                                    <li>
                                        <button type="button" class="dropdown-item align-items-center active" data-bs-theme-value="light" aria-pressed="true">
                                            <span>
                                                <i class="icon-base bx bx-sun icon-md me-3" data-icon="sun"></i>Claro
                                            </span>
                                        </button>
                                    </li>

                                    <li>
                                        <button type="button" class="dropdown-item align-items-center" data-bs-theme-value="dark" aria-pressed="false">
                                            <span>
                                                <i class="icon-base bx bx-moon icon-md me-3" data-icon="moon"></i>Oscuro
                                            </span>
                                        </button>
                                    </li>

                                    <li>
                                        <button type="button" class="dropdown-item align-items-center" data-bs-theme-value="system" aria-pressed="false">
                                            <span>
                                                <i class="icon-base bx bx-desktop icon-md me-3" data-icon="desktop"></i>Dispositivo
                                            </span>
                                        </button>
                                    </li>

                                </ul>
                                <!-- Aquí termina submenu -->
                            </li>


                            <li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
                                <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
                                    <i class="icon-base bx bx-grid-alt icon-md"></i>
                                </a>
                                <!-- submenu -->
                                <div class="dropdown-menu dropdown-menu-end p-0">
                                    <div class="dropdown-menu-header border-bottom">
                                        <div class="dropdown-header d-flex align-items-center py-3">
                                            <h6 class="mb-0 me-auto">Shortcuts</h6>
                                            <a href="javascript:void(0)" class="dropdown-shortcuts-add py-2" data-bs-toggle="tooltip" data-bs-placement="top" aria-label="Add shortcuts" data-bs-original-title="Add shortcuts"><i class="icon-base bx bx-plus-circle text-heading"></i></a>
                                        </div>
                                    </div>
                                    <div class="dropdown-shortcuts-list scrollable-container ps">
                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-calendar icon-26px text-heading"></i>
                                                </span>
                                                <a href="app-calendar.html" class="stretched-link">Calendar</a>
                                                <small>Appointments</small>
                                            </div>
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-food-menu icon-26px text-heading"></i>
                                                </span>
                                                <a href="app-invoice-list.html" class="stretched-link">Invoice App</a>
                                                <small>Manage Accounts</small>
                                            </div>
                                        </div>
                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-user icon-26px text-heading"></i>
                                                </span>
                                                <a href="app-user-list.html" class="stretched-link">User App</a>
                                                <small>Manage Users</small>
                                            </div>
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-check-shield icon-26px text-heading"></i>
                                                </span>
                                                <a href="app-access-roles.html" class="stretched-link">Role Management</a>
                                                <small>Permission</small>
                                            </div>
                                        </div>
                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-pie-chart-alt-2 icon-26px text-heading"></i>
                                                </span>
                                                <a href="index.html" class="stretched-link">Dashboard</a>
                                                <small>User Dashboard</small>
                                            </div>
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-cog icon-26px text-heading"></i>
                                                </span>
                                                <a href="pages-account-settings-account.html" class="stretched-link">Setting</a>
                                                <small>Account Settings</small>
                                            </div>
                                        </div>
                                        <div class="row row-bordered overflow-visible g-0">
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-help-circle icon-26px text-heading"></i>
                                                </span>
                                                <a href="pages-faq.html" class="stretched-link">FAQs</a>
                                                <small>FAQs &amp; Articles</small>
                                            </div>
                                            <div class="dropdown-shortcuts-item col">
                                                <span class="dropdown-shortcuts-icon rounded-circle mb-3">
                                                    <i class="icon-base bx bx-window-open icon-26px text-heading"></i>
                                                </span>
                                                <a href="modal-examples.html" class="stretched-link">Modals</a>
                                                <small>Useful Popups</small>
                                            </div>
                                        </div>
                                        <div class="ps__rail-x" style="left: 0px; bottom: 0px;">
                                            <div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div>
                                        </div>
                                        <div class="ps__rail-y" style="top: 0px; right: 0px;">
                                            <div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 0px;"></div>
                                        </div>
                                    </div>
                                </div>
                                <!-- aqui termina submenu -->

                            </li>

                            <li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-2">
                                <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
                                    <span class="position-relative">
                                        <i class="icon-base bx bx-bell icon-md"></i>
                                        <span class="badge rounded-pill bg-danger badge-dot badge-notifications border"></span>
                                    </span>
                                </a>

                                <!--empiezan las notificaciones -->
                                <ul class="dropdown-menu dropdown-menu-end p-0">
                                    <li class="dropdown-menu-header border-bottom">
                                        <div class="dropdown-header d-flex align-items-center py-3">
                                            <h6 class="mb-0 me-auto">Notification</h6>
                                            <div class="d-flex align-items-center h6 mb-0">
                                                <span class="badge bg-label-primary me-2">8 New</span>
                                                <a href="javascript:void(0)" class="dropdown-notifications-all p-2" data-bs-toggle="tooltip" data-bs-placement="top" aria-label="Mark all as read" data-bs-original-title="Mark all as read"><i class="icon-base bx bx-envelope-open text-heading"></i></a>
                                            </div>
                                        </div>
                                    </li>


                                    <li class="dropdown-notifications-list scrollable-container ps">
                                        <ul class="list-group list-group-flush">
                                            <li class="list-group-item list-group-item-action dropdown-notifications-item">
                                                <div class="d-flex">
                                                    <div class="flex-shrink-0 me-3">
                                                        <div class="avatar">
                                                            <img src="../../assets/img/avatars/1.png" alt="" class="rounded-circle">
                                                        </div>
                                                    </div>
                                                    <div class="flex-grow-1">
                                                        <h6 class="small mb-0">Congratulation Lettie 🎉</h6>
                                                        <small class="mb-1 d-block text-body">Won the monthly best seller gold badge</small>
                                                        <small class="text-body-secondary">1h ago</small>
                                                    </div>
                                                    <div class="flex-shrink-0 dropdown-notifications-actions">
                                                        <a href="javascript:void(0)" class="dropdown-notifications-read"><span class="badge badge-dot"></span></a>
                                                        <a href="javascript:void(0)" class="dropdown-notifications-archive"><span class="icon-base bx bx-x"></span></a>
                                                    </div>
                                                </div>
                                            </li>
                                            <li class="list-group-item list-group-item-action dropdown-notifications-item">
                                                <div class="d-flex">
                                                    <div class="flex-shrink-0 me-3">
                                                        <div class="avatar">
                                                            <span class="avatar-initial rounded-circle bg-label-danger">CF</span>
                                                        </div>
                                                    </div>
                                                    <div class="flex-grow-1">
                                                        <h6 class="small mb-0">Charles Franklin</h6>
                                                        <small class="mb-1 d-block text-body">Accepted your connection</small>
                                                        <small class="text-body-secondary">12hr ago</small>
                                                    </div>
                                                    <div class="flex-shrink-0 dropdown-notifications-actions">
                                                        <a href="javascript:void(0)" class="dropdown-notifications-read"><span class="badge badge-dot"></span></a>
                                                        <a href="javascript:void(0)" class="dropdown-notifications-archive"><span class="icon-base bx bx-x"></span></a>
                                                    </div>
                                                </div>
                                            </li>
                                            <li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
                                                <div class="d-flex">
                                                    <div class="flex-shrink-0 me-3">
                                                        <div class="avatar">
                                                            <img src="../../assets/img/avatars/2.png" alt="" class="rounded-circle">
                                                        </div>
                                                    </div>
                                                    <div class="flex-grow-1">
                                                        <h6 class="small mb-0">New Message ✉️</h6>
                                                        <small class="mb-1 d-block text-body">You have new message from Natalie</small>
                                                        <small class="text-body-secondary">1h ago</small>
                                                    </div>
                                                    <div class="flex-shrink-0 dropdown-notifications-actions">
                                                        <a href="javascript:void(0)" class="dropdown-notifications-read"><span class="badge badge-dot"></span></a>
                                                        <a href="javascript:void(0)" class="dropdown-notifications-archive"><span class="icon-base bx bx-x"></span></a>
                                                    </div>
                                                </div>
                                            </li>
                                        </ul>

                                        <div class="ps__rail-x" style="left: 0px; bottom: 0px;">
                                            <div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div>
                                        </div>
                                        <div class="ps__rail-y" style="top: 0px; right: 0px;">
                                            <div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 0px;"></div>
                                        </div>
                                    </li>

                                    <li class="border-top">
                                        <div class="d-grid p-4">
                                            <a class="btn btn-primary btn-sm d-flex" href="javascript:void(0);">
                                                <small class="align-middle">View all notifications</small>
                                            </a>
                                        </div>
                                    </li>
                                </ul> <!-- termina submenu de notificaciones -->
                            </li>



                            <!-- User -->
                            <li class="nav-item navbar-dropdown dropdown-user dropdown">
                                <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown">
                                    <div class="avatar avatar-online">
                                        <span class="avatar-initial rounded-circle bg-label-primary"><?php echo htmlspecialchars($inicialesUsuario); ?></span>
                                    </div>
                                </a>
                                <ul class="dropdown-menu dropdown-menu-end">
                                    <li>
                                        <a class="dropdown-item" href="#">
                                            <div class="d-flex">
                                                <div class="flex-shrink-0 me-3">
                                                    <div class="avatar avatar-online">
                                                        <span class="avatar-initial rounded-circle bg-label-primary"><?php echo htmlspecialchars($inicialesUsuario); ?></span>
                                                    </div>
                                                </div>
                                                <div class="flex-grow-1">
                                                    <span class="fw-semibold d-block"><?php echo htmlspecialchars($nombre); ?></span>
                                                    <small class="text-muted"><?php echo htmlspecialchars($rol); ?></small>
                                                </div>
                                            </div>
                                        </a>
                                    </li>
                                    <li>
                                        <div class="dropdown-divider"></div>
                                    </li>
                                    <li>
                                        <a class="dropdown-item" href="index.html">
                                            <i class="bx bx-power-off me-2"></i>
                                            <span class="align-middle">Cerrar Sesión</span>
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <!--/ User -->


                        </ul>


                    </div>
                </nav>
                <!-- / Navbar -->




                <!-- Content wrapper -->
                <div class="content-wrapper">
                    <!-- Content -->
                    <div class="container-xxl flex-grow-1 container-p-y">
                        
<div class="card app-calendar-wrapper">
    <div class="row g-0">
      <!-- Calendar Sidebar -->
      <div class="col app-calendar-sidebar border-end" id="app-calendar-sidebar">
        <div class="border-bottom p-6 my-sm-0 mb-4">
          <button class="btn btn-primary btn-toggle-sidebar w-100" data-bs-toggle="offcanvas" data-bs-target="#addEventSidebar" aria-controls="addEventSidebar">
            <i class="icon-base bx bx-plus icon-16px me-2"></i>
            <span class="align-middle">Add Event</span>
          </button>
        </div>
        <div class="px-3 pt-2">
          <!-- inline calendar (flatpicker) -->
          <div class="flatpickr-wrapper"><div class="inline-calendar flatpickr-input" readonly="readonly"></div><div class="flatpickr-calendar animate inline" tabindex="-1"><div class="flatpickr-months"><span class="flatpickr-prev-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z"></path></svg></span><div class="flatpickr-month"><div class="flatpickr-current-month"><span class="cur-month">September </span><div class="numInputWrapper"><input class="numInput cur-year" type="number" tabindex="-1" aria-label="Year"><span class="arrowUp"></span><span class="arrowDown"></span></div></div></div><span class="flatpickr-next-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z"></path></svg></span></div><div class="flatpickr-innerContainer"><div class="flatpickr-rContainer"><div class="flatpickr-weekdays"><div class="flatpickr-weekdaycontainer">
      <span class="flatpickr-weekday">
        Sun</span><span class="flatpickr-weekday">Mon</span><span class="flatpickr-weekday">Tue</span><span class="flatpickr-weekday">Wed</span><span class="flatpickr-weekday">Thu</span><span class="flatpickr-weekday">Fri</span><span class="flatpickr-weekday">Sat
      </span>
      </div></div><div class="flatpickr-days" tabindex="-1"><div class="dayContainer"><span class="flatpickr-day prevMonthDay" aria-label="August 31, 2025" tabindex="-1">31</span><span class="flatpickr-day" aria-label="September 1, 2025" tabindex="-1">1</span><span class="flatpickr-day" aria-label="September 2, 2025" tabindex="-1">2</span><span class="flatpickr-day today" aria-label="September 3, 2025" aria-current="date" tabindex="-1">3</span><span class="flatpickr-day" aria-label="September 4, 2025" tabindex="-1">4</span><span class="flatpickr-day" aria-label="September 5, 2025" tabindex="-1">5</span><span class="flatpickr-day" aria-label="September 6, 2025" tabindex="-1">6</span><span class="flatpickr-day" aria-label="September 7, 2025" tabindex="-1">7</span><span class="flatpickr-day" aria-label="September 8, 2025" tabindex="-1">8</span><span class="flatpickr-day" aria-label="September 9, 2025" tabindex="-1">9</span><span class="flatpickr-day" aria-label="September 10, 2025" tabindex="-1">10</span><span class="flatpickr-day" aria-label="September 11, 2025" tabindex="-1">11</span><span class="flatpickr-day" aria-label="September 12, 2025" tabindex="-1">12</span><span class="flatpickr-day" aria-label="September 13, 2025" tabindex="-1">13</span><span class="flatpickr-day" aria-label="September 14, 2025" tabindex="-1">14</span><span class="flatpickr-day" aria-label="September 15, 2025" tabindex="-1">15</span><span class="flatpickr-day" aria-label="September 16, 2025" tabindex="-1">16</span><span class="flatpickr-day" aria-label="September 17, 2025" tabindex="-1">17</span><span class="flatpickr-day" aria-label="September 18, 2025" tabindex="-1">18</span><span class="flatpickr-day" aria-label="September 19, 2025" tabindex="-1">19</span><span class="flatpickr-day" aria-label="September 20, 2025" tabindex="-1">20</span><span class="flatpickr-day" aria-label="September 21, 2025" tabindex="-1">21</span><span class="flatpickr-day" aria-label="September 22, 2025" tabindex="-1">22</span><span class="flatpickr-day" aria-label="September 23, 2025" tabindex="-1">23</span><span class="flatpickr-day" aria-label="September 24, 2025" tabindex="-1">24</span><span class="flatpickr-day" aria-label="September 25, 2025" tabindex="-1">25</span><span class="flatpickr-day" aria-label="September 26, 2025" tabindex="-1">26</span><span class="flatpickr-day" aria-label="September 27, 2025" tabindex="-1">27</span><span class="flatpickr-day" aria-label="September 28, 2025" tabindex="-1">28</span><span class="flatpickr-day" aria-label="September 29, 2025" tabindex="-1">29</span><span class="flatpickr-day" aria-label="September 30, 2025" tabindex="-1">30</span><span class="flatpickr-day nextMonthDay" aria-label="October 1, 2025" tabindex="-1">1</span><span class="flatpickr-day nextMonthDay" aria-label="October 2, 2025" tabindex="-1">2</span><span class="flatpickr-day nextMonthDay" aria-label="October 3, 2025" tabindex="-1">3</span><span class="flatpickr-day nextMonthDay" aria-label="October 4, 2025" tabindex="-1">4</span><span class="flatpickr-day nextMonthDay" aria-label="October 5, 2025" tabindex="-1">5</span><span class="flatpickr-day nextMonthDay" aria-label="October 6, 2025" tabindex="-1">6</span><span class="flatpickr-day nextMonthDay" aria-label="October 7, 2025" tabindex="-1">7</span><span class="flatpickr-day nextMonthDay" aria-label="October 8, 2025" tabindex="-1">8</span><span class="flatpickr-day nextMonthDay" aria-label="October 9, 2025" tabindex="-1">9</span><span class="flatpickr-day nextMonthDay" aria-label="October 10, 2025" tabindex="-1">10</span><span class="flatpickr-day nextMonthDay" aria-label="October 11, 2025" tabindex="-1">11</span></div></div></div></div></div></div>
        </div>
        <hr class="mb-6 mx-n4 mt-3">
        <div class="px-6 pb-2">
          <!-- Filter -->
          <div>
            <h5>Event Filters</h5>
          </div>

          <div class="form-check form-check-secondary mb-5 ms-2">
            <input class="form-check-input select-all" type="checkbox" id="selectAll" data-value="all" checked="">
            <label class="form-check-label" for="selectAll">View All</label>
          </div>

          <div class="app-calendar-events-filter text-heading">
            <div class="form-check form-check-danger mb-5 ms-2">
              <input class="form-check-input input-filter" type="checkbox" id="select-personal" data-value="personal" checked="">
              <label class="form-check-label" for="select-personal">Personal</label>
            </div>
            <div class="form-check mb-5 ms-2">
              <input class="form-check-input input-filter" type="checkbox" id="select-business" data-value="business" checked="">
              <label class="form-check-label" for="select-business">Business</label>
            </div>
            <div class="form-check form-check-warning mb-5 ms-2">
              <input class="form-check-input input-filter" type="checkbox" id="select-family" data-value="family" checked="">
              <label class="form-check-label" for="select-family">Family</label>
            </div>
            <div class="form-check form-check-success mb-5 ms-2">
              <input class="form-check-input input-filter" type="checkbox" id="select-holiday" data-value="holiday" checked="">
              <label class="form-check-label" for="select-holiday">Holiday</label>
            </div>
            <div class="form-check form-check-info ms-2">
              <input class="form-check-input input-filter" type="checkbox" id="select-etc" data-value="etc" checked="">
              <label class="form-check-label" for="select-etc">ETC</label>
            </div>
          </div>
        </div>
      </div>
      <!-- /Calendar Sidebar -->

      <!-- Calendar & Modal -->
      <div class="col app-calendar-content">
        <div class="card shadow-none border-0">
          <div class="card-body pb-0">
            <!-- FullCalendar -->
            <div id="calendar" class="fc fc-media-screen fc-direction-ltr fc-theme-standard"><div class="fc-header-toolbar fc-toolbar "><div class="fc-toolbar-chunk"><div class="fc-button-group"><button type="button" title="Sidebar" aria-pressed="false" class="fc-sidebarToggle-button fc-button d-lg-none d-inline-block ps-0" data-bs-toggle="sidebar" data-overlay="" data-target="#app-calendar-sidebar"><i class="icon-base bx bx-menu icon-lg text-heading"></i></button><button type="button" aria-pressed="false" class="fc--button fc-button fc-button-primary"></button></div><div class="fc-button-group"><button type="button" title="Previous month" aria-pressed="false" class="fc-prev-button fc-button fc-button-primary"><span class="fc-icon fc-icon-chevron-left" role="img"></span></button><button type="button" title="Next month" aria-pressed="false" class="fc-next-button fc-button fc-button-primary"><span class="fc-icon fc-icon-chevron-right" role="img"></span></button><button type="button" aria-pressed="false" class="fc--button fc-button fc-button-primary"></button></div><h2 class="fc-toolbar-title" id="fc-dom-1">September 2025</h2></div><div class="fc-toolbar-chunk"></div><div class="fc-toolbar-chunk"><div class="fc-button-group"><button type="button" title="month view" aria-pressed="true" class="fc-dayGridMonth-button fc-button fc-button-primary fc-button-active">month</button><button type="button" title="week view" aria-pressed="false" class="fc-timeGridWeek-button fc-button fc-button-primary">week</button><button type="button" title="day view" aria-pressed="false" class="fc-timeGridDay-button fc-button fc-button-primary">day</button><button type="button" title="list view" aria-pressed="false" class="fc-listMonth-button fc-button fc-button-primary">list</button></div></div></div><div aria-labelledby="fc-dom-1" class="fc-view-harness fc-view-harness-active" style="height: 604.444px;"><div class="fc-dayGridMonth-view fc-view fc-daygrid"><table role="grid" class="fc-scrollgrid  fc-scrollgrid-liquid"><thead role="rowgroup"><tr role="presentation" class="fc-scrollgrid-section fc-scrollgrid-section-header "><th role="presentation"><div class="fc-scroller-harness"><div class="fc-scroller" style="overflow: hidden;"><table role="presentation" class="fc-col-header " style="width: 816px;"><colgroup></colgroup><thead role="presentation"><tr role="row"><th role="columnheader" class="fc-col-header-cell fc-day fc-day-sun"><div class="fc-scrollgrid-sync-inner"><a aria-label="Sunday" class="fc-col-header-cell-cushion">Sun</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-mon"><div class="fc-scrollgrid-sync-inner"><a aria-label="Monday" class="fc-col-header-cell-cushion">Mon</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-tue"><div class="fc-scrollgrid-sync-inner"><a aria-label="Tuesday" class="fc-col-header-cell-cushion">Tue</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-wed"><div class="fc-scrollgrid-sync-inner"><a aria-label="Wednesday" class="fc-col-header-cell-cushion">Wed</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-thu"><div class="fc-scrollgrid-sync-inner"><a aria-label="Thursday" class="fc-col-header-cell-cushion">Thu</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-fri"><div class="fc-scrollgrid-sync-inner"><a aria-label="Friday" class="fc-col-header-cell-cushion">Fri</a></div></th><th role="columnheader" class="fc-col-header-cell fc-day fc-day-sat"><div class="fc-scrollgrid-sync-inner"><a aria-label="Saturday" class="fc-col-header-cell-cushion">Sat</a></div></th></tr></thead></table></div></div></th></tr></thead><tbody role="rowgroup"><tr role="presentation" class="fc-scrollgrid-section fc-scrollgrid-section-body  fc-scrollgrid-section-liquid"><td role="presentation"><div class="fc-scroller-harness fc-scroller-harness-liquid"><div class="fc-scroller fc-scroller-liquid-absolute" style="overflow: hidden auto;"><div class="fc-daygrid-body fc-daygrid-body-unbalanced " style="width: 816px;"><table role="presentation" class="fc-scrollgrid-sync-table" style="width: 816px; height: 610px;"><colgroup></colgroup><tbody role="presentation"><tr role="row"><td aria-labelledby="fc-dom-2" role="gridcell" data-date="2025-08-31" class="fc-day fc-day-sun fc-day-past fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to August 31, 2025" data-navlink="" tabindex="0" id="fc-dom-2" class="fc-daygrid-day-number">31</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-4" role="gridcell" data-date="2025-09-01" class="fc-day fc-day-mon fc-day-past fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 1, 2025" data-navlink="" tabindex="0" id="fc-dom-4" class="fc-daygrid-day-number">1</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-6" role="gridcell" data-date="2025-09-02" class="fc-day fc-day-tue fc-day-past fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 2, 2025" data-navlink="" tabindex="0" id="fc-dom-6" class="fc-daygrid-day-number">2</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-8" role="gridcell" data-date="2025-09-03" class="fc-day fc-day-wed fc-day-today fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 3, 2025" data-navlink="" tabindex="0" id="fc-dom-8" class="fc-daygrid-day-number">3</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-event-harness fc-daygrid-event-harness-abs" style="top: 0px; left: 0px; right: -116.562px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-start fc-event-end fc-event-today fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-primary"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-time">2:14p</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Design Review</div></div></div></div></a></div><div class="fc-daygrid-day-bottom" style="margin-top: 39px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-10" role="gridcell" data-date="2025-09-04" class="fc-day fc-day-thu fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 4, 2025" data-navlink="" tabindex="0" id="fc-dom-10" class="fc-daygrid-day-number">4</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 39px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-12" role="gridcell" data-date="2025-09-05" class="fc-day fc-day-fri fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 5, 2025" data-navlink="" tabindex="0" id="fc-dom-12" class="fc-daygrid-day-number">5</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-14" role="gridcell" data-date="2025-09-06" class="fc-day fc-day-sat fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 6, 2025" data-navlink="" tabindex="0" id="fc-dom-14" class="fc-daygrid-day-number">6</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr><tr role="row"><td aria-labelledby="fc-dom-16" role="gridcell" data-date="2025-09-07" class="fc-day fc-day-sun fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 7, 2025" data-navlink="" tabindex="0" id="fc-dom-16" class="fc-daygrid-day-number">7</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-18" role="gridcell" data-date="2025-09-08" class="fc-day fc-day-mon fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 8, 2025" data-navlink="" tabindex="0" id="fc-dom-18" class="fc-daygrid-day-number">8</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-20" role="gridcell" data-date="2025-09-09" class="fc-day fc-day-tue fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 9, 2025" data-navlink="" tabindex="0" id="fc-dom-20" class="fc-daygrid-day-number">9</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-22" role="gridcell" data-date="2025-09-10" class="fc-day fc-day-wed fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 10, 2025" data-navlink="" tabindex="0" id="fc-dom-22" class="fc-daygrid-day-number">10</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-24" role="gridcell" data-date="2025-09-11" class="fc-day fc-day-thu fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 11, 2025" data-navlink="" tabindex="0" id="fc-dom-24" class="fc-daygrid-day-number">11</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-26" role="gridcell" data-date="2025-09-12" class="fc-day fc-day-fri fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 12, 2025" data-navlink="" tabindex="0" id="fc-dom-26" class="fc-daygrid-day-number">12</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-28" role="gridcell" data-date="2025-09-13" class="fc-day fc-day-sat fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 13, 2025" data-navlink="" tabindex="0" id="fc-dom-28" class="fc-daygrid-day-number">13</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr><tr role="row"><td aria-labelledby="fc-dom-30" role="gridcell" data-date="2025-09-14" class="fc-day fc-day-sun fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 14, 2025" data-navlink="" tabindex="0" id="fc-dom-30" class="fc-daygrid-day-number">14</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-32" role="gridcell" data-date="2025-09-15" class="fc-day fc-day-mon fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 15, 2025" data-navlink="" tabindex="0" id="fc-dom-32" class="fc-daygrid-day-number">15</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-34" role="gridcell" data-date="2025-09-16" class="fc-day fc-day-tue fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 16, 2025" data-navlink="" tabindex="0" id="fc-dom-34" class="fc-daygrid-day-number">16</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-36" role="gridcell" data-date="2025-09-17" class="fc-day fc-day-wed fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 17, 2025" data-navlink="" tabindex="0" id="fc-dom-36" class="fc-daygrid-day-number">17</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-event-harness" style="margin-top: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-dot-event bg-label-warning"><div class="fc-daygrid-event-dot"></div><div class="fc-event-time">12a</div><div class="fc-event-title">Dinner</div></a></div><div class="fc-daygrid-event-harness" style="margin-top: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-info"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Dart Game?</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-event-harness fc-daygrid-event-harness-abs" style="visibility: hidden; top: 0px; left: 0px; right: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-danger"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Meditation</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-event-harness fc-daygrid-event-harness-abs" style="visibility: hidden; top: 0px; left: 0px; right: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-primary"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Product Review</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"><a tabindex="0" title="Show 2 more events" aria-expanded="false" aria-controls="" class="fc-daygrid-more-link fc-more-link">+2 more</a></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-38" role="gridcell" data-date="2025-09-18" class="fc-day fc-day-thu fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 18, 2025" data-navlink="" tabindex="0" id="fc-dom-38" class="fc-daygrid-day-number">18</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-40" role="gridcell" data-date="2025-09-19" class="fc-day fc-day-fri fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 19, 2025" data-navlink="" tabindex="0" id="fc-dom-40" class="fc-daygrid-day-number">19</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-event-harness" style="margin-top: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-dot-event bg-label-danger"><div class="fc-daygrid-event-dot"></div><div class="fc-event-time">12a</div><div class="fc-event-title">Doctor's Appointment</div></a></div><div class="fc-daygrid-event-harness" style="margin-top: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-primary"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Meeting With Client</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-42" role="gridcell" data-date="2025-09-20" class="fc-day fc-day-sat fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 20, 2025" data-navlink="" tabindex="0" id="fc-dom-42" class="fc-daygrid-day-number">20</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr><tr role="row"><td aria-labelledby="fc-dom-44" role="gridcell" data-date="2025-09-21" class="fc-day fc-day-sun fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 21, 2025" data-navlink="" tabindex="0" id="fc-dom-44" class="fc-daygrid-day-number">21</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-event-harness fc-daygrid-event-harness-abs" style="top: 0px; left: 0px; right: -116.562px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-success"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Family Trip</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-day-bottom" style="margin-top: 39px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-46" role="gridcell" data-date="2025-09-22" class="fc-day fc-day-mon fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 22, 2025" data-navlink="" tabindex="0" id="fc-dom-46" class="fc-daygrid-day-number">22</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 39px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-48" role="gridcell" data-date="2025-09-23" class="fc-day fc-day-tue fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 23, 2025" data-navlink="" tabindex="0" id="fc-dom-48" class="fc-daygrid-day-number">23</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-50" role="gridcell" data-date="2025-09-24" class="fc-day fc-day-wed fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 24, 2025" data-navlink="" tabindex="0" id="fc-dom-50" class="fc-daygrid-day-number">24</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-52" role="gridcell" data-date="2025-09-25" class="fc-day fc-day-thu fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 25, 2025" data-navlink="" tabindex="0" id="fc-dom-52" class="fc-daygrid-day-number">25</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-54" role="gridcell" data-date="2025-09-26" class="fc-day fc-day-fri fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 26, 2025" data-navlink="" tabindex="0" id="fc-dom-54" class="fc-daygrid-day-number">26</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-56" role="gridcell" data-date="2025-09-27" class="fc-day fc-day-sat fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 27, 2025" data-navlink="" tabindex="0" id="fc-dom-56" class="fc-daygrid-day-number">27</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr><tr role="row"><td aria-labelledby="fc-dom-58" role="gridcell" data-date="2025-09-28" class="fc-day fc-day-sun fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 28, 2025" data-navlink="" tabindex="0" id="fc-dom-58" class="fc-daygrid-day-number">28</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-60" role="gridcell" data-date="2025-09-29" class="fc-day fc-day-mon fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 29, 2025" data-navlink="" tabindex="0" id="fc-dom-60" class="fc-daygrid-day-number">29</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-62" role="gridcell" data-date="2025-09-30" class="fc-day fc-day-tue fc-day-future fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to September 30, 2025" data-navlink="" tabindex="0" id="fc-dom-62" class="fc-daygrid-day-number">30</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-64" role="gridcell" data-date="2025-10-01" class="fc-day fc-day-wed fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 1, 2025" data-navlink="" tabindex="0" id="fc-dom-64" class="fc-daygrid-day-number">1</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-event-harness" style="margin-top: 0px;"><a tabindex="0" class="fc-event fc-event-draggable fc-event-resizable fc-event-start fc-event-end fc-event-future fc-daygrid-event fc-daygrid-block-event fc-h-event bg-label-primary"><div class="fc-event-main"><div class="fc-event-main-frame"><div class="fc-event-title-container"><div class="fc-event-title fc-sticky">Monthly Meeting</div></div></div></div><div class="fc-event-resizer fc-event-resizer-start"></div><div class="fc-event-resizer fc-event-resizer-end"></div></a></div><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-66" role="gridcell" data-date="2025-10-02" class="fc-day fc-day-thu fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 2, 2025" data-navlink="" tabindex="0" id="fc-dom-66" class="fc-daygrid-day-number">2</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-68" role="gridcell" data-date="2025-10-03" class="fc-day fc-day-fri fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 3, 2025" data-navlink="" tabindex="0" id="fc-dom-68" class="fc-daygrid-day-number">3</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-70" role="gridcell" data-date="2025-10-04" class="fc-day fc-day-sat fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 4, 2025" data-navlink="" tabindex="0" id="fc-dom-70" class="fc-daygrid-day-number">4</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr><tr role="row"><td aria-labelledby="fc-dom-72" role="gridcell" data-date="2025-10-05" class="fc-day fc-day-sun fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 5, 2025" data-navlink="" tabindex="0" id="fc-dom-72" class="fc-daygrid-day-number">5</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-74" role="gridcell" data-date="2025-10-06" class="fc-day fc-day-mon fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 6, 2025" data-navlink="" tabindex="0" id="fc-dom-74" class="fc-daygrid-day-number">6</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-76" role="gridcell" data-date="2025-10-07" class="fc-day fc-day-tue fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 7, 2025" data-navlink="" tabindex="0" id="fc-dom-76" class="fc-daygrid-day-number">7</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-78" role="gridcell" data-date="2025-10-08" class="fc-day fc-day-wed fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 8, 2025" data-navlink="" tabindex="0" id="fc-dom-78" class="fc-daygrid-day-number">8</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-80" role="gridcell" data-date="2025-10-09" class="fc-day fc-day-thu fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 9, 2025" data-navlink="" tabindex="0" id="fc-dom-80" class="fc-daygrid-day-number">9</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-82" role="gridcell" data-date="2025-10-10" class="fc-day fc-day-fri fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 10, 2025" data-navlink="" tabindex="0" id="fc-dom-82" class="fc-daygrid-day-number">10</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td><td aria-labelledby="fc-dom-84" role="gridcell" data-date="2025-10-11" class="fc-day fc-day-sat fc-day-future fc-day-other fc-daygrid-day"><div class="fc-daygrid-day-frame fc-scrollgrid-sync-inner"><div class="fc-daygrid-day-top"><a title="Go to October 11, 2025" data-navlink="" tabindex="0" id="fc-dom-84" class="fc-daygrid-day-number">11</a></div><div class="fc-daygrid-day-events"><div class="fc-daygrid-day-bottom" style="margin-top: 0px;"></div></div><div class="fc-daygrid-day-bg"></div></div></td></tr></tbody></table></div></div></div></td></tr></tbody></table></div></div></div>
          </div>
        </div>
        <div class="app-overlay"></div>
        <!-- FullCalendar Offcanvas -->
        <div class="offcanvas offcanvas-end event-sidebar" tabindex="-1" id="addEventSidebar" aria-labelledby="addEventSidebarLabel">
          <div class="offcanvas-header border-bottom">
            <h5 class="offcanvas-title" id="addEventSidebarLabel">Add Event</h5>
            <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <form class="event-form pt-0 fv-plugins-bootstrap5 fv-plugins-framework" id="eventForm" onsubmit="return false" novalidate="novalidate">
              <div class="mb-6 form-control-validation fv-plugins-icon-container">
                <label class="form-label" for="eventTitle">Title</label>
                <input type="text" class="form-control" id="eventTitle" name="eventTitle" placeholder="Event Title">
              <div class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback"></div></div>
              <div class="mb-6">
                <label class="form-label" for="eventLabel">Label</label>
                <div class="position-relative"><select class="select2 select-event-label form-select select2-hidden-accessible" id="eventLabel" name="eventLabel" data-select2-id="eventLabel" tabindex="-1" aria-hidden="true">
                  <option data-label="primary" value="Business" selected="" data-select2-id="2">Business</option>
                  <option data-label="danger" value="Personal">Personal</option>
                  <option data-label="warning" value="Family">Family</option>
                  <option data-label="success" value="Holiday">Holiday</option>
                  <option data-label="info" value="ETC">ETC</option>
                </select><span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="1" style="width: 337px;"><span class="selection"><span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-disabled="false" aria-labelledby="select2-eventLabel-container"><span class="select2-selection__rendered" id="select2-eventLabel-container" role="textbox" aria-readonly="true" title="Business"><span class="badge badge-dot bg-primary me-2"> </span>Business</span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span></div>
              </div>
              <div class="mb-6 form-control-validation fv-plugins-icon-container">
                <label class="form-label" for="eventStartDate">Start Date</label>
                <div class="flatpickr-wrapper"><input type="text" class="form-control flatpickr-input" id="eventStartDate" name="eventStartDate" placeholder="Start Date" readonly="readonly"><div class="flatpickr-calendar hasTime animate static" tabindex="-1"><div class="flatpickr-months"><span class="flatpickr-prev-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z"></path></svg></span><div class="flatpickr-month"><div class="flatpickr-current-month"><span class="cur-month">September </span><div class="numInputWrapper"><input class="numInput cur-year" type="number" tabindex="-1" aria-label="Year"><span class="arrowUp"></span><span class="arrowDown"></span></div></div></div><span class="flatpickr-next-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z"></path></svg></span></div><div class="flatpickr-innerContainer"><div class="flatpickr-rContainer"><div class="flatpickr-weekdays"><div class="flatpickr-weekdaycontainer">
      <span class="flatpickr-weekday">
        Sun</span><span class="flatpickr-weekday">Mon</span><span class="flatpickr-weekday">Tue</span><span class="flatpickr-weekday">Wed</span><span class="flatpickr-weekday">Thu</span><span class="flatpickr-weekday">Fri</span><span class="flatpickr-weekday">Sat
      </span>
      </div></div><div class="flatpickr-days" tabindex="-1"><div class="dayContainer"><span class="flatpickr-day prevMonthDay" aria-label="August 31, 2025" tabindex="-1">31</span><span class="flatpickr-day" aria-label="September 1, 2025" tabindex="-1">1</span><span class="flatpickr-day" aria-label="September 2, 2025" tabindex="-1">2</span><span class="flatpickr-day today" aria-label="September 3, 2025" aria-current="date" tabindex="-1">3</span><span class="flatpickr-day" aria-label="September 4, 2025" tabindex="-1">4</span><span class="flatpickr-day" aria-label="September 5, 2025" tabindex="-1">5</span><span class="flatpickr-day" aria-label="September 6, 2025" tabindex="-1">6</span><span class="flatpickr-day" aria-label="September 7, 2025" tabindex="-1">7</span><span class="flatpickr-day" aria-label="September 8, 2025" tabindex="-1">8</span><span class="flatpickr-day" aria-label="September 9, 2025" tabindex="-1">9</span><span class="flatpickr-day" aria-label="September 10, 2025" tabindex="-1">10</span><span class="flatpickr-day" aria-label="September 11, 2025" tabindex="-1">11</span><span class="flatpickr-day" aria-label="September 12, 2025" tabindex="-1">12</span><span class="flatpickr-day" aria-label="September 13, 2025" tabindex="-1">13</span><span class="flatpickr-day" aria-label="September 14, 2025" tabindex="-1">14</span><span class="flatpickr-day" aria-label="September 15, 2025" tabindex="-1">15</span><span class="flatpickr-day" aria-label="September 16, 2025" tabindex="-1">16</span><span class="flatpickr-day" aria-label="September 17, 2025" tabindex="-1">17</span><span class="flatpickr-day" aria-label="September 18, 2025" tabindex="-1">18</span><span class="flatpickr-day" aria-label="September 19, 2025" tabindex="-1">19</span><span class="flatpickr-day" aria-label="September 20, 2025" tabindex="-1">20</span><span class="flatpickr-day" aria-label="September 21, 2025" tabindex="-1">21</span><span class="flatpickr-day" aria-label="September 22, 2025" tabindex="-1">22</span><span class="flatpickr-day" aria-label="September 23, 2025" tabindex="-1">23</span><span class="flatpickr-day" aria-label="September 24, 2025" tabindex="-1">24</span><span class="flatpickr-day" aria-label="September 25, 2025" tabindex="-1">25</span><span class="flatpickr-day" aria-label="September 26, 2025" tabindex="-1">26</span><span class="flatpickr-day" aria-label="September 27, 2025" tabindex="-1">27</span><span class="flatpickr-day" aria-label="September 28, 2025" tabindex="-1">28</span><span class="flatpickr-day" aria-label="September 29, 2025" tabindex="-1">29</span><span class="flatpickr-day" aria-label="September 30, 2025" tabindex="-1">30</span><span class="flatpickr-day nextMonthDay" aria-label="October 1, 2025" tabindex="-1">1</span><span class="flatpickr-day nextMonthDay" aria-label="October 2, 2025" tabindex="-1">2</span><span class="flatpickr-day nextMonthDay" aria-label="October 3, 2025" tabindex="-1">3</span><span class="flatpickr-day nextMonthDay" aria-label="October 4, 2025" tabindex="-1">4</span><span class="flatpickr-day nextMonthDay" aria-label="October 5, 2025" tabindex="-1">5</span><span class="flatpickr-day nextMonthDay" aria-label="October 6, 2025" tabindex="-1">6</span><span class="flatpickr-day nextMonthDay" aria-label="October 7, 2025" tabindex="-1">7</span><span class="flatpickr-day nextMonthDay" aria-label="October 8, 2025" tabindex="-1">8</span><span class="flatpickr-day nextMonthDay" aria-label="October 9, 2025" tabindex="-1">9</span><span class="flatpickr-day nextMonthDay" aria-label="October 10, 2025" tabindex="-1">10</span><span class="flatpickr-day nextMonthDay" aria-label="October 11, 2025" tabindex="-1">11</span></div></div></div></div><div class="flatpickr-time" tabindex="-1"><div class="numInputWrapper"><input class="numInput flatpickr-hour" type="number" aria-label="Hour" tabindex="-1" step="1" min="1" max="12" maxlength="2"><span class="arrowUp"></span><span class="arrowDown"></span></div><span class="flatpickr-time-separator">:</span><div class="numInputWrapper"><input class="numInput flatpickr-minute" type="number" aria-label="Minute" tabindex="-1" step="5" min="0" max="59" maxlength="2"><span class="arrowUp"></span><span class="arrowDown"></span></div><span class="flatpickr-am-pm" title="Click to toggle" tabindex="-1">PM</span></div></div></div>
              <div class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback"></div></div>
              <div class="mb-6 form-control-validation fv-plugins-icon-container">
                <label class="form-label" for="eventEndDate">End Date</label>
                <div class="flatpickr-wrapper"><input type="text" class="form-control flatpickr-input" id="eventEndDate" name="eventEndDate" placeholder="End Date" readonly="readonly"><div class="flatpickr-calendar hasTime animate static" tabindex="-1"><div class="flatpickr-months"><span class="flatpickr-prev-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z"></path></svg></span><div class="flatpickr-month"><div class="flatpickr-current-month"><span class="cur-month">September </span><div class="numInputWrapper"><input class="numInput cur-year" type="number" tabindex="-1" aria-label="Year"><span class="arrowUp"></span><span class="arrowDown"></span></div></div></div><span class="flatpickr-next-month"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 17 17"><g></g><path d="M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z"></path></svg></span></div><div class="flatpickr-innerContainer"><div class="flatpickr-rContainer"><div class="flatpickr-weekdays"><div class="flatpickr-weekdaycontainer">
      <span class="flatpickr-weekday">
        Sun</span><span class="flatpickr-weekday">Mon</span><span class="flatpickr-weekday">Tue</span><span class="flatpickr-weekday">Wed</span><span class="flatpickr-weekday">Thu</span><span class="flatpickr-weekday">Fri</span><span class="flatpickr-weekday">Sat
      </span>
      </div></div><div class="flatpickr-days" tabindex="-1"><div class="dayContainer"><span class="flatpickr-day prevMonthDay" aria-label="August 31, 2025" tabindex="-1">31</span><span class="flatpickr-day" aria-label="September 1, 2025" tabindex="-1">1</span><span class="flatpickr-day" aria-label="September 2, 2025" tabindex="-1">2</span><span class="flatpickr-day today" aria-label="September 3, 2025" aria-current="date" tabindex="-1">3</span><span class="flatpickr-day" aria-label="September 4, 2025" tabindex="-1">4</span><span class="flatpickr-day" aria-label="September 5, 2025" tabindex="-1">5</span><span class="flatpickr-day" aria-label="September 6, 2025" tabindex="-1">6</span><span class="flatpickr-day" aria-label="September 7, 2025" tabindex="-1">7</span><span class="flatpickr-day" aria-label="September 8, 2025" tabindex="-1">8</span><span class="flatpickr-day" aria-label="September 9, 2025" tabindex="-1">9</span><span class="flatpickr-day" aria-label="September 10, 2025" tabindex="-1">10</span><span class="flatpickr-day" aria-label="September 11, 2025" tabindex="-1">11</span><span class="flatpickr-day" aria-label="September 12, 2025" tabindex="-1">12</span><span class="flatpickr-day" aria-label="September 13, 2025" tabindex="-1">13</span><span class="flatpickr-day" aria-label="September 14, 2025" tabindex="-1">14</span><span class="flatpickr-day" aria-label="September 15, 2025" tabindex="-1">15</span><span class="flatpickr-day" aria-label="September 16, 2025" tabindex="-1">16</span><span class="flatpickr-day" aria-label="September 17, 2025" tabindex="-1">17</span><span class="flatpickr-day" aria-label="September 18, 2025" tabindex="-1">18</span><span class="flatpickr-day" aria-label="September 19, 2025" tabindex="-1">19</span><span class="flatpickr-day" aria-label="September 20, 2025" tabindex="-1">20</span><span class="flatpickr-day" aria-label="September 21, 2025" tabindex="-1">21</span><span class="flatpickr-day" aria-label="September 22, 2025" tabindex="-1">22</span><span class="flatpickr-day" aria-label="September 23, 2025" tabindex="-1">23</span><span class="flatpickr-day" aria-label="September 24, 2025" tabindex="-1">24</span><span class="flatpickr-day" aria-label="September 25, 2025" tabindex="-1">25</span><span class="flatpickr-day" aria-label="September 26, 2025" tabindex="-1">26</span><span class="flatpickr-day" aria-label="September 27, 2025" tabindex="-1">27</span><span class="flatpickr-day" aria-label="September 28, 2025" tabindex="-1">28</span><span class="flatpickr-day" aria-label="September 29, 2025" tabindex="-1">29</span><span class="flatpickr-day" aria-label="September 30, 2025" tabindex="-1">30</span><span class="flatpickr-day nextMonthDay" aria-label="October 1, 2025" tabindex="-1">1</span><span class="flatpickr-day nextMonthDay" aria-label="October 2, 2025" tabindex="-1">2</span><span class="flatpickr-day nextMonthDay" aria-label="October 3, 2025" tabindex="-1">3</span><span class="flatpickr-day nextMonthDay" aria-label="October 4, 2025" tabindex="-1">4</span><span class="flatpickr-day nextMonthDay" aria-label="October 5, 2025" tabindex="-1">5</span><span class="flatpickr-day nextMonthDay" aria-label="October 6, 2025" tabindex="-1">6</span><span class="flatpickr-day nextMonthDay" aria-label="October 7, 2025" tabindex="-1">7</span><span class="flatpickr-day nextMonthDay" aria-label="October 8, 2025" tabindex="-1">8</span><span class="flatpickr-day nextMonthDay" aria-label="October 9, 2025" tabindex="-1">9</span><span class="flatpickr-day nextMonthDay" aria-label="October 10, 2025" tabindex="-1">10</span><span class="flatpickr-day nextMonthDay" aria-label="October 11, 2025" tabindex="-1">11</span></div></div></div></div><div class="flatpickr-time" tabindex="-1"><div class="numInputWrapper"><input class="numInput flatpickr-hour" type="number" aria-label="Hour" tabindex="-1" step="1" min="1" max="12" maxlength="2"><span class="arrowUp"></span><span class="arrowDown"></span></div><span class="flatpickr-time-separator">:</span><div class="numInputWrapper"><input class="numInput flatpickr-minute" type="number" aria-label="Minute" tabindex="-1" step="5" min="0" max="59" maxlength="2"><span class="arrowUp"></span><span class="arrowDown"></span></div><span class="flatpickr-am-pm" title="Click to toggle" tabindex="-1">PM</span></div></div></div>
              <div class="fv-plugins-message-container fv-plugins-message-container--enabled invalid-feedback"></div></div>
              <div class="mb-6">
                <div class="form-check form-switch">
                  <input type="checkbox" class="form-check-input allDay-switch" id="allDaySwitch">
                  <label class="form-check-label" for="allDaySwitch">All Day</label>
                </div>
              </div>
              <div class="mb-6">
                <label class="form-label" for="eventURL">Event URL</label>
                <input type="url" class="form-control" id="eventURL" name="eventURL" placeholder="https://www.google.com">
              </div>
              <div class="mb-4 select2-primary">
                <label class="form-label" for="eventGuests">Add Guests</label>
                <div class="position-relative"><select class="select2 select-event-guests form-select select2-hidden-accessible" id="eventGuests" name="eventGuests" multiple="" data-select2-id="eventGuests" tabindex="-1" aria-hidden="true">
                  <option data-avatar="1.png" value="Jane Foster">Jane Foster</option>
                  <option data-avatar="3.png" value="Donna Frank">Donna Frank</option>
                  <option data-avatar="5.png" value="Gabrielle Robertson">Gabrielle Robertson</option>
                  <option data-avatar="7.png" value="Lori Spears">Lori Spears</option>
                  <option data-avatar="9.png" value="Sandy Vega">Sandy Vega</option>
                  <option data-avatar="11.png" value="Cheryl May">Cheryl May</option>
                </select><span class="select2 select2-container select2-container--default" dir="ltr" data-select2-id="3" style="width: 337px;"><span class="selection"><span class="select2-selection select2-selection--multiple" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="-1" aria-disabled="false"><ul class="select2-selection__rendered"><li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="0" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" placeholder="Select value" style="width: 325px;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span></div>
              </div>
              <div class="mb-6">
                <label class="form-label" for="eventLocation">Location</label>
                <input type="text" class="form-control" id="eventLocation" name="eventLocation" placeholder="Enter Location">
              </div>
              <div class="mb-6">
                <label class="form-label" for="eventDescription">Description</label>
                <textarea class="form-control" name="eventDescription" id="eventDescription"></textarea>
              </div>
              <div class="d-flex justify-content-sm-between justify-content-start mt-6 gap-2">
                <div class="d-flex">
                  <button type="submit" id="addEventBtn" class="btn btn-primary btn-add-event me-4">Add</button>
                  <button type="reset" class="btn btn-label-secondary btn-cancel me-sm-0 me-1" data-bs-dismiss="offcanvas">Cancel</button>
                </div>
                <button class="btn btn-label-danger btn-delete-event d-none">Delete</button>
              </div>
            <input type="hidden"></form>
          </div>
        </div>
      </div>
      <!-- /Calendar & Modal -->
    </div>
  </div>
                        



                        <!-- CONTENEDOR PRODUCTOS Y SERVICIOS -->
                        <div class="row">
                           


                        </div>
                        <!-- /CONTENEDOR PRODUCTOS Y SERVICIOS -->






                        <!-- CONTENEDOR CLIENTES Y VENDEDORES  -->
                        <div class="row">
                            <!-- TARJETA CLIENTE DEL MES -->
                        </div>
                        <!-- /CONTENEDOR CLIENTES Y VENDEDORES -->













                        <div class="row">
                           
                        </div>





                        <div class="content-backdrop fade"></div>
                    </div>
                    <!-- Content wrapper -->
                </div>


                <!-- Overlay -->
                <div class="layout-overlay layout-menu-toggle"></div>
            </div>
            <!-- / Layout wrapper -->



            <script src="https://cdnjs.cloudflare.com/ajax/libs/wow/1.1.2/wow.min.js"></script>
            <script>
                new WOW().init();
            </script>

            <!-- Core JS -->
            <!-- build:js assets/vendor/js/core.js -->
            <script src="../assets/vendor/libs/jquery/jquery.js"></script>
            <script src="../assets/vendor/libs/popper/popper.js"></script>
            <script src="../assets/vendor/js/bootstrap.js"></script>
            <script src="../assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>

            <script src="../assets/vendor/js/menu.js"></script>
            <!-- endbuild -->

            <!-- Vendors JS -->
            <script src="../assets/vendor/libs/apex-charts/apexcharts.js"></script>


            <!-- Main JS -->
            <script src="../assets/js/main.js"></script>

            <!-- Page JS -->
            <script src="../assets/js/dashboards-analytics.js"></script>
            <script src="../assets/js/app-ecommerce-dashboard.js"></script>

            <!-- Place this tag in your head or just before your close body tag. -->
            <script async defer src="https://buttons.github.io/buttons.js"></script>




        </div>



        <!-- MODAL PRODUCTO DEL MES -->
        
        <!-- /MODAL PRODUCTO DEL MES -->

        <!-- MODAL SERVICIO DEL MES -->
        
        <!-- /MODAL SERVICIO DEL MES -->

        <!-- MODAL CLIENTE DEL MES -->
        
        <!-- /MODAL CLIENTE DEL MES -->



        <!-- MODAL VENDEDOR DEL MES -->
        
        <!-- /MODAL VENDEDOR DEL MES -->





        <div class="modal fade" id="modalBusqueda" tabindex="-1" aria-hidden="true">
            <div class="modal-dialog modal-xl modal-dialog-centered">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">Buscar módulo</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
                    </div>
                    <div class="modal-body">
                        <div class="input-group mb-4">
                            <span class="input-group-text"><i class="bx bx-search"></i></span>
                            <input type="text" id="modalSearchInput" class="form-control" placeholder="Buscar módulo..." autocomplete="off">
                        </div>

                        <div class="row" id="modulosEstaticos">
                            <!-- Columna 1 -->
                            <div class="col-md-4 mb-4">
                                <!-- Inicio -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-home me-1"></i> Inicio
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1">
                                            <a href="tablero.php"><i class="bx bx-home-smile me-2"></i> Panel principal</a>
                                        </li>
                                    </ul>
                                </div>
                                <!-- Ventas -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-money me-1"></i> Ventas
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="facturas.php"><i class="bx bx-file me-2"></i> Facturas</a></li>
                                    </ul>
                                </div>
                                <!-- Clientes -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-user me-1"></i> Clientes
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="clientes.php"><i class="bx bx-user-pin me-2"></i> Clientes</a></li>
                                    </ul>
                                </div>
                            </div>

                            <!-- Columna 2 -->
                            <div class="col-md-4 mb-4">
                                <!-- Inventario -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-package me-1"></i> Inventario
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="productos.php"><i class="bx bx-cube me-2"></i> Productos</a></li>
                                    </ul>
                                </div>
                                <!-- Compras -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-cart me-1"></i> Compras
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="compras.php"><i class="bx bx-purchase-tag me-2"></i> Compras</a></li>
                                    </ul>
                                </div>
                            </div>

                            <!-- Columna 3 -->
                            <div class="col-md-4 mb-4">
                                <!-- Proveedores -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-building me-1"></i> Proveedores
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="proveedores.php"><i class="bx bx-user-voice me-2"></i> Proveedores</a></li>
                                    </ul>
                                </div>
                                <!-- Cuentas -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-wallet me-1"></i> Cuentas
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="cuentas.php"><i class="bx bx-credit-card me-2"></i> Cuentas</a></li>
                                    </ul>
                                </div>
                                <!-- Movimientos -->
                                <div class="mb-3">
                                    <small class="text-uppercase text-muted fw-bold d-block mb-2">
                                        <i class="bx bx-transfer me-1"></i> Movimientos
                                    </small>
                                    <ul class="list-group list-group-flush">
                                        <li class="list-group-item px-0 py-1"><a href="movimientos.php"><i class="bx bx-transfer-alt me-2"></i> Movimientos</a></li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                        <!-- Resultados de búsqueda -->
                        <ul id="modalSearchResults" class="list-group mb-3"></ul>

                    </div>
                </div>
            </div>
        </div>

        <style>
            /* Ocultar resultados inicialmente */
            #modalSearchResults {
                display: none;
                max-height: 300px;
                overflow-y: auto;
            }
        </style>




</body>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap4.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.21/i18n/Spanish.json"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.25/sorting/natural.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.13/jspdf.plugin.autotable.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.3.0/exceljs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/countup.js/2.0.8/countUp.min.js"></script>







<script>
    $(document).ready(function() {
        $.fn.dataTable.ext.type.order['numeric-comma-asc'] = function(data) {
            return parseFloat(data.replace(/[^0-9.-]/g, '')) || 0;
        };
        $.fn.dataTable.ext.type.order['numeric-comma-desc'] = function(data) {
            return -parseFloat(data.replace(/[^0-9.-]/g, '')) || 0;
        };


        var table = $('#clientesTable').DataTable({
            language: {
                url: '../json/Spanish.json'
            },
            pageLength: 10,
            lengthMenu: [
                [10, 25, 50, -1],
                [10, 25, 50, "Todos"]
            ],
            columnDefs: [{
                targets: 2,
                type: 'numeric-comma'
            }],
            order: [
                [2, 'asc']
            ]
        });

        var currentFilter = ''; // Variable global para almacenar el filtro actual
        var currentStartDate = '';
        var currentEndDate = '';

        // Función para filtrar la tabla y actualizar las tarjetas
        function filterTable(filter, startDate = '', endDate = '') {
            currentFilter = filter;
            currentStartDate = startDate;
            currentEndDate = endDate;

            $.fn.dataTable.ext.search.push(
                function(settings, data, dataIndex) {
                    var fechaDoc = data[5];
                    var fechaDocISO = new Date(fechaDoc.split('/').reverse().join('-')).toISOString().split('T')[0];
                    if (currentStartDate === '' && currentEndDate === '') {
                        return true;
                    }
                    if (fechaDocISO >= currentStartDate && fechaDocISO <= currentEndDate) {
                        return true;
                    }
                    return false;
                }
            );

            table.draw();
            $.fn.dataTable.ext.search.pop();

            // Obtiene y actualiza las tarjetas
            fetch(`get_card_data.php?filter=${filter}&start_date=${startDate}&end_date=${endDate}`)
                .then(response => response.json())
                .then(data => {
                    console.log('Datos de tarjetas recibidos:', data);

                    // Actualiza las tarjetas con los datos recibidos
                    document.getElementById('total-registros').textContent = data.totalRegistros || '0';
                    document.getElementById('facturas-emitidas').textContent = data.totalEmitidas || '0';
                    document.getElementById('facturas-canceladas').textContent = data.totalCanceladas || '0';
                })
                .catch(error => console.error('Error al actualizar tarjetas:', error));
        }

        // Maneja el envío del formulario del modal de filtro de fechas
        $('#dateFilterModal form').on('submit', function(event) {
            event.preventDefault(); // Previene el envío del formulario por defecto

            var startDate = $('#start_date').val();
            var endDate = $('#end_date').val();
            var filter = 'custom'; // Puedes definir un nombre específico para el filtro de fechas personalizadas

            // Llama a filterTable con el rango de fechas seleccionado
            filterTable(filter, startDate, endDate);

            // Cierra el modal
            $('#dateFilterModal').modal('hide');
        });

        // Maneja los clics en los botones de filtro de fechas (si usas filtros predefinidos)
        $('.date-filter').on('click', function() {
            var filter = $(this).data('filter');
            var startDate = '';
            var endDate = '';

            if (filter === 'today') {
                startDate = endDate = new Date().toISOString().split('T')[0];
            } else if (filter === 'this-month') {
                startDate = new Date(new Date().getFullYear(), new Date().getMonth(), 1).toISOString().split('T')[0];
                endDate = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toISOString().split('T')[0];
            } else if (filter === 'last-month') {
                startDate = new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1).toISOString().split('T')[0];
                endDate = new Date(new Date().getFullYear(), new Date().getMonth(), 0).toISOString().split('T')[0];
            }

            filterTable(filter, startDate, endDate);
        });

        // Maneja el cambio en los detalles de las filas
        $('#clientesTable tbody').on('click', 'i.toggle-detalles', function() {
            var tr = $(this).closest('tr');
            var row = table.row(tr);
            var cve_doc = $(this).data('cve_doc');

            if (row.child.isShown()) {
                row.child().find('div').slideUp(function() {
                    row.child.hide();
                    tr.removeClass('shown');
                    $(tr).find('i.toggle-detalles').removeClass('down');
                });
            } else {
                $.ajax({
                    url: 'detalles_factura.php',
                    type: 'POST',
                    data: {
                        id: cve_doc
                    },
                    dataType: 'json',
                    success: function(response) {
                        if (response.detalles) {
                            row.child('<div>' + response.detalles + '</div>').show();
                            tr.addClass('shown');
                            $(tr).find('i.toggle-detalles').addClass('down');
                            row.child().find('div').hide().slideDown();
                        } else if (response.error) {
                            row.child('<div><p>Error: ' + response.error + '</p></div>').show();
                            tr.addClass('shown');
                            row.child().find('div').hide().slideDown();
                        }
                    },
                    error: function() {
                        row.child('<div><p>Error al obtener los detalles de la factura.</p></div>').show();
                        tr.addClass('shown');
                        row.child().find('div').hide().slideDown();
                    }
                });
            }
        });

        // Maneja el clic en el botón de limpiar filtros
        $('#clearFilters').on('click', function() {
            table.search('').columns().search('').draw();
            // Reinicia el filtro
            currentFilter = '';
            currentStartDate = '';
            currentEndDate = '';
        });

        // Maneja el clic en el encabezado de la tabla
        $('#clientesTable').on('click', 'th', function() {
            // Asegura que el filtro actual se aplique cada vez que la tabla se dibuje
            if (currentFilter) {
                filterTable(currentFilter, currentStartDate, currentEndDate);
            }
        });
    });
</script>


<script>
    document.getElementById('clearFilters').addEventListener('click', function() {
        window.location.href = '';
    });

    document.querySelectorAll('.custom-filter').forEach(button => {
        button.addEventListener('click', function() {
            document.querySelectorAll('.custom-filter').forEach(btn => btn.classList.remove('active'));
            this.classList.add('active');
        });
    });

    document.querySelector('.apply-date-filter').addEventListener('click', function() {
        document.querySelector('.custom-date-filter').classList.add('active');
    });
</script>

<script>
    $(document).ready(function() {
        $('body').css('overflow', 'auto');
    });
</script>




<!-- SCRIPT PARA BOTON "EXPORTAR" -->
<script>
    document.getElementById("exportBtn").addEventListener("click", function() {
        var menu = document.getElementById("exportMenu");
        menu.style.display = menu.style.display === "block" ? "none" : "block";
    });
    window.onclick = function(event) {
        if (!event.target.matches('.export-button')) {
            var dropdowns = document.getElementsByClassName("export-menu");
            for (var i = 0; i < dropdowns.length; i++) {
                var openDropdown = dropdowns[i];
                if (openDropdown.style.display === "block") {
                    openDropdown.style.display = "none";
                }
            }
        }
    };
</script>

<!-- SCRIPT PARA  "IMPRIMIR" -->
<script>
    $('#printOption').click(function() {
        const nombreEmpresa = 'Empresa Inválida S.A. de C.V.';
        const logoSrc = 'img/siigo-aspel.svg';
        const printWindow = window.open('', '', 'height=600,width=800');

        // Clonar el encabezado de la tabla principal
        const tableHeader = document.querySelector('#clientesTable thead').cloneNode(true);

        // Buscar la columna "Acción" y eliminarla tanto del encabezado como de las filas
        const actionIndex = Array.from(tableHeader.querySelectorAll('th')).findIndex(th => th.innerText.trim() === 'Acción');
        if (actionIndex >= 0) {
            tableHeader.querySelectorAll('th')[actionIndex].remove();
        }

        const addPageHeader = () => {
            return `
                <div class="page-header" style="text-align: center; page-break-before: always;">
                    <img src="${logoSrc}" alt="Logo" class="logo" style="max-width: 280px; margin-bottom: 18px;">
                    <h1 style="font-size: 24px; font-weight: bold; margin-top: 40px;">${nombreEmpresa}</h1>
                    <h2 style="font-size: 20px; font-weight: normal; margin-bottom: 20px;">Facturas</h2>
                </div>
                
            `;
        };

        // Crear el contenido HTML para la impresión
        let printContent = '<html><head><title>Imprimir</title>';
        printContent += '<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">';
        printContent += '<style>';
        printContent += 'body { text-align: center; margin: 20px; }';
        printContent += 'h1 { font-size: 24px; font-weight: bold; margin-top: 40px; }';
        printContent += 'h2 { font-size: 20px; font-weight: normal; margin-bottom: 20px; }';
        printContent += 'img.logo { max-width: 280px; margin-bottom: 18px; }';
        printContent += 'table { width: 100%; border-collapse: collapse; }';
        printContent += 'th, td { padding: 8px; text-align: left; border: none; }';
        printContent += 'th { background-color: #f8f9fa; }';
        printContent += '.col-partida { width: 10%; }';
        printContent += '.col-cantidad { width: 10%; }';
        printContent += '.col-clave { width: 15%; }';
        printContent += '.col-precio { width: 15%; }';
        printContent += '.col-subtotal { width: 15%; }';
        printContent += '.col-observaciones { width: 25%; word-wrap: break-word; }';
        printContent += '.page-header { page-break-before: always; }';
        printContent += '</style>';
        printContent += '</head><body>';

        // Generar el contenido para cada fila expandida o todas las filas si no hay filas expandidas
        const expandedRows = $('#clientesTable tbody').find('i.toggle-detalles.down').closest('tr');

        if (expandedRows.length > 0) {
            expandedRows.each(function() {
                // Añadir encabezado antes de cada partida expandida para asegurarlo en cada página
                printContent += addPageHeader();

                // Generar la tabla con la fila expandida
                printContent += '<table class="table table-hover">';
                printContent += '<thead>' + tableHeader.innerHTML + '</thead><tbody>';

                // Clonar y eliminar la columna "Acción"
                const expandedRow = $(this).clone()[0];
                expandedRow.querySelectorAll('td')[actionIndex]?.remove();
                printContent += '<tr>' + expandedRow.innerHTML + '</tr>';

                // Clonar y añadir la fila de detalles
                const detalleRow = $(this).next('tr').clone()[0];
                if (detalleRow) {
                    detalleRow.querySelectorAll('td')[actionIndex]?.remove();
                    printContent += '<tr>' + detalleRow.innerHTML + '</tr>';
                }

                printContent += '</tbody></table>';
            });
        } else {
            // Si no hay filas expandidas, imprimimos todas las partidas con encabezado en la primera página
            printContent += addPageHeader();
            printContent += '<table class="table table-hover">';
            printContent += '<thead>' + tableHeader.innerHTML + '</thead><tbody>';

            $('#clientesTable tbody tr').each(function() {
                const row = $(this).clone()[0];
                row.querySelectorAll('td')[actionIndex]?.remove();
                printContent += '<tr>' + row.innerHTML + '</tr>';
            });

            printContent += '</tbody></table>';
        }

        printContent += '</body></html>';

        // Escribir el contenido en la ventana de impresión
        printWindow.document.write(printContent);
        printWindow.document.close();
        printWindow.focus();
        printWindow.print();
    });
</script>


<!-- SCRIPT PARA EXCEL -->
<script>
    $(document).ready(function() {
        $('#excelOption').click(async function() {
            const workbook = new ExcelJS.Workbook();
            const worksheet = workbook.addWorksheet('Facturas');
            const nombreEmpresa = 'Empresa Inválida S.A. de C.V.';

            // Encabezados para la parte superior
            const headersDocumento = ['Tipo', 'Clave', 'Cliente', 'Nombre', 'Estatus', 'Fecha', 'Total'];
            const headersPartida = ['Partida', 'Cantidad', 'Clave', 'Prec. Unit', 'Subtotal', 'Observaciones'];

            // Buscar todas las filas que están expandidas
            let expandedRows = $('#clientesTable tbody').find('i.toggle-detalles.down').closest('tr');

            // Si no hay filas expandidas, selecciona todas las filas de la tabla
            if (expandedRows.length === 0) {
                expandedRows = $('#clientesTable tbody tr');
            }

            // Agregar el nombre de la empresa y título
            worksheet.mergeCells('A1:G1');
            worksheet.getCell('A1').value = nombreEmpresa;
            worksheet.getCell('A1').font = {
                bold: true,
                size: 14
            };
            worksheet.getCell('A1').alignment = {
                horizontal: 'center'
            };

            worksheet.mergeCells('A2:G2');
            worksheet.getCell('A2').value = 'Detalle de Facturas';
            worksheet.getCell('A2').font = {
                bold: true,
                size: 12
            };
            worksheet.getCell('A2').alignment = {
                horizontal: 'center'
            };

            expandedRows.each(function(index, row) {
                // Obtener los datos generales del documento
                const datosDocumento = Array.from($(row).find('td')).slice(0, 7).map(td => $(td).text().trim());

                // Añadir encabezados de documento
                const headerRowDoc = worksheet.addRow(headersDocumento);
                headerRowDoc.font = {
                    bold: true
                };
                headerRowDoc.eachCell((cell) => {
                    cell.fill = {
                        type: 'pattern',
                        pattern: 'solid',
                        fgColor: {
                            argb: '009DFF'
                        }
                    };
                    cell.font = {
                        color: {
                            argb: 'FFFFFF'
                        },
                        bold: true
                    };
                    cell.alignment = {
                        horizontal: 'center'
                    };
                });

                // Añadir datos generales del documento
                worksheet.addRow(datosDocumento);

                // Obtener los detalles de la partida
                const detallesPartidaRow = $(row).next();
                const detallesPartida = [];

                // Recopilar los datos de las partidas
                detallesPartidaRow.find('tr').each(function() {
                    const fila = [];
                    $(this).find('td').each(function() {
                        fila.push($(this).text().trim());
                    });
                    detallesPartida.push(fila);
                });

                // Añadir encabezados de la partida
                if (detallesPartida.length > 0) {
                    const partidaHeaderRow = worksheet.addRow(headersPartida);
                    partidaHeaderRow.font = {
                        bold: true
                    };
                    partidaHeaderRow.eachCell((cell) => {
                        cell.fill = {
                            type: 'pattern',
                            pattern: 'solid',
                            fgColor: {
                                argb: '007ecc'
                            }
                        };
                        cell.font = {
                            color: {
                                argb: 'FFFFFF'
                            },
                            bold: true
                        };
                        cell.alignment = {
                            horizontal: 'center'
                        };
                    });

                    // Añadir datos de cada partida inmediatamente después de los encabezados
                    detallesPartida.forEach(partidaData => {
                        if (partidaData.some(data => data !== "")) { // Evitar filas completamente vacías
                            worksheet.addRow(partidaData);
                        }
                    });
                }
            });

            // Ajustar el ancho para las columnas de encabezados de las partidas
            headersPartida.forEach((header, index) => {
                const colIndex = index + 1; // Ajusta a partir de la columna 1 para las partidas
                worksheet.getColumn(colIndex).width = header.length + 2; // +2 para un poco de espacio adicional
            });

            // Descargar el archivo de Excel
            const buffer = await workbook.xlsx.writeBuffer();
            const blob = new Blob([buffer], {
                type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            });
            const link = document.createElement('a');
            link.href = URL.createObjectURL(blob);
            link.download = 'facturas.xlsx';
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
        });
    });
</script>

<!-- SCRIPT PARA PDF -->
<script>
    $(document).ready(function() {
        $('#pdfOption').click(async function() {
            const {
                jsPDF
            } = window.jspdf;
            const doc = new jsPDF();
            const nombreEmpresa = 'Empresa Inválida S.A. de C.V.';

            // Ruta del logo SVG
            const svgPath = 'img/siigo-aspel.svg';

            // Función para cargar y convertir el SVG a base64 en formato PNG
            async function convertSvgToBase64(url) {
                return new Promise((resolve) => {
                    fetch(url)
                        .then(response => response.text())
                        .then(svgText => {
                            const svg = new Blob([svgText], {
                                type: 'image/svg+xml;charset=utf-8'
                            });
                            const DOMURL = window.URL || window.webkitURL || window;
                            const url = DOMURL.createObjectURL(svg);
                            const img = new Image();
                            img.onload = function() {
                                const canvas = document.createElement('canvas');
                                canvas.width = img.width;
                                canvas.height = img.height;
                                const ctx = canvas.getContext('2d');
                                ctx.drawImage(img, 0, 0);
                                DOMURL.revokeObjectURL(url);
                                resolve(canvas.toDataURL('image/png'));
                            };
                            img.src = url;
                        });
                });
            }

            // Convertir el SVG a base64
            const logoBase64 = await convertSvgToBase64(svgPath);

            // Encabezados para la parte superior
            const headersDocumento = ['Tipo', 'Clave', 'Cliente', 'Nombre', 'Estatus', 'Fecha', 'Total'];
            // Encabezados para los detalles de la partida
            const headersPartida = ['Partida', 'Cantidad', 'Clave', 'Prec. Unit', 'Subtotal', 'Observaciones'];

            // Buscar todas las filas que están expandidas
            let expandedRows = $('#clientesTable tbody').find('i.toggle-detalles.down').closest('tr');

            if (expandedRows.length === 0) {
                // Si no hay partidas seleccionadas, exportar toda la tabla en un formato general
                const headers = Array.from($('#clientesTable thead th')).map(th => $(th).text().trim()).filter(h => h !== 'Acción');
                const rows = Array.from($('#clientesTable tbody tr')).map(row =>
                    Array.from($(row).find('td')).map(td => $(td).text().trim())
                );

                // Insertar el logo en la parte superior
                doc.addImage(logoBase64, 'PNG', 15, 10, 30, 18); // Tamaño más pequeño

                // Título de la empresa y encabezados generales
                doc.setFontSize(12); // Tamaño de fuente reducido
                doc.text(nombreEmpresa, 105, 20, {
                    align: 'center'
                });
                doc.setFontSize(10); // Tamaño de fuente reducido
                doc.text('Resumen de Facturas', 105, 30, {
                    align: 'center'
                });

                // Tabla general
                doc.autoTable({
                    startY: 40,
                    head: [headers],
                    body: rows,
                    headStyles: {
                        fillColor: '#009DFF',
                        textColor: '#FFFFFF',
                        halign: 'center'
                    },
                    bodyStyles: {
                        halign: 'center'
                    },
                    styles: {
                        fontSize: 8,
                        cellPadding: 2
                    }, // Tamaño de fuente y padding reducidos
                    theme: 'striped'
                });
            } else {
                // Si hay partidas seleccionadas, usar el diseño de partidas detalladas
                expandedRows.each(function(index, row) {
                    if (index > 0) {
                        doc.addPage(); // Crear nueva página para cada partida expandida
                    }

                    // Obtener los datos generales del documento de esa partida
                    const datosDocumento = Array.from($(row).find('td')).slice(0, 7).map(td => $(td).text().trim());

                    // Obtener los detalles de la partida expandida (asumiendo que están en la fila siguiente)
                    const detallesPartidaRow = $(row).next();
                    const detallesPartida = [];

                    // Construir la fila de detalles de la partida en un formato adecuado
                    detallesPartidaRow.find('tr').each(function() {
                        const fila = [];
                        $(this).find('td').each(function() {
                            fila.push($(this).text().trim());
                        });
                        detallesPartida.push(fila); // Añadir cada fila como un array separado en `detallesPartida`
                    });

                    // Insertar el logo en la parte superior
                    doc.addImage(logoBase64, 'PNG', 15, 10, 30, 18); // Tamaño más pequeño

                    // Título de la empresa y encabezados generales
                    doc.setFontSize(12); // Tamaño de fuente reducido
                    doc.text(nombreEmpresa, 105, 20, {
                        align: 'center'
                    });
                    doc.setFontSize(10); // Tamaño de fuente reducido
                    doc.text('Detalle de Facturas', 105, 30, {
                        align: 'center'
                    });

                    // Tabla de datos generales del documento
                    doc.autoTable({
                        startY: 40,
                        head: [headersDocumento],
                        body: [datosDocumento],
                        headStyles: {
                            fillColor: '#009DFF',
                            textColor: '#FFFFFF',
                            halign: 'center'
                        },
                        bodyStyles: {
                            halign: 'center'
                        },
                        styles: {
                            fontSize: 8,
                            cellPadding: 2
                        }, // Tamaño de fuente y padding reducidos
                        theme: 'plain'
                    });

                    // Espacio entre tablas
                    const tableY = doc.lastAutoTable.finalY + 5; // Espacio reducido

                    // Tabla de detalles de la partida
                    doc.autoTable({
                        startY: tableY,
                        head: [headersPartida],
                        body: detallesPartida,
                        headStyles: {
                            fillColor: '#009DFF',
                            textColor: '#FFFFFF',
                            halign: 'center'
                        },
                        bodyStyles: {
                            halign: 'center'
                        },
                        styles: {
                            fontSize: 8,
                            cellPadding: 2
                        }, // Tamaño de fuente y padding reducidos
                        theme: 'plain',
                    });
                });
            }

            // Descargar el PDF
            doc.save('facturas.pdf');
        });
    });
</script>
<script>
    $(document).ready(function() {
        $('#copyOption').click(function() {
            let textToCopy = "";
            const table = document.getElementById('clientesTable');

            // Obtener los encabezados de la tabla (solo una vez)
            const headerCells = table.querySelectorAll('thead th');
            const headers = Array.from(headerCells).slice(0, -1).map(cell => cell.innerText).join("\t");
            textToCopy = headers + "\n"; // Agregar encabezados al inicio solo una vez

            // Recorrer todas las filas del tbody, asegurando que no se dupliquen
            $('#clientesTable tbody tr').each(function() {
                const row = $(this);
                const cells = row.find('td, th');

                // Verificar si la fila es de detalle (expandida)
                if (row.hasClass('detalle')) {
                    // Solo copiar si la fila de detalle está visible
                    if (row.css('display') !== 'none') {
                        // Copiar los datos de la fila de detalle
                        const detailText = Array.from(cells).map(cell => cell.innerText).join("\t");
                        textToCopy += detailText + "\n"; // Agregar detalle al texto
                    }
                } else {
                    // Si es una fila principal (partida), copiarla
                    const rowText = Array.from(cells).slice(0, -1).map(cell => cell.innerText).join("\t");
                    textToCopy += rowText + "\n"; // Agregar la fila principal al texto
                }
            });

            // Copiar el texto al portapapeles
            navigator.clipboard.writeText(textToCopy).then(() => {
                $('#copyAlert').fadeIn().css('display', 'flex');
                setTimeout(function() {
                    $('#copyAlert').fadeOut();
                }, 3000);
            }).catch(err => {
                console.error('Error al copiar: ', err);
            });
        });
    });
</script>
<script>
    document.getElementById("modalSearchInput").addEventListener("input", function() {
        const query = this.value.trim();
        const results = document.getElementById("modalSearchResults");
        const modulos = document.getElementById("modulosEstaticos");

        results.innerHTML = "";

        if (query.length < 2) {
            // Mostrar módulos estáticos y ocultar resultados
            modulos.style.display = "flex"; // o "block" si prefieres
            results.style.display = "none";
            return;
        }

        // Ocultar módulos estáticos y mostrar resultados
        modulos.style.display = "none";
        results.style.display = "block";

        fetch("buscar_archivos.php?q=" + encodeURIComponent(query))
            .then(response => response.json())
            .then(data => {
                if (data.length === 0) {
                    results.innerHTML = `<li class="list-group-item text-muted">No se encontraron resultados</li>`;
                    return;
                }

                data.forEach(item => {
                    const li = document.createElement("li");
                    li.className = "list-group-item list-group-item-action";
                    li.innerHTML = `<i class="bx bx-link-alt me-2"></i> ${item.titulo}`;
                    li.addEventListener("click", () => {
                        window.location.href = item.archivo;
                    });
                    results.appendChild(li);
                });
            })
            .catch(error => {
                console.error("Error al buscar:", error);
            });
    });
</script>




</html>