<?php header('Content-Type: text/html; charset=utf-8'); ini_set('default_charset','UTF-8'); if(function_exists('mb_internal_encoding')) mb_internal_encoding('UTF-8'); ?>
<?php
// require_once dirname(__FILE__) . '/includes/read_only_guard.php'; // File missing
?>
<!DOCTYPE html>
<html lang="bn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Office System Dashboard</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background-color: #f8f9fa;
        }
        .dashboard-card {
            transition: transform 0.3s;
            height: 100%;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }
        .dashboard-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }
        .card-icon {
            font-size: 2.5rem;
            margin-bottom: 15px;
            color: #0d6efd;
        }
        .dashboard-title {
            color: #2c3e50;
            margin-bottom: 30px;
            font-weight: bold;
            border-bottom: 2px solid #0d6efd;
            display: inline-block;
            padding-bottom: 10px;
        }
        .navbar-brand {
            font-weight: bold;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-4">
        <div class="container">
            <a class="navbar-brand" href="index.php">Office System</a>
            <div class="d-flex align-items-center">
                <?php
                    // Show connection status based on saved cookies
                    $connLabel = '&#2437;&#2475;&#2482;&#2494;&#2439;&#2472;';
                    $connClass = 'text-danger';
                    if (file_exists(__DIR__ . '/ProxyHelper.php')) {
                        require_once __DIR__ . '/ProxyHelper.php';
                        if (class_exists('ProxyHelper')) {
                            $ph = new ProxyHelper();
                            // Check if getCookies method exists before calling
                            if (method_exists($ph, 'getCookies') && !empty($ph->getCookies())) {
                                $connLabel = '&#2437;&#2472;&#2482;&#2494;&#2439;&#2472;';
                                $connClass = 'text-success';
                            }
                        }
                    }
                ?>
                <span class="badge bg-light me-2" id="connectionStatus">
                    <i class="fas fa-wifi <?php echo $connClass; ?>"></i> <?php echo $connLabel; ?>
                </span>
            </div>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link text-white" href="connect-setup.php"><i class="fas fa-plug"></i> &#2437;&#2463;&#2507; &#2453;&#2494;&#2472;&#2503;&#2453;&#2509;&#2463;</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white" href="session-manager.php"><i class="fas fa-user-clock"></i> সেশন ম্যানেজার</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white text-warning fw-bold" href="button-diagnostics.php"><i class="fas fa-circle-check text-warning"></i> বাটন ডায়াগনস্টিকস</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white" href="settings.php"><i class="fas fa-cog"></i> &#2488;&#2503;&#2463;&#2495;&#2434;&#2488;</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white" href="book_search.php"><i class="fas fa-book"></i> নিবন্ধন বই</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white" href="application-print.php"><i class="fas fa-file-alt"></i> আবেদন পত্র</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link text-white" href="index.php"><i class="fas fa-home"></i> হোম</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    <div class="container">
