<?php
declare(strict_types=1);
$bp = Auth::basePath();
$proj = '/app/androidcast_project';
?>
<div class="console-home">
  <div class="toolbar reports-toolbar console-home-toolbar">
    <h1 data-i18n="home.title">Console</h1>
    <div class="toolbar-actions">
      <label class="toolbar-select">
        <span data-i18n="theme.label">Theme</span>
        <select id="theme-select" aria-label="UI theme" data-i18n-options="theme">
          <option value="dark" data-i18n="theme.dark">Dark</option>
          <option value="light" data-i18n="theme.light">Light</option>
        </select>
      </label>
    </div>
  </div>
  <p class="console-home-intro" data-i18n="home.intro">Issue triage, tickets, and session metrics — pick a workspace below.</p>

  <div class="cards cards--lift console-home-cards">
    <a href="<?= h($bp) ?>/?view=reports" class="card card--lift console-home-card">
      <span class="nav-icon nav-icon--reports" aria-hidden="true"></span>
      <h2 data-i18n="home.card_issues">Issues</h2>
      <p class="muted" data-i18n="home.card_issues_desc">Browse and triage issues, tags, and fingerprints.</p>
    </a>
    <button type="button" class="card card--lift console-home-card console-home-card--btn js-new-issue-btn">
      <span class="nav-icon nav-icon--reports" aria-hidden="true"></span>
      <h2 data-i18n="issues.new">New issue</h2>
      <p class="muted" data-i18n="home.card_new_issue_desc">Log a new issue or task in one step.</p>
    </button>
    <a href="<?= h($bp) ?>/?view=tickets" class="card card--lift console-home-card">
      <span class="nav-icon nav-icon--tickets" aria-hidden="true"></span>
      <h2 data-i18n="nav.tickets">Tickets</h2>
      <p class="muted" data-i18n="home.card_tickets_desc">Roadmap tasks, QA items, and workflow tags.</p>
    </a>
    <button type="button" class="card card--lift console-home-card console-home-card--btn js-new-ticket-btn">
      <span class="nav-icon nav-icon--tickets" aria-hidden="true"></span>
      <h2 data-i18n="tickets.new">New ticket</h2>
      <p class="muted" data-i18n="home.card_new_ticket_desc">Create a roadmap or QA ticket in one step.</p>
    </button>
    <a href="<?= h($proj) ?>/graphs/" class="card card--lift console-home-card">
      <span class="nav-icon nav-icon--graphs" aria-hidden="true"></span>
      <h2 data-i18n="home.card_graphs">Graphs</h2>
      <p class="muted" data-i18n="home.card_graphs_desc">Sessions, issues, and device activity over time.</p>
    </a>
    <?php if (Rbac::can('short_links_view')): ?>
    <a href="<?= h($bp) ?>/?view=short_links" class="card card--lift console-home-card">
      <span class="nav-icon nav-icon--link" aria-hidden="true"></span>
      <h2 data-i18n="home.card_short_links">Short links</h2>
      <p class="muted" data-i18n="home.card_short_links_desc">Mint bearer tokens and shorten URLs for s.f0xx.org.</p>
    </a>
    <?php endif; ?>
  </div>

  <h2 class="console-home-more" data-i18n="home.more">All services</h2>
  <?php $skip_home_link = true; require __DIR__ . '/console_quick_links.php'; ?>
</div>
