@extends('admin.layouts.netgescon')

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="d-flex justify-content-between align-items-center mb-4">
                <h1><i class="fas fa-building"></i> Condomini</h1>
                <a href="{{ route('admin.condomini.create') }}" class="btn btn-primary">
                    <i class="fas fa-plus"></i> Nuovo Condominio
                </a>
            </div>

            {{-- Dashboard Condomini --}}
            <div class="row mb-4">
                <div class="col-md-3">
                    <div class="card text-center">
                        <div class="card-body">
                            <h5 class="card-title">Condomini Totali</h5>
                            <h3 class="text-primary">{{ $stats['totali'] ?? 248 }}</h3>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="card text-center">
                        <div class="card-body">
                            <h5 class="card-title">Attivi</h5>
                            <h3 class="text-success">{{ $stats['attivi'] ?? 235 }}</h3>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="card text-center">
                        <div class="card-body">
                            <h5 class="card-title">Morosi</h5>
                            <h3 class="text-warning">{{ $stats['morosi'] ?? 8 }}</h3>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="card text-center">
                        <div class="card-body">
                            <h5 class="card-title">Sospesi</h5>
                            <h3 class="text-danger">{{ $stats['sospesi'] ?? 5 }}</h3>
                        </div>
                    </div>
                </div>
            </div>

            {{-- Lista Condomini --}}
            <div class="card">
                <div class="card-header">
                    <h5>Lista Condomini</h5>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>Nome</th>
                                    <th>Codice</th>
                                    <th>Stabile</th>
                                    <th>Stato</th>
                                    <th>Azioni</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Mario Rossi</td>
                                    <td>CDM001</td>
                                    <td>Milano Centro</td>
                                    <td><span class="badge bg-success">Attivo</span></td>
                                    <td>
                                        <a href="#" class="btn btn-sm btn-outline-primary">Modifica</a>
                                        <a href="#" class="btn btn-sm btn-outline-info">Dettagli</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
