{{--
    LAYOUT ORIGINALE NETGESCON
    Replica del layout originale semplice e pulito
--}}
<!DOCTYPE html>
<html lang="it">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>{{ $pageTitle ?? 'NetGesCon' }} - Sistema Gestione Condominiale</title>
    
    {{-- CSS Framework --}}
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f8f9fa;
        }
        
        /* Header blu */
        .netgescon-header {
            background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
            color: white;
            padding: 0.75rem 1rem;
            position: relative;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .header-center {
            text-align: center;
            flex-grow: 1;
        }
        
        .header-center h4 {
            margin: 0;
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .header-center small {
            opacity: 0.9;
            font-size: 0.85rem;
        }
        
        .header-right {
            display: flex;
            align-items: center;
            gap: 1rem;
            font-size: 0.9rem;
        }
        
        .user-info {
            text-align: right;
        }
        
        .user-info .badge {
            font-size: 0.75rem;
            margin-left: 0.5rem;
        }
        
        /* Layout principale */
        .main-layout {
            display: flex;
            min-height: calc(100vh - 60px);
        }
        
        /* Sidebar gialla/arancione */
        .netgescon-sidebar {
            width: 250px;
            background: linear-gradient(180deg, #ffc107 0%, #ff9800 100%);
            box-shadow: 2px 0 4px rgba(0,0,0,0.1);
            overflow-y: auto;
        }
        
        .sidebar-header {
            padding: 1rem;
            text-align: center;
            border-bottom: 1px solid rgba(0,0,0,0.1);
        }
        
        .sidebar-header h5 {
            color: #333;
            margin: 0;
            font-weight: 600;
        }
        
        .sidebar-header small {
            color: #666;
            font-size: 0.8rem;
        }
        
        /* Menu sidebar */
        .sidebar-menu {
            padding: 0;
            list-style: none;
            margin: 0;
        }
        
        .sidebar-menu li {
            border-bottom: 1px solid rgba(0,0,0,0.05);
        }
        
        .sidebar-menu a {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            color: #333;
            text-decoration: none;
            transition: all 0.2s ease;
        }
        
        .sidebar-menu a:hover {
            background-color: rgba(0,0,0,0.1);
            color: #000;
        }
        
        .sidebar-menu a.active {
            background-color: rgba(0,0,0,0.15);
            color: #000;
            font-weight: 600;
        }
        
        .sidebar-menu i {
            margin-right: 0.75rem;
            width: 20px;
            text-align: center;
            color: #555;
        }
        
        /* Area contenuto */
        .content-area {
            flex: 1;
            padding: 1.5rem;
            background-color: #f8f9fa;
            overflow-y: auto;
        }
        
        /* Cards semplici */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .stat-card {
            background: white;
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            text-align: center;
        }
        
        .stat-card h3 {
            margin: 0 0 0.5rem 0;
            color: #333;
            font-size: 2rem;
            font-weight: 700;
        }
        
        .stat-card p {
            margin: 0;
            color: #666;
            font-size: 0.9rem;
        }
        
        .stat-card i {
            font-size: 2.5rem;
            color: #4a90e2;
            margin-bottom: 1rem;
        }
        
        /* Action cards */
        .action-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }
        
        .action-card {
            background: white;
            border-radius: 8px;
            padding: 1.5rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            text-align: center;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        
        .action-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }
        
        .action-card i {
            font-size: 2rem;
            margin-bottom: 1rem;
        }
        
        .action-card h6 {
            margin: 0;
            color: #333;
            font-weight: 600;
        }
        
        /* Footer */
        .netgescon-footer {
            background-color: #f1f1f1;
            padding: 1rem;
            text-align: center;
            border-top: 1px solid #ddd;
        }
        
        .netgescon-footer small {
            color: #666;
        }
        
        /* Responsive */
        @media (max-width: 768px) {
            .main-layout {
                flex-direction: column;
            }
            
            .netgescon-sidebar {
                width: 100%;
                height: auto;
            }
            
            .header-content {
                flex-direction: column;
                gap: 0.5rem;
            }
        }
    </style>
    
    @stack('styles')
</head>
<body>
    {{-- Header --}}
    <header class="netgescon-header">
        <div class="header-content">
            <div class="header-left">
                <small>
                    <i class="fas fa-home me-1"></i>
                    NetGesCon v2.1.0 - Sistema Gestione Condominiale
                </small>
            </div>
            
            <div class="header-center">
                <h4>{{ $headerTitle ?? 'Condominio Roma Centro' }}</h4>
                <small>{{ $headerSubtitle ?? 'CF: 1234567890 | Saldo: €12.350,00' }}</small>
            </div>
            
            <div class="header-right">
                <div class="user-info">
                    <span>
                        <i class="fas fa-user-shield me-1"></i>
                        {{ auth()->user()->name }}
                    </span>
                    <span class="badge bg-light text-dark">Amministratore</span>
                </div>
            </div>
        </div>
    </header>
    
    {{-- Layout principale --}}
    <div class="main-layout">
        {{-- Sidebar --}}
        <nav class="netgescon-sidebar">
            <div class="sidebar-header">
                <h5>
                    <i class="fas fa-building text-primary me-2"></i>
                    NetGesCon
                </h5>
                <small>v2.1.0 - Sistema Gestione Condominiale</small>
            </div>
            
            <ul class="sidebar-menu">
                <li>
                    <a href="{{ route('dashboard') }}" class="{{ request()->routeIs('dashboard') ? 'active' : '' }}">
                        <i class="fas fa-tachometer-alt"></i>
                        Dashboard
                    </a>
                </li>
                <li>
                    <a href="{{ route('admin.stabili.index') }}">
                        <i class="fas fa-building"></i>
                        Stabili
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-users"></i>
                        Condomini
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-calculator"></i>
                        Contabilità
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-users-cog"></i>
                        Assemblee
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-chart-line"></i>
                        Risorse Economiche
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-envelope"></i>
                        Comunicazioni
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-file-alt"></i>
                        Affitti
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-handshake"></i>
                        Pratiche
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-shopping-cart"></i>
                        Consumi
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-ticket-alt"></i>
                        Tickets
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="fas fa-cog"></i>
                        Impostazioni
                    </a>
                </li>
            </ul>
        </nav>
        
        {{-- Area contenuto --}}
        <main class="content-area">
            {{ $slot }}
        </main>
    </div>
    
    {{-- Footer --}}
    <footer class="netgescon-footer">
        <small>
            © 2025 NetGesCon - Gestione Condominiale v2.1.0 | 
            <a href="#" class="text-decoration-none">Supporto</a> • 
            <a href="#" class="text-decoration-none">Contatti</a> • 
            <a href="#" class="text-decoration-none">www.netgescon.it</a>
        </small>
    </footer>
    
    {{-- JavaScript --}}
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    @stack('scripts')
</body>
</html>
