<?php
declare(strict_types=1);

require_once __DIR__ . '/db.php';
require_once __DIR__ . '/functions.php';

require_once __DIR__ . '/security/session.php';
require_once __DIR__ . '/security/headers.php';
require_once __DIR__ . '/security/escape.php';
require_once __DIR__ . '/security/validate.php';
require_once __DIR__ . '/security/response.php';
require_once __DIR__ . '/security/csrf.php';
require_once __DIR__ . '/security/rate_limit.php';
require_once __DIR__ . '/security/action_forms.php';

function require_auth(): void {
  global $authVar, $dbIsLatest;
  if (!isset($_SESSION[$authVar]) || !$dbIsLatest) {
    header('Location: index.php');
    exit;
  }
}

// Tabler inline icon helper (optional)
@include_once __DIR__ . '/templates/tabler/icons.php';
