<?php
session_start();
if (!isset($_SESSION['eggzie_iboPlayer'])) {
    header('location:login.php');
    exit();
}
$IIIIIIIlI1lI = $_SESSION['id'];
$IIIIIIIlI1ll = new SQLite3('./a/.eggziepanels.db');
$adb = new SQLite3('./api/.adb.db');
$IIIIIIIlI1l1 = $IIIIIIIlI1ll->query('SELECT * FROM USERS WHERE id=\'1\'');
$IIIIIIIlI11I = $IIIIIIIlI1l1->fetchArray();
$IIIIIIIlI11l = $IIIIIIIlI11I['NAME'];
$IIIIIIIlI111 = $IIIIIIIlI11I['LOGO'];
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<?php
$IIIIIIIllIII = file_get_contents('./includes/eggzie.json');
$IIIIIIIllIIl = json_decode($IIIIIIIllIII, true);
$IIIIIIIllII1 = $IIIIIIIllIIl['info'];
$IIIIIIIllIlI = $IIIIIIIllII1['aa'];
?>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <meta name="google" content="notranslate">
  <title>Ultra IBO - Dashboard</title>
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <link href="css/sb-admin-<?php echo $IIIIIIIllIlI; ?>.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="css/jquery.datetimepicker.min.css"/>
  <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
  <script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
  <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,600,700" rel="stylesheet">
  
  <style>
    :root {
        --azul-escuro: #020617;
        --azul-celeste: #0ea5e9;
        --azul-claro: #38bdf8;
        --bg-panel: #020617;
        --card-bg: #0f172a;
        --text-color: #f1f5f9;
        --border-color: #1e293b;
    }
    body {
        font-family: 'Poppins', sans-serif;
        background-color: var(--bg-panel);
        color: var(--text-color);
    }
    #accordionSidebar {
        background: linear-gradient(180deg, #020617 0%, #0f172a 100%) !important;
        border-right: 1px solid var(--border-color);
    }
    #content-wrapper, #content {
        background-color: var(--bg-panel) !important;
    }
    .card-body, .table-responsive, .modal-body, .modal-footer {
        background-color: var(--card-bg) !important;
    }
    .pagination .page-link {
        background-color: var(--card-bg) !important;
        border-color: var(--border-color) !important;
        color: var(--text-color) !important;
    }
    .pagination .page-item.active .page-link {
        background-color: var(--azul-celeste) !important;
        border-color: var(--azul-celeste) !important;
    }
    .pagination .page-item.disabled .page-link {
        background-color: #020617 !important;
        border-color: var(--border-color) !important;
        opacity: 0.5;
    }
    .sidebar-dark .nav-item .nav-link {
        color: rgba(255, 255, 255, 0.7);
    }
    .sidebar-dark .nav-item .nav-link:hover {
        color: var(--azul-celeste);
        background: rgba(255,255,255,0.05);
    }
    .sidebar-dark .nav-item.active .nav-link {
        color: var(--azul-celeste);
        font-weight: 700;
        background: rgba(14, 165, 233, 0.1);
    }
    .topbar {
        background-color: #1e293b !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
        border-bottom: 1px solid var(--border-color);
    }
    .topbar .text-gray-800, .topbar .text-gray-600 {
        color: #f1f5f9 !important;
    }
    .text-primary {
        color: var(--azul-celeste) !important;
    }
    .btn-primary {
        background-color: var(--azul-celeste) !important;
        border-color: var(--azul-celeste) !important;
    }
    .btn-primary:hover {
        background-color: #0284c7 !important;
        border-color: #0284c7 !important;
    }
    .card {
        background-color: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-color) !important;
    }
    .card-header {
        background-color: #1e293b !important;
        border-bottom: 1px solid var(--border-color) !important;
        color: var(--text-color) !important;
    }
    .text-gray-800, .h5, h1, h2, h3, h4, h5, h6, .card-title {
        color: #f1f5f9 !important;
    }
    .text-gray-600, .text-muted, .small {
        color: #cbd5e1 !important;
    }
    .badge-light {
        background-color: #334155 !important;
        color: #f1f5f9 !important;
    }
    .table {
        color: #f1f5f9 !important;
    }
    .table-hover tbody tr:hover {
        color: #f1f5f9 !important;
        background-color: rgba(255,255,255,0.05) !important;
    }
    .modal-content {
        background-color: var(--card-bg) !important;
        color: var(--text-color) !important;
    }
    .form-control {
        background-color: #0f172a !important;
        border: 1px solid var(--border-color) !important;
        color: #f1f5f9 !important;
    }
    .form-control:focus {
        background-color: #0f172a !important;
        color: #f1f5f9 !important;
        border-color: var(--azul-celeste) !important;
    }
    .dropdown-menu {
        background-color: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
    }
    .dropdown-item {
        color: #f1f5f9 !important;
    }
    .dropdown-item:hover {
        background-color: rgba(255,255,255,0.05) !important;
    }
    .border-left-primary {
        border-left: .25rem solid var(--azul-celeste) !important;
    }
    .dash-card {
        border-radius: 15px;
        transition: transform 0.3s;
        border: none;
    }
    .dash-card:hover {
        transform: translateY(-5px);
    }
    .icon-box {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        margin-bottom: 15px;
    }
    .bg-celeste-light { background-color: rgba(14, 165, 233, 0.1); color: var(--azul-celeste); }
    .bg-escuro-light { background-color: rgba(255, 255, 255, 0.05); color: #f1f5f9; }
    .text-info { color: var(--azul-claro) !important; }
    .text-warning { color: #f6c23e !important; }
    .border-left-info { border-left: .25rem solid var(--azul-claro) !important; }
    .border-left-warning { border-left: .25rem solid #f6c23e !important; }
  </style>
</head>
<body id="page-top">
  <div id="wrapper">
    <ul class="navbar-nav sidebar sidebar-dark accordion" id="accordionSidebar">
      <a class="sidebar-brand d-flex align-items-center justify-content-center" href="users.php">
        <div class="sidebar-brand-icon">
          <img class="img-profile" width="50px" src="<?php echo $IIIIIIIlI111 ? $IIIIIIIlI111 : 'img/logo.png'; ?>" style="border-radius: 50%;">
        </div>
        <div class="sidebar-brand-text mx-3">Ultra IBO</div>
      </a>
      <hr class="sidebar-divider my-0">
      
      <li class="nav-item active">
        <a class="nav-link" href="users.php">
          <i class="fas fa-fw fa-tachometer-alt"></i>
          <span>Dashboard</span>
        </a>
      </li>
      
      <div class="sidebar-heading">CLIENTES</div>
      <li class="nav-item">
        <a class="nav-link" href="users_create.php">
          <i class="fas fa-fw fa-user-plus"></i>
          <span>Novo Cliente</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="meus_clientes.php">
          <i class="fas fa-fw fa-users"></i>
          <span>MEUS CLIENTES</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="gestor.php">
          <i class="fas fa-fw fa-user-shield"></i>
          <span>Gestor de Clientes</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="dns_migration.php">
          <i class="fas fa-fw fa-exchange-alt"></i>
          <span>Migração DNS</span>
        </a>
      </li>

      <div class="sidebar-heading">GERENCIAMENTO</div>
      
      <li class="nav-item">
        <a class="nav-link" href="mRTXBGImage.php">
          <i class="fas fa-fw fa-image"></i>
          <span>Imagens de Fundo</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="mRTXBGlogo.php">
          <i class="fas fa-fw fa-smile"></i>
          <span>Alterar Logo</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="mRTXBGads.php">
          <i class="fas fa-fw fa-ad"></i>
          <span>Anúncios</span>
        </a>
      </li>
      <!-- MACS CAPTURADOS - LINK ADICIONADO -->
      <li class="nav-item">
        <a class="nav-link" href="devices.php">
          <i class="fas fa-fw fa-microchip"></i>
          <span>MACs Capturados</span>
        </a>
      </li>
      <!-- FIM DO LINK -->
      <li class="nav-item">
        <a class="nav-link" href="mRTXBGnotes.php">
          <i class="fas fa-fw fa-comment-alt"></i>
          <span>Mensagens / Avisos</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="mRTXBGlayouts.php">
          <i class="fas fa-fw fa-th-large"></i>
          <span>Layouts</span>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="profile.php">
          <i class="fas fa-fw fa-user-cog"></i>
          <span>Perfil</span>
        </a>
      </li>
      
      <hr class="sidebar-divider">
      <li class="nav-item">
        <a class="nav-link text-danger font-weight-bold" href="logout.php">
          <i class="fas fa-fw fa-sign-out-alt text-danger"></i>
          <span>Sair</span>
        </a>
      </li>
      <hr class="sidebar-divider d-none d-md-block">
      <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
      </div>
    </ul>

    <div id="content-wrapper" class="d-flex flex-column">
      <div id="content">
        <nav class="navbar navbar-expand navbar-light topbar mb-4 static-top shadow">
          <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
            <i class="fa fa-bars"></i>
          </button>
          <div class="mr-auto ml-md-3 my-2 my-md-0 mw-100 d-flex align-items-center">
            <a href="logout.php" class="btn btn-danger btn-sm mr-3 shadow-sm">
                <i class="fas fa-sign-out-alt"></i> <span class="d-none d-md-inline">Sair</span>
            </a>
            <h1 class="h4 mb-0 text-gray-800">Painel Administrativo</h1>
          </div>
          <ul class="navbar-nav ml-auto">
            <div class="topbar-divider d-none d-sm-block"></div>
            <li class="nav-item dropdown no-arrow">
              <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="mr-2 d-none d-lg-inline text-gray-600 small"><?php echo $IIIIIIIlI11l; ?></span>
                <img class="img-profile rounded-circle" src="<?php echo $IIIIIIIlI111 ? $IIIIIIIlI111 : 'img/logo.png'; ?>" width="30">
              </a>
            </li>
          </ul>
        </nav>