/* Stili generali */
body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

.nav-link {
    cursor: pointer;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin: 0 3px;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ffd700 !important;
}

.nav-link.active {
    background-color: rgba(255,255,255,0.2);
}

/* Cards statistiche */
.stat-card {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stat-card h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
}

/* Tabelle */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8f9ff;
}

/* Badge stati */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-expired {
    background-color: #f8d7da;
    color: #721c24;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-suspended {
    background-color: #fff3cd;
    color: #856404;
}

.status-pending {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.status-in_progress {
    background-color: #cce5ff;
    color: #004085;
}

/* Bottoni azione */
.btn-action {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    margin: 0 2px;
    border-radius: 5px;
    transition: all 0.2s;
}

.btn-action:hover {
    transform: scale(1.1);
}

/* Modali */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    padding: 1.2rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* Form controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.3rem;
}

/* Sezioni form */
.bg-light h6 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Contatti */
.contact-row {
    background-color: #f8f9fa;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    border-radius: 8px;
}

.contact-row:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-label.small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Selezione tipo cliente */
.btn-check + .btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
}

.btn-check:checked + .btn-outline-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Badge tipo cliente */
.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

/* Filtri clienti */
.client-filters .btn-group .btn {
    padding: 0.5rem 1.2rem;
    font-weight: 500;
}

.client-filters .btn-group .btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Animazioni */
.content-section {
    animation: fadeInUp 0.5s ease;
}

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

/* Modal visualizzazione cliente */
#viewClientModal .modal-body h6 {
    color: #667eea;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
    font-weight: 700;
}

#viewClientModal .modal-body p {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .modal-xl {
        max-width: 100%;
        margin: 10px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .btn-action {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Tooltip personalizzati */
[title] {
    position: relative;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Loader */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}