/* ==========================================================================
   SISTEMA DI STILE ECO CITY 2026 - VERSIONE INTEGRATA "ZERO ERRORI"
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&display=swap');

:root {
    --eco-green: #37b34a;
    --eco-dark-green: #198754;
    --eco-blue: #0d6efd;
    --eco-danger: #dc3545;
    --eco-light-bg: #f4f7f6;
    --eco-transition: all 0.3s ease;
}

/* --- RESET E LAYOUT BASE --- */
* { box-sizing: border-box; }

body { 
    font-family: 'Montserrat', sans-serif !important; 
    margin: 0; 
    padding: 0;
    background-color: var(--eco-light-bg);
    color: #333;
    min-height: 100vh;
}

/* --- SCHERMATA DI LOGIN --- */
body.login-body { 
    background-color: #e9ecef !important; 
    display: flex !important; 
    align-items: center !important; 
    justify-content: center !important;
    height: 100vh;
}

.login-card { 
    background: #ffffff; 
    width: 100%; 
    max-width: 400px; 
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    text-align: left;
}

.login-header { text-align: center; margin-bottom: 25px; }
.pwd-wrapper { position: relative; width: 100%; }
.eye-icon { position: absolute; right: 12px; top: 12px; cursor: pointer; color: #666; z-index: 10; }

.btn-login { 
    background-color: var(--eco-blue); 
    color: white; border: none; width: 100%; padding: 12px; 
    font-weight: 700; border-radius: 8px; margin-top: 15px;
    cursor: pointer;
}

/* --- HOME PAGE (Griglia 3x2) --- */
.main-container-home {
    width: 95%;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 25px;
    padding: 60px 30px;
    margin: 20px auto;
    position: relative; 
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* LOGO SOLO NELLA HOME: 130px */
.main-container-home .logo-top-left {
    position: absolute !important;
    top: 30px;
    left: 35px;
    z-index: 100;
    display: block !important;
    max-height: none !important; /* Rimuove il limite dei 50px del contenitore */
}

.main-container-home .logo-top-left img {
    height: 130px !important;    /* Altezza specifica richiesta */
    width: auto !important;
    max-height: 130px !important;
    display: block !important;
    object-fit: contain !important;
}

.logout-link-top { position: absolute !important; top: 35px; right: 35px; z-index: 100; color: var(--eco-danger) !important; font-weight: 700; text-decoration: none !important; }

.welcome-title { font-size: 2.2rem !important; font-weight: 800; margin-bottom: 10px !important; color: #212529; }
.welcome-name { color: var(--eco-green); }
.home-content p.text-secondary { font-size: 1.3rem !important; font-weight: 500; margin-bottom: 40px !important; color: #6c757d !important; }

.card-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.card-eco {
    background: #fdfdfd;
    border-radius: 20px;
    padding: 35px 20px;
    border: 1px solid #eee;
    transition: var(--eco-transition);
    text-decoration: none !important;
    color: #212529 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-eco i { font-size: 2.8rem; color: var(--eco-green); margin-bottom: 15px; }
.card-eco h4 { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; }
.card-eco:hover { border-color: var(--eco-blue) !important; transform: translateY(-5px); box-shadow: 0 10px 20px rgba(13, 110, 253, 0.1); }
.card-eco:hover i, .card-eco:hover h4 { color: var(--eco-blue) !important; }

/* --- AREA RISERVATA: NAVBAR (Logo 45px) --- */
.eco-navbar {
    background-color: var(--eco-dark-green) !important;
    padding: 10px 30px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    min-height: 80px !important;
    width: 100% !important;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* LOGO NELLE NAVBAR: 45px */
.eco-navbar .nav-logo img, 
.eco-navbar img {
    height: 45px !important;
    width: auto !important;
    max-height: 45px !important;
    display: block !important;
    object-fit: contain !important;
}

.nav-custom-links {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}

.nav-item-custom {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 8px 15px !important;
    border-radius: 12px !important;
    color: white !important;
    text-decoration: none !important;
    min-width: 120px !important;
    height: 65px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
    transition: var(--eco-transition);
}

.nav-item-custom i { font-size: 1.3rem !important; margin-bottom: 4px !important; }
.nav-item-custom:hover, .nav-item-custom.active { background: white !important; color: var(--eco-dark-green) !important; }

/* --- TABELLE E BOTTONI GESTIONALI --- */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: white; border-radius: 10px; overflow: hidden; }
.admin-table th { background: #f8f9fa; padding: 15px; border-bottom: 2px solid #dee2e6; text-align: left; font-weight: 700; }
.admin-table td { padding: 12px; border-bottom: 1px solid #eee; vertical-align: middle; }

.btn-success, .btn-primary, .btn-danger, a.btn-success, a.btn-primary {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    border: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .card-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .main-container-home .logo-top-left img { height: 80px !important; }
}

@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr !important; }
    .eco-navbar { flex-direction: column !important; height: auto !important; padding: 15px !important; }
    .nav-custom-links { flex-wrap: wrap; justify-content: center; }
    .main-container-home .logo-top-left { position: relative !important; top: 0; left: 0; margin: 0 auto 20px; }
}