<?php
session_start();
require '../includes/db.php';
if (!isset($_SESSION['user_id'])) { header("Location: ../login.php"); exit(); }
$settings = $conn->query("SELECT * FROM settings WHERE id=1")->fetch_assoc();
$primary = $settings['theme_primary'] ?? '#034C44';
?>
<!DOCTYPE html>
<html lang="bn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>রিবেট</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-gray-100">

    <div class="p-4 flex items-center text-white sticky top-0 z-50" style="background-color: <?php echo $primary; ?>;">
        <a href="account.php" class="mr-4"><i class="fas fa-chevron-left text-xl"></i></a>
        <h1 class="text-lg font-bold">রিবেট</h1>
    </div>

    <div class="flex bg-white shadow-sm">
        <a href="#" class="flex-1 text-center py-3 text-gray-500 border-b-2 border-transparent">ম্যানুয়াল রিবেট</a>
        <a href="#" class="flex-1 text-center py-3 text-teal-600 font-bold border-b-2 border-teal-600">রিবেট ইতিহাস</a>
    </div>

    <div class="flex justify-between px-4 py-2 bg-red-400 text-white text-sm font-bold mt-2 mx-2 rounded-t">
        <span>তারিখ</span>
        <span>পরিমাণ (৳)</span>
    </div>

    <div class="mx-2 bg-white rounded-b shadow-sm">
        <div class="flex justify-between px-4 py-3 border-b border-gray-100 text-sm">
            <span class="text-gray-600"><?php echo date('Y-m-d'); ?></span>
            <span class="font-bold text-teal-600">0.0000</span>
        </div>
        <div class="flex justify-between px-4 py-3 border-b border-gray-100 text-sm">
            <span class="text-gray-600"><?php echo date('Y-m-d', strtotime('-1 day')); ?></span>
            <span class="font-bold text-teal-600">0.0000</span>
        </div>
        
        <div class="p-4 mt-4">
            <button class="w-full bg-gray-200 text-gray-400 py-3 rounded text-sm font-bold">দাবি</button>
        </div>
    </div>

</body>
</html>