/* ============================================================
   admin.css — Stili Area Riservata Agenzia Mediterranea
   Palette: Blu Mare #1a5276 | Oro #d4a017 | Azzurro #5dade2
   ============================================================ */

/* ==================== VARIABILI ==================== */
:root {
    --blu-mare: #1a5276;
    --blu-notte: #0f3057;
    --azzurro: #5dade2;
    --oro: #d4a017;
    --oro-scuro: #b8860b;
    --bianco: #ffffff;
    --grigio-chiaro: #f5f7fa;
    --grigio-medio: #e0e6ed;
    --grigio-scuro: #6c757d;
    --rosso: #dc3545;
    --verde: #28a745;
    
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(15, 48, 87, 0.15);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #b8dce8 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--blu-notte);
}

/* ==================== LOGIN PAGE ==================== */
.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--blu-notte) 0%, var(--blu-mare) 50%, var(--azzurro) 100%);
    z-index: -2;
}

.login-wave {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 40%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.1)' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

.login-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--glass-shadow);
    animation: loginAppear 0.6s ease-out;
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 250px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.login-logo h2 {
    color: var(--bianco);
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Alert */
.login-alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

.login-alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b7a;
}

.login-alert-success {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #6bcf7f;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field label i {
    margin-right: 6px;
    color: var(--oro);
}

.login-field input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: var(--bianco);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-field input::placeholder {
    color: rgba(255,255,255,0.4);
}

.login-field input:focus {
    outline: none;
    border-color: var(--oro);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.15);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px !important; /* spazio fisso per il bottone */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 82, 118, 0.3); /* sfondo semi-trasparente blu mare */
    border: 1px solid rgba(212, 160, 23, 0.3); /* bordo oro tenue */
    border-radius: 50%;
    color: var(--oro); /* colore oro, sempre visibile */
    cursor: pointer;
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10; /* sopra l'input */
}

.toggle-password:hover {
    background: var(--oro);
    color: var(--blu-notte);
    transform: translateY(-50%) scale(1.1);
}

.login-field input[type="password"],
.login-field input[type="text"] {
    padding: 14px 50px 14px 16px !important; /* padding-right aumentato */
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--oro);
}

/* Bottone Login */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--oro) 0%, var(--oro-scuro) 100%);
    border: none;
    border-radius: 50px;
    color: var(--bianco);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 160, 23, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

/* Footer login */
.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.login-footer i {
    color: var(--oro);
}

.login-copyright {
    margin-top: 8px;
    font-size: 0.75rem;
}

/* ==================== SIDEBAR ==================== */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--blu-notte) 0%, var(--blu-mare) 100%);
    color: var(--bianco);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}

.sidebar-logo {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo img {
    max-width: 180px;
    margin-bottom: 10px;
}

.sidebar-logo span {
    display: block;
    font-size: 0.8rem;
    color: var(--oro);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.08);
    color: var(--bianco);
    border-left-color: var(--oro);
}

.sidebar-nav li.active a {
    background: rgba(212, 160, 23, 0.15);
    color: var(--oro);
    border-left-color: var(--oro);
    font-weight: 500;
}

.sidebar-nav li.active a i {
    color: var(--oro);
}

.sidebar-nav li i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-divider {
    padding: 15px 25px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.8);
    pointer-events: none;
}

.sidebar-help a {
    color: var(--azzurro) !important;
}

.sidebar-help a:hover {
    color: var(--bianco) !important;
}

.sidebar-logout {
    margin-top: auto;
}

.sidebar-logout a {
    color: #ff6b7a !important;
}

.sidebar-logout a:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    border-left-color: var(--rosso) !important;
}

.sidebar-footer {
    padding: 15px;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ==================== MAIN CONTENT ==================== */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    min-height: 100vh;
}

.admin-mobile-header {
    display: none;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--blu-mare);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
}

.admin-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--blu-mare);
    font-weight: 500;
}

/* Dashboard */
.dashboard-content h2 {
    color: var(--blu-mare);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.dashboard-content > p {
    color: var(--grigio-scuro);
    margin-bottom: 30px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dash-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
}

.dash-card i {
    font-size: 2.5rem;
    color: var(--oro);
    margin-bottom: 15px;
}

.dash-card h3 {
    color: var(--blu-mare);
    font-size: 1rem;
    margin-bottom: 10px;
}

.dash-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blu-notte);
}

/* ==================== FORM ADMIN ==================== */

.form-card {
    max-width: 500px;
    padding: 30px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--blu-mare);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--oro);
    margin-right: 6px;
    width: 18px;
}

.form-group input {
    padding: 14px 45px 14px 16px;
    border: 2px solid var(--grigio-medio);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bianco);
    color: var(--blu-notte);
}

.form-group input:focus {
    outline: none;
    border-color: var(--oro);
    box-shadow: 0 0 0 4px rgba(212, 160, 23, 0.1);
}

.form-hint {
    color: var(--grigio-scuro);
    font-size: 0.8rem;
}

/* Password wrapper nei form admin */
.form-group .password-wrapper {
    position: relative;
}

.form-group .password-wrapper input {
    width: 100%;
}

.form-group .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--grigio-scuro);
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    z-index: 10;
}

.form-group .toggle-password:hover {
    color: var(--oro);
}

/* Bottoni form */
.form-actions {
    margin-top: 10px;
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--oro) 0%, var(--oro-scuro) 100%);
    border: none;
    border-radius: 50px;
    color: var(--bianco);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.3);
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #c0392b;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #27ae60;
}

/* Info card */
.info-card {
    padding: 25px;
    max-width: 500px;
}

.info-card h3 {
    color: var(--blu-mare);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-card p {
    color: var(--grigio-scuro);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.info-card strong {
    color: var(--blu-mare);
}

.page-subtitle {
    color: var(--grigio-scuro);
    margin-bottom: 25px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 15px;
    }
    
    .admin-mobile-header {
        display: flex;
    }
    
    .login-container {
        margin: 20px;
        padding: 30px 20px;
    }
}

/* ============================================================
   FORM INSERIMENTO IMMOBILE
   ============================================================ */

/* ── Layout a griglia ─────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Sezioni form ─────────────────────────────────────────── */
.form-sezione {
    background: var(--glass-bg, rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.5));
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-sezione h3 {
    color: var(--blu-mare, #1a5276);
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--oro, #d4a017);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-sezione-full {
    max-width: 100%;
}

/* ── Gruppi form ────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    color: var(--testo-scuro, #0f3057);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(26, 82, 118, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--testo-scuro, #0f3057);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--blu-mare, #1a5277);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

.form-control::placeholder {
    color: rgba(15, 48, 87, 0.4);
}

/* Help text sotto i campi */
.form-help {
    display: block;
    color: var(--testo-medio, #1a5276);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    opacity: 0.8;
}

/* ── Righe form ─────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-tre {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .form-row,
    .form-row-tre {
        grid-template-columns: 1fr;
    }
}

.form-group-half,
.form-group-large,
.form-group-small {
    margin-bottom: 0;
}

/* ── Prezzo con checkbox ────────────────────────────────── */
.input-prezzo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-prezzo .form-control {
    flex: 1;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--testo-scuro, #0f3057);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Checkbox card (caratteristiche) ──────────────────── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-card:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--azzurro, #5dade2);
}

.checkbox-card input[type="checkbox"] {
    display: none;
}

.checkbox-card .check-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(26, 82, 118, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blu-mare, #1a5276);
    transition: all 0.3s ease;
}

.checkbox-card input:checked + .check-icon {
    background: var(--blu-mare, #1a5276);
    color: #fff;
}

.checkbox-card input:checked ~ .check-label {
    color: var(--blu-mare, #1a5276);
    font-weight: 700;
}

.checkbox-card .check-label {
    font-size: 0.9rem;
    color: var(--testo-scuro, #0f3057);
}

/* Checkbox speciali */
.checkbox-evidenza input:checked + .check-icon {
    background: var(--oro, #d4a017);
}

.checkbox-visibile input:checked + .check-icon {
    background: #27ae60;
}

/* ── Contatore caratteri ───────────────────────────────── */
.char-counter {
    display: block;
    text-align: right;
    color: var(--testo-medio, #1a5276);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

/* ── Drop Zone Upload ───────────────────────────────────── */
.drop-zone {
    border: 2px dashed rgba(26, 82, 118, 0.3);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--blu-mare, #1a5276);
    background: rgba(255, 255, 255, 0.5);
}

.drop-zone-content {
    color: var(--blu-mare, #1a5276);
}

.drop-zone-content i {
    margin-bottom: 1rem;
    color: var(--azzurro, #5dade2);
}

.drop-zone-help {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--testo-medio, #1a5276);
    opacity: 0.7;
}

/* Anteprima foto */
.foto-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.foto-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.foto-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-preview-item.principale {
    border-color: var(--oro, #d4a017);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.3);
}

.foto-preview-item .foto-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.foto-preview-item .foto-numero {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.foto-preview-item .foto-principale-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}

.foto-preview-item .foto-principale-check input {
    cursor: pointer;
}

.foto-preview-item .foto-rimuovi {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.foto-preview-item .foto-rimuovi:hover {
    transform: scale(1.1);
}

/* ── Bottoni azione ─────────────────────────────────────── */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(26, 82, 118, 0.1);
    margin-top: 1rem;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* ── Alert validazione ──────────────────────────────────── */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--testo-medio, #1a5276);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.breadcrumb a {
    color: var(--blu-mare, #1a5276);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ── Stato errore validazione ───────────────────────────── */
.form-control.error {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

/* ── Alert messaggio validazione ────────────────────────── */
#validazione-msg {
    margin-bottom: 1.5rem;
}

/* ============================================================
   GESTIONE IMMOBILI — Tabella
   ============================================================ */

/* ── Stats bar ───────────────────────────────────────────── */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.5));
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-numero {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--blu-mare, #1a5276);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--testo-medio, #1a5276);
}

.btn-nuovo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
}

/* ── Tabella ────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    padding: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table thead {
    background: var(--blu-notte, #0f3057);
    color: #fff;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(26, 82, 118, 0.1);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ── Colonne specifiche ───────────────────────────────── */
.col-rif { width: 80px; text-align: center; }
.col-foto { width: 60px; }
.col-titolo { min-width: 200px; }
.col-localita { white-space: nowrap; }
.col-prezzo { white-space: nowrap; text-align: right; }
.col-azioni { width: 120px; text-align: center; }

/* ── Thumb foto ───────────────────────────────────────── */
.thumb-tabella {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.thumb-placeholder {
    width: 50px;
    height: 40px;
    background: rgba(26, 82, 118, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azzurro, #5dade2);
}

/* ── Badge ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-evidenza {
    background: var(--oro, #d4a017);
    color: #fff;
    margin-left: 0.3rem;
}

.badge-nascosto {
    background: #e74c3c;
    color: #fff;
    margin-left: 0.3rem;
}

.badge-categoria {
    background: rgba(26, 82, 118, 0.1);
    color: var(--blu-mare, #1a5276);
}

.badge-stato {
    background: rgba(93, 173, 226, 0.2);
    color: var(--blu-mare, #1a5276);
}

/* ── Prezzo ───────────────────────────────────────────── */
.prezzo-tabella {
    font-weight: 700;
    color: var(--oro, #d4a017);
}

.prezzo-trattativa {
    font-style: italic;
    color: var(--testo-medio, #1a5276);
    opacity: 0.7;
}

/* ── Azioni ───────────────────────────────────────────── */
.azioni-gruppo {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-vedi {
    background: rgba(93, 173, 226, 0.2);
    color: var(--azzurro, #5dade2);
}

.btn-vedi:hover {
    background: var(--azzurro, #5dade2);
    color: #fff;
}

.btn-modifica {
    background: rgba(212, 160, 23, 0.2);
    color: var(--oro, #d4a017);
}

.btn-modifica:hover {
    background: var(--oro, #d4a017);
    color: #fff;
}

.btn-elimina {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.btn-elimina:hover {
    background: #e74c3c;
    color: #fff;
}

/* ── Tabella vuota ─────────────────────────────────────── */
.tabella-vuota {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--testo-medio, #1a5276);
}

.tabella-vuota i {
    color: var(--azzurro, #5dade2);
    margin-bottom: 1rem;
}

.tabella-vuota p {
    margin-bottom: 1.5rem;
}

/* ── Responsive tabella ───────────────────────────────── */
@media (max-width: 1024px) {
    .admin-table {
        font-size: 0.8rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.6rem 0.8rem;
    }
    
    .col-foto,
    .col-categoria,
    .col-stato {
        display: none;
    }
}

@media (max-width: 768px) {
    .col-localita,
    .col-contratto {
        display: none;
    }
    
    .azioni-gruppo {
        flex-direction: column;
    }
}

/* Foto esistenti in modifica */
.foto-esistenti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.foto-esistente-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.foto-esistente-item.principale {
    border-color: var(--oro, #d4a017);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.3);
}

.foto-esistente-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-esistente-item .foto-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.foto-esistente-item .foto-principale-check {
    color: #fff;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.foto-elimina-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.foto-elimina-check input {
    display: none;
}

.foto-elimina-check:has(input:checked) {
    background: #e74c3c;
    box-shadow: 0 0 0 2px #fff;
}

/* Checkbox card checked state */
.checkbox-card.checked {
    background: rgba(26, 82, 118, 0.15);
    border-color: var(--blu-mare, #1a5276);
}

.checkbox-card.checked .check-icon {
    background: var(--blu-mare, #1a5276);
    color: #fff;
}

/* ── Foto istruzioni ───────────────────────────────────── */
.foto-istruzioni {
    color: var(--blu-mare, #1a5276);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* ── Drag & drop foto ─────────────────────────────────── */
.foto-esistente-item {
    cursor: grab;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: var(--glass-bg, rgba(255, 255, 255, 0.3));
}

.foto-esistente-item:active {
    cursor: grabbing;
}

.foto-esistente-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 100;
}

.foto-esistente-item.drag-over {
    border-color: var(--oro, #d4a017);
    border-style: dashed;
}

.foto-esistente-item.principale {
    border-color: var(--oro, #d4a017);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.3);
}

.foto-esistente-item.principale::after {
    content: '★ PRINCIPALE';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--oro, #d4a017);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.foto-esistente-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* Evita conflitti col drag */
}

.foto-esistente-item .foto-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.foto-numero {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
}

.foto-drag-icon {
    color: #fff;
    opacity: 0.7;
}

/* Elimina check */
.foto-elimina-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.8);
    color: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foto-elimina-check:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.foto-elimina-check input {
    display: none;
}

.foto-elimina-check:has(input:checked) {
    background: #e74c3c;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e74c3c;
}

/* Toast notifiche */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast-success {
    background: rgba(39, 174, 96, 0.9);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.toast-error {
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Video preview */
.video-preview-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.video-preview {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

.video-info {
    background: rgba(255,255,255,0.5);
    padding: 1rem;
    border-radius: 8px;
}

.video-info p {
    margin: 0.3rem 0;
    font-size: 0.9rem;
}

.video-mancante {
    text-align: center;
    padding: 3rem;
    color: var(--blu-mare);
    opacity: 0.6;
}

/* Drop zone specifico video */
#drop-zone-video {
    border: 2px dashed var(--azzurro);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

#drop-zone-video.dragover {
    border-color: var(--oro);
    background: rgba(212, 160, 23, 0.1);
}

#file-selezionato {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--blu-mare);
}

/* ============================================================
   HELP ONLINE — Modale Overlay
   ============================================================ */

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 48, 87, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.help-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-modal {
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);  /* da 0.7 a 0.92 */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.help-header h3 {
    margin: 0;
    color: var(--blu-mare);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--blu-mare);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.help-close:hover {
    background: rgba(212, 160, 23, 0.2);
    color: var(--oro);
}

.help-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.help-content h6 {
    color: var(--blu-mare);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-content h6:first-child {
    margin-top: 0;
}

.help-content p {
    color: var(--testo-medio);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.help-content ul {
    color: var(--testo-medio);
    font-size: 0.9rem;
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.help-content li {
    margin-bottom: 0.5rem;
}

.help-loading,
.help-error {
    text-align: center;
    padding: 2rem;
    color: var(--testo-medio);
}

.help-error {
    color: #e74c3c;
}

/* ============================================================
   FOTO — Selezione multipla e eliminazione
   ============================================================ */

/* Toolbar sopra le foto */
.foto-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(26, 82, 118, 0.1);
}

.foto-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--blu-mare);
    font-size: 0.9rem;
    font-weight: 500;
}

.foto-select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blu-mare);
    cursor: pointer;
}

/* Bottone elimina selezionate */
.btn-elimina-multi {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    pointer-events: none;
}

.btn-elimina-multi:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

.btn-elimina-multi:not(:disabled):hover {
    background: #e74c3c;
    color: #fff;
}

/* Checkbox selezione su ogni foto */
.foto-select-check {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 15;
    width: 24px;
    height: 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 2px solid rgba(26, 82, 118, 0.2);
}

.foto-select-check:hover {
    border-color: var(--blu-mare);
    background: #fff;
}

.foto-select-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--blu-mare);
    cursor: pointer;
    margin: 0;
}

/* Stato "da eliminare" */
.foto-esistente-item.da-eliminare {
    opacity: 0.35;
    filter: grayscale(100%);
    position: relative;
}

.foto-esistente-item.da-eliminare::after {
    content: 'DA ELIMINARE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.95);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 10;
    pointer-events: none;
}

/* Bottone cestino (sostituisce il label checkbox) */
.foto-elimina-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.8);
    color: #fff;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 15;
    font-size: 0.8rem;
}

.foto-elimina-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Input nascosto per eliminazione */
.input-elimina {
    display: none;
}

/* Modale conferma */
.modale-conferma-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 48, 87, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modale-conferma-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modale-conferma {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modale-conferma-overlay.active .modale-conferma {
    transform: scale(1);
}

.modale-conferma i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.modale-conferma h4 {
    color: var(--blu-notte);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.modale-conferma p {
    color: var(--grigio-scuro);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modale-conferma-bottoni {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-conferma-si {
    padding: 0.7rem 1.5rem;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-conferma-si:hover {
    background: #c0392b;
}

.btn-conferma-no {
    padding: 0.7rem 1.5rem;
    background: var(--grigio-medio);
    color: var(--blu-notte);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-conferma-no:hover {
    background: var(--grigio-scuro);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD — STATISTICHE
   ═══════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-totale .stat-icon { background: linear-gradient(135deg, #1a5276, #2980b9); }
.stat-visibili .stat-icon { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.stat-evidenza .stat-icon { background: linear-gradient(135deg, #d4a017, #f1c40f); }
.stat-visite .stat-icon { background: linear-gradient(135deg, #e74c3c, #ec7063); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-numero {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blu-mare, #1a5276);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--testo-medio, #666);
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD — GRIGLIA 2 COLONNE
   ═══════════════════════════════════════════════════════ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Posizionamento esplicito delle card nel puzzle */
#card-evidenza {
    grid-column: 1;
    grid-row: 1;
}

#card-top-mese {
    grid-column: 2;
    grid-row: 1;
}

#card-grafico {
    grid-column: 1 / span 2;
    grid-row: 2;
}

#card-grafico-12-mesi {
    grid-column: 1 / span 2;
    grid-row: 3;
}

/* Wrapper colonna non più necessario, ma lo lasciamo neutro */
.dashboard-col {
    display: contents;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--blu-mare, #1a5276);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-contatore {
    background: var(--oro, #d4a017);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-info {
    color: var(--testo-medio, #666);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ============================================================
   DASHBOARD — TOP IMMOBILI DEL MESE
   ============================================================ */

.top-mese-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 12px;
}

.top-mese-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(26, 82, 118, 0.03);
    border: 1px solid rgba(26, 82, 118, 0.08);
    transition: all 0.2s ease;
}

.top-mese-item:hover {
    background: rgba(26, 82, 118, 0.06);
    transform: translateX(3px);
}

.top-mese-pos {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--oro, #d4a017);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.top-mese-pos.oro { background: linear-gradient(135deg, #d4a017, #f1c40f); }
.top-mese-pos.argento { background: linear-gradient(135deg, #95a5a6, #bdc3c7); }
.top-mese-pos.bronzo { background: linear-gradient(135deg, #cd7f32, #e67e22); }

.top-mese-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-mese-titolo {
    font-size: 0.9rem;
    color: var(--blu-mare, #1a5276);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-mese-rif {
    font-size: 0.75rem;
    color: var(--testo-medio, #666);
}

.top-mese-visite {
    font-size: 0.85rem;
    color: var(--oro, #d4a017);
    font-weight: 700;
    white-space: nowrap;
}

/* Responsive: su schermi stretti tutto in pila */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    #card-evidenza,
    #card-grafico,
    #card-grafico-12-mesi,
    #card-top-mese {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ═══════════════════════════════════════════════════════
   EVIDENZA — LISTA CHECKBOX
   ═══════════════════════════════════════════════════════ */

.alert-evidenza {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-warning { background: #fef3cd; color: #856404; border: 1px solid #f0d78c; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #a8d5e5; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #a8d5ba; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f0b8bc; }

.evidenza-lista {
    max-height: 400px;
    padding-right: 12px;
    overflow-y: auto;
}

.evidenza-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
    margin: 8px 0;
}

.evidenza-item:hover {
    background: rgba(26, 82, 118, 0.03);
}

.evidenza-item.attivo {
    background: rgba(212, 160, 23, 0.08);
    border-color: var(--oro, #d4a017);
}

/* ═══════════════════════════════════════════════════════
   STELLA IN EVIDENZA — elemento DOM reale, non ::before
   ═══════════════════════════════════════════════════════ */

.evidenza-stella {
    display: none;
    color: var(--oro, #d4a017);
    font-size: 0.85rem;
    margin-right: 0.25rem;
}

.evidenza-item.attivo .evidenza-stella {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   CHECKBOX CUSTOM — senza Font Awesome
   ═══════════════════════════════════════════════════════ */

.evidenza-checkbox {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.evidenza-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.check-custom {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: block;
    transition: all 0.2s;
    position: relative;
}

/* Hover */
.evidenza-checkbox:hover .check-custom {
    border-color: var(--blu-mare, #1a5276);
}

/* Checked — sfondo oro */
.evidenza-checkbox input:checked + .check-custom {
    background: var(--oro, #d4a017);
    border-color: var(--oro, #d4a017);
}

/* Checked — spunta CSS pura (✓ disegnato con bordi) */
.evidenza-checkbox input:checked + .check-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ═══════════════════════════════════════════════════════
   INFO IMMOBILE
   ═══════════════════════════════════════════════════════ */

.evidenza-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0; /* per text-overflow */
}

.evidenza-rif {
    font-size: 0.75rem;
    color: var(--oro, #d4a017);
    font-weight: 600;
}

.evidenza-titolo {
    font-size: 0.95rem;
    color: var(--blu-mare, #1a5276);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evidenza-localita {
    font-size: 0.8rem;
    color: var(--testo-medio, #666);
}

.evidenza-prezzo {
    font-size: 0.85rem;
    color: var(--blu-mare, #1a5276);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   VISITE OGGI
   ═══════════════════════════════════════════════════════ */

.visite-principale {
    text-align: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.visite-numero {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--blu-mare, #1a5276);
    line-height: 1;
}

.visite-label {
    font-size: 0.9rem;
    color: var(--testo-medio, #666);
}

.piu-visto-card {
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.piu-visto-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--oro, #d4a017);
    font-weight: 600;
}

.piu-visto-titolo {
    font-size: 1rem;
    color: var(--blu-mare, #1a5276);
    font-weight: 600;
}

.piu-visto-rif {
    font-size: 0.8rem;
    color: var(--testo-medio, #666);
}

.piu-visto-numero {
    font-size: 0.9rem;
    color: #e74c3c;
    font-weight: 700;
}

.nessuna-visita {
    text-align: center;
    color: var(--testo-medio, #666);
    padding: 1rem;
}

/* ═══════════════════════════════════════════════════════5
   GRAFICI CSS
   ═══════════════════════════════════════════════════════ */

.grafico-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.5rem;
    height: 200px;
    padding: 1rem 0;
}

.grafico-barra {
    flex: 1;
    background: linear-gradient(to top, var(--blu-mare, #1a5276), #2980b9);
    border-radius: 6px 6px 0 0;
    min-height: 5px;
    position: relative;
    transition: height 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 0.25rem;
}

.barra-valore {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.barra-label {
    position: absolute;
    bottom: -1.5rem;
    font-size: 0.7rem;
    color: var(--testo-medio, #666);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   AZIONI RAPIDE
   ═══════════════════════════════════════════════════════ */

.azioni-rapide {
    margin-bottom: 2rem;
}

.azioni-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.azione-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(26, 82, 118, 0.05);
    border: 1px solid rgba(26, 82, 118, 0.1);
    text-decoration: none;
    color: var(--blu-mare, #1a5276);
    transition: all 0.2s;
}

.azione-card:hover {
    background: var(--blu-mare, #1a5276);
    color: #fff;
    transform: translateY(-3px);
}

.azione-card i {
    font-size: 2rem;
}

.azione-card span {
    font-size: 0.9rem;
    font-weight: 600;
}

.azione-card.sperimentale {
    position: relative;
    background: rgba(212, 160, 23, 0.08);
    border-color: var(--oro, #d4a017);
}

.azione-card.sperimentale small {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--oro, #d4a017);
    color: #fff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
   TOAST DASHBOARD
   ═══════════════════════════════════════════════════════ */

.toast-dashboard {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    z-index: 9999;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast-dashboard.active {
    transform: translateX(0);
}

.toast-success {
    background: rgba(39, 174, 96, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.toast-error {
    background: rgba(231, 76, 60, 0.95);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .azioni-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .azioni-grid {
        grid-template-columns: 1fr;
    }
    .evidenza-item {
        flex-wrap: wrap;
    }
}

/* ============================================================
   GESTIONE TESTI
   ============================================================ */

.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    color: var(--blu-mare, #1a5276);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header .breadcrumb {
    color: var(--grigio-scuro, #6c757d);
    font-size: 0.95rem;
    margin-top: 6px;
}

.page-header .breadcrumb a {
    color: var(--blu-mare, #1a5276);
    text-decoration: none;
}

.textarea-testo {
    width: 100%;
    min-height: 200px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    font-size: 1rem;
}

.form-actions-left {
    justify-content: flex-start;
    padding: 1rem 0 0 0;
    border: none;
    margin-top: 0;
}

.testi-meta {
    color: var(--grigio-scuro, #6c757d);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    font-style: italic;
}

.message-box {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.message-box.visible {
    display: block;
}

.message-box.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--verde, #28a745);
}

.message-box.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--rosso, #dc3545);
}

/* ============================================================
   GESTIONE TESTI
   ============================================================ */

.textarea-testo {
    min-height: 250px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.form-actions-left {
    justify-content: flex-start;
    padding: 1rem 0 0 0;
    border: none;
    margin-top: 0;
}

.testi-meta {
    color: var(--grigio-scuro, #6c757d);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    font-style: italic;
}

.message-box {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
}

.message-box.visible {
    display: block;
}

.message-box.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: var(--verde, #28a745);
}

.message-box.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: var(--rosso, #dc3545);
}

/* 
 * Stile toolbar formattazione HTML per textarea backend
 */

.html-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    align-items: center;
}

.html-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #adb5bd;
    background: #ffffff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s ease;
}

.html-toolbar button:hover {
    background: #e9ecef;
    border-color: #6c757d;
    color: #212529;
}

.html-toolbar button:active {
    background: #dee2e6;
    transform: translateY(1px);
}