{{-- Test page per verificare il funzionamento della sidebar --}}
@extends('layouts.app')

@section('content')
<div class="container-fluid">
    <div class="row">
        {{-- Sidebar --}}
        <div class="col-md-3 col-lg-2 sidebar">
            @include('components.menu.sidebar')
        </div>
        
        {{-- Main Content --}}
        <div class="col-md-9 col-lg-10 ms-sm-auto px-md-4">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
                <h1 class="h2">Test Sidebar Modulare NetGesCon</h1>
            </div>
            
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h5 class="card-title">Test Sistema Permessi</h5>
                        </div>
                        <div class="card-body">
                            <h6>Ruolo Corrente: <span class="badge bg-primary">{{ App\Helpers\MenuHelper::getCurrentUserRole() }}</span></h6>
                            
                            <h6 class="mt-3">Permessi Menu:</h6>
                            <ul class="list-group">
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    Dashboard
                                    @if(App\Helpers\MenuHelper::canUserAccessMenu('dashboard'))
                                        <span class="badge bg-success rounded-pill">Permesso</span>
                                    @else
                                        <span class="badge bg-danger rounded-pill">Negato</span>
                                    @endif
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    Stabili
                                    @if(App\Helpers\MenuHelper::canUserAccessMenu('stabili'))
                                        <span class="badge bg-success rounded-pill">Permesso</span>
                                    @else
                                        <span class="badge bg-danger rounded-pill">Negato</span>
                                    @endif
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    Condomini
                                    @if(App\Helpers\MenuHelper::canUserAccessMenu('condomini'))
                                        <span class="badge bg-success rounded-pill">Permesso</span>
                                    @else
                                        <span class="badge bg-danger rounded-pill">Negato</span>
                                    @endif
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    Contabilità
                                    @if(App\Helpers\MenuHelper::canUserAccessMenu('contabilita'))
                                        <span class="badge bg-success rounded-pill">Permesso</span>
                                    @else
                                        <span class="badge bg-danger rounded-pill">Negato</span>
                                    @endif
                                </li>
                                <li class="list-group-item d-flex justify-content-between align-items-center">
                                    Fiscale
                                    @if(App\Helpers\MenuHelper::canUserAccessMenu('fiscale'))
                                        <span class="badge bg-success rounded-pill">Permesso</span>
                                    @else
                                        <span class="badge bg-danger rounded-pill">Negato</span>
                                    @endif
                                </li>
                            </ul>
                            
                            <div class="mt-3">
                                <small class="text-muted">
                                    Se vedi questa pagina senza errori, la sidebar modulare funziona correttamente!
                                </small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
