@extends('layouts.admin')
@section('content')
  <div class="dashboard-shell">
    <div class="dashboard-hero">
      <div>
        <span class="dashboard-kicker">Overview</span>
        <h2>{{ $dashboardTitle }}</h2>
        <p>{{ $dashboardSubtitle }}</p>
      </div>
      <div class="dashboard-meta">
        <span>Updated</span>
        <strong>{{ now()->format('d M Y, h:i A') }}</strong>
      </div>
    </div>

    <div class="row dashboard-grid">
      @foreach($dashboardStats as $stat)
        <div class="col-xl-3 col-md-6 col-12">
          <a class="dashboard-stat-card tone-{{ $stat['tone'] }}" href="{{ $stat['url'] }}">
            <div class="dashboard-stat-top">
              <span class="dashboard-icon">
                <i data-feather="{{ $stat['icon'] }}"></i>
              </span>
              <span class="dashboard-arrow">Open</span>
            </div>
            <div class="dashboard-stat-value">
              {{ is_numeric($stat['value']) ? number_format((float) $stat['value']) : $stat['value'] }}
            </div>
            <div class="dashboard-stat-label">{{ $stat['label'] }}</div>
            <p>{{ $stat['help'] }}</p>
          </a>
        </div>
      @endforeach
    </div>

    <div class="row dashboard-lower">
      <div class="col-lg-7 col-12">
        <div class="dashboard-panel">
          <div class="dashboard-panel-head">
            <h3>Quick Access</h3>
            <span>Frequently used admin actions</span>
          </div>
          <div class="dashboard-links">
            @foreach($dashboardQuickLinks as $link)
              <a href="{{ $link['url'] }}">{{ $link['label'] }}</a>
            @endforeach
          </div>
        </div>
      </div>
      <div class="col-lg-5 col-12">
        <div class="dashboard-panel dashboard-panel-compact">
          <div class="dashboard-panel-head">
            <h3>Highlights</h3>
            <span>Important counters at a glance</span>
          </div>
          <div class="dashboard-highlight-list">
            @foreach($dashboardHighlights as $highlight)
              <div class="dashboard-highlight-item">
                <span>{{ $highlight['label'] }}</span>
                <strong>{{ is_numeric($highlight['value']) ? number_format((float) $highlight['value']) : $highlight['value'] }}</strong>
              </div>
            @endforeach
          </div>
        </div>
      </div>
    </div>
  </div>
@endsection
