<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Emissor NFSe - Focus NFe</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <style>

    body {
        background: #f5f6fa;
    }

    /* Sidebar */
    .sidebar {
        min-height: 100vh;
        background: #2f2f2f;
        border-right: 1px solid #444;
        
    }
    .container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    padding-left: 0 !important;
}

    /* Cabeçalho */
    .sidebar .text-center {
        background: #3742FA;
        border-bottom: 1px solid rgba(255,255,255,.1);
    }

    .sidebar h5 {
        color: #fff;
        font-weight: 600;
        margin-bottom: 0;
    }

    .sidebar small {
        color: rgba(255,255,255,.8);
    }

    /* Links */
    .sidebar .nav {
        padding-top: 10px;
    }

    .sidebar .nav-link {
        color: #ffffff;
        padding: 12px 18px;
        font-size: 15px;
        transition: .2s;
        border-left: 4px solid transparent;
    }

    .sidebar .nav-link i {
        width: 22px;
        margin-right: 8px;
    }

    .sidebar .nav-link:hover {
        background: #404040;
        color: #fff;
        border-left: 4px solid #00B2FF;
    }

    .sidebar .nav-link.active {
        background: #3742FA;
        color: #fff;
        border-left: 4px solid #00B2FF;
    }

    /* Dropdown */
    .sidebar .dropdown-menu {
        background: #343434;
        border: none;
        border-radius: 0;
        margin-left: 15px;
        margin-top: 4px;
        padding: 5px 0;
    }

    .sidebar .dropdown-item {
        color: #fff;
        padding: 10px 18px;
        transition: .2s;
    }

    .sidebar .dropdown-item:hover {
        background: #404040;
        color: #fff;
    }

    .sidebar .dropdown-item.active {
        background: #3742FA;
        color: #fff;
    }

    .sidebar .dropdown-divider {
        border-color: #555;
    }

    /* Conteúdo */
    .content {
        padding: 25px;
        background: #f8f9fa;
    }

    /* Badges */
    .status-badge {
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
    }

    .status-autorizado {
        background: #27ae60;
        color: #fff;
    }

    .status-processando {
        background: #f39c12;
        color: #fff;
    }

    .status-rejeitado {
        background: #e74c3c;
        color: #fff;
    }

    .status-cancelado {
        background: #7f8c8d;
        color: #fff;
    }

        .status-autorizado { background-color: #27ae60; color: white; }
        .status-processando { background-color: #f39c12; color: white; }
        .status-rejeitado { background-color: #e74c3c; color: white; }
        .status-cancelado { background-color: #95a5a6; color: white; }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2 p-0 sidebar">
                <div class="text-center py-4">
                    <h5 class="text-white">Emissor NFSe</h5>
                    <small class="text-white-50">Focus NFe</small>
                </div>
                <nav class="nav flex-column">
                    <a class="nav-link <?php echo basename($_SERVER['PHP_SELF']) == 'index.php' ? 'active' : ''; ?>" href="index.php">
                        <i class="bi bi-speedometer2"></i> Dashboard
                    </a>
                    
                    <!-- Cadastros com Submenu -->
                    <div class="nav-item dropdown">

                     
                            <li>
                                <a class="dropdown-item <?php echo basename($_SERVER['PHP_SELF']) == 'empresas.php' ? 'active' : ''; ?>" href="empresas.php">
                                    <i class="bi bi-building"></i> Empresas
                                </a>
                            </li>
                            <li>
                                <a class="dropdown-item <?php echo basename($_SERVER['PHP_SELF']) == 'emitentes.php' ? 'active' : ''; ?>" href="emitentes.php">
                                    <i class="bi bi-person-badge"></i> Emitentes
                                </a>
                            </li>
                            <li>
                                <a class="dropdown-item <?php echo basename($_SERVER['PHP_SELF']) == 'tomadores.php' ? 'active' : ''; ?>" href="tomadores.php">
                                    <i class="bi bi-people"></i> Tomadores
                                </a>
                            </li>
                            <li><hr class="dropdown-divider"></li>
                            <li>
                                <a class="dropdown-item <?php echo basename($_SERVER['PHP_SELF']) == 'servicos_gerenciar.php' ? 'active' : ''; ?>" href="servicos_gerenciar.php">
                                    <i class="bi bi-grid-3x3-gap-fill"></i> C&oacute;digos de Servi&ccedil;o
                                </a>
                            </li>
                                                        <li>
                                <a class="dropdown-item <?php echo basename($_SERVER['PHP_SELF']) == 'cadastro_iss.php' ? 'active' : ''; ?>" href="cadastro_iss.php">
                                    <i class="bi bi-grid-3x3-gap-fill"></i> Cadastro de ISS
                                </a>
                            </li>
                       
                    </div>
                    
                    <a class="nav-link <?php echo basename($_SERVER['PHP_SELF']) == 'emitir_nota.php' ? 'active' : ''; ?>" href="emitir_nota.php">
                        <i class="bi bi-receipt"></i> Emitir Nota
                    </a>
                    <a class="nav-link <?php echo basename($_SERVER['PHP_SELF']) == 'consultar_notas.php' ? 'active' : ''; ?>" href="consultar_notas.php">
                        <i class="bi bi-search"></i> Consultar Notas
                    </a>
                </nav>
            </div>
            <div class="col-md-10 content">