#table-1 {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    font-size: 12px;
}

#table-1 th,
#table-1 td {
    padding: 0.5rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
    text-align: center;
    white-space: nowrap;
}

#table-1 thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-weight: 600;
}

#table-1 tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.05);
}

#table-1 tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.table-responsive {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto; /* Thêm scroll ngang cho nhiều cột */
}

/* Desktop - 7 columns in one row */
@media (min-width: 1200px) {
    .statistics-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
    }
    
    .statistics-row .col-lg-3 {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    
    .stat-card {
        min-height: 320px;
        padding: 20px;
    }
    
    .stat-card .stat-icon {
        font-size: 3rem;
        margin-bottom: 12px;
    }
    
    .stat-card h6 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .stat-card .stat-number {
        font-size: 14px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
}

/* Laptop - 4 columns per row for first row, 3 for second */
@media (min-width: 992px) and (max-width: 1199px) {
    .statistics-row .col-lg-3:nth-child(n+5) {
        margin-top: 20px;
    }
}

/* Tablet - 2 columns per row */
@media (min-width: 769px) and (max-width: 991px) {
    .statistics-row .col-lg-3 {
        flex-basis: 50%;
        max-width: 50%;
    }
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    #table-1 {
        font-size: 10px;
    }
    
    #table-1 th,
    #table-1 td {
        padding: 0.25rem;
    }
    
    .stat-card {
        padding: 15px;
        margin-bottom: 15px;
        min-height: 240px;
    }
    
    .stat-card .stat-icon {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }
    
    .stat-card h6 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .stat-item {
        padding: 6px 8px;
    }
    
    .stat-card .stat-number {
        font-size: 14px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
}

.stat-card {
    background: linear-gradient(45deg, #6e8fb3, #396ca1);
    color: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 280px;
}



.stat-card .stat-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
    text-shadow: 0 3px 6px rgba(0,0,0,0.3);
    display: block;
    line-height: 1;
}

.stat-card .stat-icon i {
    font-size: inherit;
    color: rgba(255,255,255,0.9);
}

.stat-card h6 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.stats-grid {
    display: grid;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}



.stat-card .stat-label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-number {
    font-size: 16px;
    font-weight: bold;
    text-align: right;
}

.stat-card .stat-number small {
    font-size: 10px;
    opacity: 0.8;
    font-weight: normal;
    margin-left: 2px;
}



/* ECharts container styling */
#mini-chart {
    width: 100%;
    height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

/* Form styling improvements */
.analytics-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
    background: linear-gradient(135deg, #0056b3, #004085);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

#btn_stat {
    background: linear-gradient(135deg, #28a745, #20c997);
    box-shadow: 0 4px 15px rgba(40,167,69,0.3);
}

#btn_stat:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    box-shadow: 0 6px 20px rgba(40,167,69,0.4);
}

#btn_excel {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    box-shadow: 0 4px 15px rgba(255,193,7,0.3);
}

#btn_excel:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    box-shadow: 0 6px 20px rgba(255,193,7,0.4);
}

.form-row {
    display: flex;
    align-items: end;
    gap: 15px;
    flex-wrap: wrap;
}

.form-group-modern {
    position: relative;
    margin-bottom: 25px;
}

.form-group-modern label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    background: white;
    padding: 0 8px;
    color: #6c757d;
    font-size: 14px;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

.form-group-modern .form-control:focus + label,
.form-group-modern .form-control:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    color: #007bff;
    font-weight: 600;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .analytics-form {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .btn-primary {
        width: 100%;
        margin-top: 10px;
    }
    
    .d-flex {
        flex-direction: column !important;
        gap: 10px !important;
    }
}

/* Utility classes */
.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.flex-fill {
    flex: 1 1 auto !important;
}

/* Icon spacing in buttons */
.btn i {
    margin-right: 8px;
}

.btn i:only-child {
    margin-right: 0;
}

/* Statistics row layout - 7 cards in one row for desktop */
.statistics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

@media (min-width: 1200px) {
    .statistics-row .stat-card-wrapper {
        flex: 1;
        min-width: calc(14.28% - 13px); /* 100% / 7 - gap */
        max-width: calc(14.28% - 13px);
    }
    
    .statistics-row .stat-card {
        margin-bottom: 0;
        min-height: 260px;
        padding: 20px 15px;
    }
    
    .statistics-row .stat-card .stat-icon {
        font-size: 2.8rem;
        margin-bottom: 12px;
    }
    
    .statistics-row .stat-card .stat-icon i {
        font-size: inherit;
    }
    
    .statistics-row .stat-card h6 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .statistics-row .stat-card .stat-number {
        font-size: 14px;
    }
    
    .statistics-row .stat-card .stat-label {
        font-size: 11px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .statistics-row .stat-card-wrapper {
        flex: 1;
        min-width: calc(25% - 12px); /* 4 cards per row */
        max-width: calc(25% - 12px);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .statistics-row .stat-card-wrapper {
        flex: 1;
        min-width: calc(33.33% - 10px); /* 3 cards per row */
        max-width: calc(33.33% - 10px);
    }
}

@media (max-width: 767px) {
    .statistics-row .stat-card-wrapper {
        flex: 1;
        min-width: calc(50% - 8px); /* 2 cards per row */
        max-width: calc(50% - 8px);
    }
}