<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $pageTitle ?></title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 12px;
            line-height: 1.4;
            color: #333;
            background: white;
        }
        
        .page-header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 2px solid #333;
        }
        
        .page-header h1 {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .page-subtitle {
            font-size: 14px;
            color: #666;
        }
        
        .summary-cards {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .summary-card {
            border: 1px solid #ddd;
            padding: 15px;
            text-align: center;
        }
        
        .summary-card .label {
            font-size: 11px;
            color: #666;
            margin-bottom: 5px;
        }
        
        .summary-card .value {
            font-size: 18px;
            font-weight: bold;
        }
        
        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        
        .data-table th,
        .data-table td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        
        .data-table th {
            background-color: #f5f5f5;
            font-weight: bold;
            font-size: 11px;
        }
        
        .data-table td {
            font-size: 11px;
        }
        
        .data-table tfoot td {
            background-color: #f5f5f5;
            font-weight: bold;
        }
        
        .text-right {
            text-align: right;
        }
        
        .text-center {
            text-align: center;
        }
        
        .text-bold {
            font-weight: bold;
        }
        
        .text-green {
            color: #22c55e;
        }
        
        .text-red {
            color: #ef4444;
        }
        
        .text-blue {
            color: #3b82f6;
        }
        
        .badge {
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 10px;
            font-weight: bold;
        }
        
        .badge-green {
            background-color: #dcfce7;
            color: #166534;
        }
        
        .badge-red {
            background-color: #fee2e2;
            color: #991b1b;
        }
        
        .badge-blue {
            background-color: #dbeafe;
            color: #1e40af;
        }
        
        .filters-info {
            margin-bottom: 20px;
            padding: 10px;
            background-color: #f9fafb;
            border-left: 4px solid #3b82f6;
            font-size: 11px;
        }
        
        @media print {
            .no-print {
                display: none;
            }
            
            body {
                font-size: 10px;
            }
            
            .data-table th,
            .data-table td {
                padding: 6px;
                font-size: 10px;
            }
            
            .summary-cards {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
            }
        }
        
        @page {
            margin: 1cm;
        }
        
        .page-break {
            page-break-before: always;
        }
        
        .back-to-system-btn {
            display: inline-block;
            padding: 12px 24px;
            background-color: #1d4ed8;
            color: #fff;
            text-decoration: none;
            border-radius: 6px;
            font-size: 12px;
            margin: 20px 0 24px 0;
        }
    </style>
</head>
<body>
    <div class="no-print" style="margin-bottom: 16px;">
        <a href="<?= APP_URL ?>/reports" class="back-to-system-btn">Back to Report</a>
    </div>
    <div class="page-header">
        <h1><?= $pageTitle ?></h1>
        <div class="page-subtitle">Generated on <?= date('Y-m-d H:i:s') ?></div>
    </div>
    
    <?= $content ?>
    
    <div class="no-print" style="margin-top: 40px; text-align: center;">
        <p style="color: #666; font-size: 11px;">
            This report was generated from TellerPro Inventory Management System<br>
            Page <?= date('Y-m-d H:i:s') ?>
        </p>
    </div>
    
    <script>
        window.onload = function() {
            window.print();
        };
    </script>
</body>
</html>
