.avviati-stats-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.avviati-loading {
    text-align: center;
    padding: 50px;
}

.avviati-loading h4 {
    color: #007cba;
    margin-top: 20px;
}

.avviati-loading p {
    color: #6c757d;
    margin: 10px 0 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

.avviati-progress-bar {
    width: 300px;
    height: 6px;
    background-color: #f3f3f3;
    border-radius: 3px;
    margin: 20px auto 0;
    overflow: hidden;
}

.avviati-progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #007cba, #0056b3);
    animation: progress-slide 2s ease-in-out infinite;
}

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

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.avviati-filters-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.avviati-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.avviati-filter-item {
    flex: 1;
    min-width: 150px;
}

.avviati-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.avviati-filter-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.avviati-filter-item select[multiple] {
    height: 120px;
}

.avviati-filter-info {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.avviati-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.avviati-btn-primary {
    background-color: #007cba;
    color: white;
}

.avviati-btn-primary:hover {
    background-color: #005a87;
}

.avviati-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.avviati-btn-secondary:hover {
    background-color: #545b62;
}


.avviati-tabs {
    margin-top: 30px;
}

.avviati-tab-buttons {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.avviati-tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.avviati-tab-btn.active {
    border-bottom-color: #007cba;
    color: #007cba;
    font-weight: 600;
}

.avviati-tab-btn:hover {
    background-color: #f8f9fa;
}

.avviati-tab-pane {
    display: none;
}

.avviati-tab-pane.active {
    display: block;
}

.avviati-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.avviati-chart-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.avviati-chart-container div {
    width: 100%;
    height: 100%;
}

.avviati-chart-container.avviati-full-width {
    grid-column: 1 / -1;
}

/* Layout Grid System */
.avviati-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.avviati-col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 10px;
}

.avviati-col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .avviati-col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Total Card */
.avviati-total-card {
    background: linear-gradient(135deg, #007cba, #0056b3);
    color: white;
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
    margin-bottom: 20px;
}

.avviati-total-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.avviati-total-number {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Table Wrapper */
.avviati-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.avviati-chart-container h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.avviati-table-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.avviati-table-container h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.avviati-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.avviati-table th,
.avviati-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.avviati-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

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

@media (max-width: 768px) {
    .avviati-charts-grid {
        grid-template-columns: 1fr;
    }
    
    .avviati-filters-row {
        flex-direction: column;
    }
    
    .avviati-filter-item {
        width: 100%;
    }
    
    .avviati-stats-summary {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .avviati-table {
        font-size: 12px;
    }
    
    .avviati-table th,
    .avviati-table td {
        padding: 8px;
    }
}