{% extends "base.html" %}

{% block title %}Staff Dashboard - ScanLook{% endblock %}

{% block content %}
<div class="dashboard-container">
    <!-- Mode Selector (only for admins) -->
    {% if session.role in ['owner', 'admin'] %}
    <div class="mode-selector">
        <a href="{{ url_for('admin_dashboard') }}" class="mode-btn">
            👔 Admin Console
        </a>
        <button class="mode-btn mode-btn-active">
            📦 Scanning Mode
        </button>
    </div>
    {% endif %}

    <div class="dashboard-header">
        <a href="{{ url_for('home') }}" class="btn btn-secondary btn-sm" style="margin-bottom: var(--space-md);">
            <i class="fa-solid fa-arrow-left"></i> Back to Home
        </a>
        <h1 class="page-title">Select Count Session</h1>
    </div>

    {% if sessions %}
        <div class="sessions-list">
            {% for s in sessions %}
            <a href="{{ url_for('invcount.count_session', session_id=s.session_id) }}" class="session-list-item">
                <div class="session-list-info">
                    <h3 class="session-list-name">{{ s.session_name }}</h3>
                    <span class="session-list-type">{{ 'Full Physical' if s.session_type == 'full_physical' else 'Cycle Count' }}</span>
                </div>
                <div class="session-list-action">
                    <span class="arrow-icon">→</span>
                </div>
            </a>
            {% endfor %}
        </div>
    {% else %}
        <div class="empty-state">
            <div class="empty-icon">📋</div>
            <h2 class="empty-title">No Active Sessions</h2>
            <p class="empty-text">No count sessions are currently active. Please contact your administrator.</p>
        </div>
    {% endif %}
</div>
{% endblock %}
