    /* Reset và Base Styles */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background-color: #f5f7fa;
        color: #333;
        line-height: 1.6;
        touch-action: pan-y;
    }

    /* Header */
    .header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 0.5rem 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 0;
        border-bottom: none;
    }

    .header-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-title-section {
        display: flex;
        align-items: center;
        gap: 30px; /* Khoảng cách giữa title và year selector */
    }

    .header h1 {
        font-size: 1.2rem;
        font-weight: 600;
    }

    .mobile-menu-toggle {
        display: none;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Navigation */
    .nav {
        background: white;
        border-bottom: 1px solid #e1e5e9;
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 999;
        margin: 0;
        border-top: none;
    }

    .nav-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 2rem;
        display: flex;
        gap: 0;
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }

    .user-info:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .user-name {
        font-weight: 500;
    }

    .user-info i.fa-user-circle {
        font-size: 1.5rem;
    }

    .user-info .dropdown-arrow {
        font-size: 0.75rem;
        transition: transform 0.3s ease;
        opacity: 0.8;
    }

    .user-info.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* User Dropdown Menu */
    .user-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        min-width: 200px;
        display: none;
        z-index: 1000;
        overflow: hidden;
        animation: fadeInDown 0.2s ease;
    }

    .user-info.active .user-dropdown {
        display: block;
    }

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        color: #333;
        cursor: pointer;
        transition: background-color 0.2s ease;
        font-size: 0.9rem;
    }

    .dropdown-item:hover {
        background-color: #f8f9fa;
    }

    .dropdown-item.user-name-item {
        cursor: default;
        color: #6c757d;
        font-weight: 500;
    }

    .dropdown-item.user-name-item:hover {
        background-color: transparent;
    }

    .dropdown-item.user-name-item i {
        color: #667eea;
    }

    .dropdown-item.logout-item {
        color: #dc3545;
    }

    .dropdown-item.logout-item:hover {
        background-color: #fff5f5;
    }

    .dropdown-item.logout-item i {
        color: #dc3545;
    }

    .dropdown-item i {
        font-size: 0.875rem;
        width: 16px;
        text-align: center;
    }

    .dropdown-divider {
        height: 1px;
        background-color: #e1e5e9;
        margin: 0.25rem 0;
    }

    /* Year Selector */
    .year-selector {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        cursor: pointer;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        transition: background-color 0.2s ease;
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .year-selector:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .year-selector .fa-calendar-alt {
        font-size: 1.1rem;
        opacity: 0.9;
    }

    .current-year {
        font-weight: 600;
        font-size: 1.15rem; /* Tăng font size cho năm */
        min-width: 40px;
        text-align: center;
    }

    .year-selector .dropdown-arrow {
        font-size: 0.75rem;
        transition: transform 0.3s ease;
        opacity: 0.8;
    }

    .year-selector.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    .year-dropdown {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        min-width: 250px;
        display: none;
        z-index: 1000;
        overflow: hidden;
        animation: fadeInDown 0.2s ease;
    }

    .year-selector.active .year-dropdown {
        display: block;
    }

    .year-dropdown-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
    }

    .year-dropdown-list {
        max-height: 300px;
        overflow-y: auto;
    }

    .year-dropdown-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        color: #333;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .year-dropdown-item:hover {
        background-color: #f5f7fa;
    }

    .year-dropdown-item.active {
        background-color: #e8eaff;
        color: #667eea;
    }

    .year-dropdown-item .year-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        flex: 1;
    }

    .year-dropdown-item .year-number {
        font-size: 1.1rem; /* Font lớn hơn cho số năm */
        font-weight: 600;
        color: inherit;
    }

    .year-dropdown-item.active .year-number {
        color: #667eea;
    }

    .year-dropdown-item .year-note {
        font-size: 0.75rem; /* Font nhỏ cho mô tả */
        color: #666;
        font-weight: normal;
        line-height: 1.3;
    }

    .year-dropdown-item.active .year-note {
        color: #888;
    }

    .year-dropdown-item .year-badge {
        background: #667eea;
        color: white;
        padding: 0.15rem 0.5rem;
        border-radius: 4px;
        font-size: 0.7rem;
        font-weight: 600;
        margin-top: 0.15rem;
    }

    .year-dropdown-item .check-icon {
        color: #667eea;
    }

.year-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    color: #666;
    font-size: 0.875rem;
}

.template-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

    .year-dropdown-divider {
        height: 1px;
        background: #e1e5e9;
        margin: 0.25rem 0;
    }

    .year-dropdown-footer {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        color: #667eea;
        cursor: pointer;
        transition: background-color 0.2s ease;
        font-size: 0.9rem;
        font-weight: 600;
    }

    .year-dropdown-footer:hover {
        background-color: #f5f7fa;
    }

    .nav-item {
        background: none;
        border: none;
        padding: 1rem 1.5rem;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        color: #6c757d;
        border-bottom: 3px solid transparent;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-item:hover {
        background-color: #f8f9fa;
        color: #495057;
    }

    .nav-item.active {
        color: #667eea;
        border-bottom-color: #667eea;
        background-color: #f8f9fa;
    }

    /* Main Content */
    .main-content {
        max-width: 1400px;
        margin: 0 auto;
        padding: 2rem;
        margin-top: 0;
    }

    /* Modules */
    .module {
        display: none;
    }

    .module.active {
        display: block;
    }

    .module-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid #e1e5e9;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Search module uses border-top instead of border-bottom for separation */
    #search .module-header {
        padding-top: 1rem;
        padding-bottom: 0;
        border-top: 5px solid #e1e5e9;
        border-bottom: none;
    }

    .module-title-group {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex: 1;
        flex-wrap: wrap;
    }

    .month-selector-inline {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .month-selector-inline label {
        font-weight: 500;
        color: #495057;
    }

    .large-selector {
        min-width: 250px;
    }

    .large-selector .multiselect-btn {
        min-height: 56px;
    }

    .module-header h2 {
        color: #495057;
        font-size: 1.5rem;
        font-weight: 600;
    }

    .actions {
        display: flex;
        gap: 0.5rem;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 1rem;
        border: none;
        border-radius: 6px;
        cursor: pointer !important; /* Force pointer cursor for all buttons */
        font-size: 0.9rem;
        font-weight: 500;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: all 0.3s ease;
    }
    
    /* Ensure all button variants have pointer cursor */
    .btn-sm,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-warning,
    .btn-info,
    .btn-danger,
    button.btn,
    button[class*="btn"] {
        cursor: pointer !important;
    }
    
    /* Remove help cursor from buttons with title attribute */
    button[title],
    .btn[title] {
        cursor: pointer !important;
    }

    .btn-primary {
        background-color: #667eea;
        color: white;
    }

    .btn-primary:hover {
        background-color: #5a6fd8;
        transform: translateY(-1px);
    }

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

    .btn-secondary:hover {
        background-color: #5a6268;
    }

    .btn-success {
        background-color: #28a745;
        color: white;
    }

    .btn-success:hover {
        background-color: #218838;
    }

    .btn-warning {
        background-color: #ffc107;
        color: #212529;
    }

    .btn-warning:hover {
        background-color: #e0a800;
    }

    .btn-info {
        background-color: #17a2b8;
        color: white;
    }

    .btn-info:hover {
        background-color: #138496;
    }

    .btn-danger {
        background-color: #dc3545;
        color: white;
    }

    .btn-danger:hover {
        background-color: #c82333;
    }
    
    /* Disabled buttons */
    .btn:disabled,
    .btn[disabled],
    button:disabled,
    button[disabled] {
        opacity: 0.6 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
    }
    
    .btn:disabled:hover,
    .btn[disabled]:hover,
    button:disabled:hover,
    button[disabled]:hover {
        transform: none;
        background-color: inherit;
    }

    /* Stats Grid */
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .stat-card {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        gap: 1rem;
        transition: transform 0.3s ease;
    }

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

    .stat-icon {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: white;
    }

    .stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #667eea, #764ba2); }
    .stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #f093fb, #f5576c); }
    .stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #4facfe, #00f2fe); }
    .stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #43e97b, #38f9d7); }

    .stat-content h3 {
        font-size: 0.9rem;
        color: #6c757d;
        margin-bottom: 0.5rem;
    }

    .stat-number {
        font-size: 2rem;
        font-weight: 700;
        color: #495057;
        margin-bottom: 0.25rem;
    }

    .stat-trend {
        font-size: 0.8rem;
        font-weight: 500;
    }

    .stat-trend.positive {
        color: #28a745;
    }

    .stat-trend.negative {
        color: #dc3545;
    }

    /* Charts */
    .charts-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .chart-container {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .chart-container h4 {
        margin-bottom: 1rem;
        color: #495057;
        font-size: 1.1rem;
    }

    .top-products-controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .days-input-group {
        display: flex;
        align-items: center;
        gap: 3px;
        padding: 4px 6px;
        background: #f8f9fa;
        border-radius: 6px;
    }

    .days-input-group {
        flex-shrink: 0;
        margin-right: 8px;
    }
    
    .days-input-group input {
        min-width: 80px !important;
        width: 80px;
        padding: 4px 6px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 0.9rem;
        box-sizing: border-box;
    }
    
    .days-input-group span {
        font-size: 0.85rem;
    }

    .top-products-controls .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* TOP SẢN PHẨM Section */
    .top-products-section {
        background: white;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-top: 2rem;
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    .section-header h3 {
        color: #495057;
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0;
    }

    .loading-indicator {
        text-align: center;
        padding: 2rem;
        color: #667eea;
        font-size: 1.1rem;
    }

    .loading-indicator i {
        margin-right: 0.5rem;
    }

    /* Filters */
    .filters {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 2rem;
    }

    .filter-group {
        display: flex;
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap;
    }

    .filter-input, .filter-select {
        padding: 0.5rem 1rem;
        border: 1px solid #ced4da;
        border-radius: 6px;
        font-size: 0.9rem;
        min-width: 200px;
    }

    .filter-input:focus, .filter-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    /* Tables */
    .table-container {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        overflow: hidden;
        margin-bottom: 2rem;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
    }

    .data-table th {
        background-color: #f8f9fa;
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        color: #495057;
        border-bottom: 2px solid #e1e5e9;
    }

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s ease;
}

.data-table th.sortable::after {
    content: '\2195';
    font-size: 0.7rem;
    margin-left: 0.4rem;
    color: #adb5bd;
    display: inline-block;
    transform: translateY(-1px);
}

.data-table th.sortable.sorted-asc::after {
    content: '▲';
    color: #667eea;
}

.data-table th.sortable.sorted-desc::after {
    content: '▼';
    color: #667eea;
}

.data-table th.sortable.sorted {
    color: #667eea;
}

.data-table th.sortable:hover {
    color: #344767;
}

    .data-table td {
        padding: 1rem;
        border-bottom: 1px solid #e1e5e9;
        vertical-align: middle;
    }

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

    /* Pagination */
    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        margin-top: 2rem;
    }

    .pagination span {
        font-weight: 500;
        color: #495057;
    }

    /* Month Summary */
    .month-summary {
        margin-bottom: 2rem;
    }

    .summary-card {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .summary-card h4 {
        margin-bottom: 1rem;
        color: #495057;
    }

    .stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e1e5e9;
    }

    .stat:last-child {
        border-bottom: none;
    }

    .stat .label {
        color: #6c757d;
        font-weight: 500;
    }

    .stat .value {
        color: #495057;
        font-weight: 600;
        font-size: 1.1rem;
    }

    /* Search Form */
    .search-section {
        margin-bottom: 3rem;
    }

    .search-form {
        margin-bottom: 2rem;
    }

    .search-controls-group {
        display: flex;
        gap: 1rem;
        align-items: center;
    }

    .search-filter-item {
        min-width: 300px;
    }

.search-filter-item.year-filter {
    min-width: 220px;
}

    .search-filter-item .mobile-multiselect {
        height: 48px;
        display: flex;
        align-items: center;
        background: white;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        padding: 0;
        transition: all 0.3s;
        box-sizing: border-box;
    }

    .search-filter-item .mobile-multiselect:hover {
        border-color: #007bff;
        background: #f8f9fa;
    }

    .search-filter-item .mobile-multiselect .multiselect-btn {
        height: 48px;
        box-sizing: border-box;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .search-filter-item .mobile-multiselect .multiselect-btn:hover {
        background: transparent;
    }

    /* Override .large-selector height for search module */
    .search-filter-item .large-selector .multiselect-btn {
        min-height: 48px;
        height: 48px;
    }

    .search-filter-item .filter-input-group {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        background: white;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        padding: 0;
        transition: all 0.3s;
        height: 48px;
        box-sizing: border-box;
    }

    .search-filter-item .filter-input-group:hover {
        border-color: #007bff;
        background: #f8f9fa;
    }

    .search-filter-item .filter-input-number {
        flex: 1;
        height: 100%;
        padding: 0 15px;
        border: none;
        border-radius: 0;
        font-size: 14px;
        background: transparent;
        outline: none;
        transition: all 0.3s;
        box-sizing: border-box;
    }

    .search-filter-item .filter-input-number::placeholder {
        color: #6c757d;
    }

    .search-filter-item .filter-input-number:focus {
        outline: none;
    }

    .btn-search-customer {
        padding: 0 24px;
        font-size: 15px;
        font-weight: 500;
        height: 48px;
    }

.selected-summary {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.selected-summary .selected-values {
    font-weight: 600;
    color: #111827;
}

.year-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    color: #3949ab;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.35);
    text-transform: uppercase;
}

.year-pill[data-year=""] {
    display: none;
}

    .search-input {
        flex: 1;
        padding: 0.75rem 1rem;
        border: 1px solid #ced4da;
        border-radius: 6px;
        font-size: 1rem;
    }

    .search-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    /* Search Results */
    .search-results {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .imei-timeline {
        margin-top: 1rem;
    }

    .timeline-item {
        padding: 1rem;
        border-left: 3px solid #667eea;
        margin-bottom: 1rem;
        background-color: #f8f9fa;
        border-radius: 0 8px 8px 0;
    }

    .timeline-item.nhap {
        border-left-color: #28a745;
    }

    .timeline-item.ban {
        border-left-color: #dc3545;
    }

    .timeline-item.huy {
        border-left-color: #ffc107;
    }

    /* BaoCao */
    .baocao-filters {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 2rem;
    }

    .baocao-summary {
        background: white;
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin-bottom: 2rem;
        display: flex;
        gap: 2rem;
    }

    .summary-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .summary-item .label {
        color: #6c757d;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .summary-item .value {
        color: #495057;
        font-size: 2rem;
        font-weight: 700;
    }

    /* Tools */
    .tools-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .tool-card {
        background: white;
        padding: 2rem;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        text-align: center;
        transition: transform 0.3s ease;
    }

    .tool-card:hover {
        transform: translateY(-2px);
    }

    .tool-card h3 {
        color: #495057;
        margin-bottom: 1rem;
        font-size: 1.2rem;
    }

    .tool-card p {
        color: #6c757d;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }

    /* Loading Overlay */
    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    .loading-spinner {
        background: white;
        padding: 2rem;
        border-radius: 12px;
        text-align: center;
    }

    .loading-spinner i {
        font-size: 2rem;
        color: #667eea;
        margin-bottom: 1rem;
    }

    .loading-spinner p {
        color: #495057;
        font-weight: 500;
    }

    /* Modal */
    .modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
    }

    .modal-content {
        background: white;
        border-radius: 12px;
        max-width: 600px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 0.75rem 1.5rem;
        border-bottom: 1px solid #e1e5e9;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }

    .modal-header h3 {
        color: #495057;
        font-size: 1.3rem;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        flex: 1;
    }

    .modal-header-subtitle {
        color: #6c757d;
        font-size: 0.85rem;
        font-weight: normal;
        margin: 0;
    }

    .modal-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #6c757d;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1.5rem;
        border-top: 1px solid #e1e5e9;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

    /* ✅ Nút trong modal footer: lớn hơn, dễ bấm trên desktop */
    .modal-footer .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    /* ✅ Nút Xóa và Hủy: độ rộng bằng nhau (nhỏ hơn) */
    .modal-footer-left .btn,
    .modal-footer-right .btn.btn-secondary {
        min-width: 120px;
    }

    /* ✅ Nút Lưu: to nhất */
    .modal-footer-right .btn.btn-primary,
    #saveTonKhoBtn,
    #saveNhapHangBtn,
    #saveBanHangBtn {
        min-width: 150px;
    }

    /* Form Styles */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        color: #495057;
        font-weight: 500;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 0.5rem 1rem;
        border: 1px solid #ced4da;
        border-radius: 6px;
        font-size: 0.9rem;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

    /* Form rows layout - each row has 2 fields side by side */
    .form-rows {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .form-row {
        display: flex;
        gap: 1.5rem;
        align-items: stretch; /* Make all form-groups in row have same total height */
    }
    
    .form-row .form-group {
        flex: 1;
        display: flex;
        flex-direction: column;
        /* Total height of form-group (label + input) will match across row */
    }

    .form-group label {
        align-self: flex-start; /* Label at top */
        margin-bottom: 0.5rem;
        flex-shrink: 0; /* Label doesn't shrink */
    }
    
    /* Inputs and textareas maintain their natural height, don't stretch */
    .form-row .form-group input,
    .form-row .form-group textarea {
        min-height: 38px; /* Base height for inputs */
        /* Remove flex: 1 so inputs don't stretch, only form-group container stretches */
    }
    
    /* For textarea, allow it to grow but maintain natural height */
    .form-row .form-group textarea {
        resize: vertical; /* Allow vertical resize */
    }

    .form-group input[readonly],
    .form-group textarea[readonly] {
        background-color: #f8f9fa;
        cursor: not-allowed;
    }

    .form-group .required {
        color: #dc3545;
    }

    /* Modal footer with left and right sections */
    .modal-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-footer-left {
        display: flex;
        gap: 0.5rem;
    }

    .modal-footer-right {
        display: flex;
        gap: 0.5rem;
    }
    
    /* ✅ Điều chỉnh padding cho nút trong modal footer */
    .modal-footer .btn,
    .modal-footer-right .btn,
    .modal-footer-left .btn {
        padding: 5px 6px;
    }
    
    .custom-modal-footer .btn {
        padding: 5px 6px;
    }

    /* Custom modal for alerts and confirms */
    .custom-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }

    .custom-modal {
        background: white;
        border-radius: 12px;
        max-width: 500px;
        width: 90%;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .custom-modal-header {
        padding: 1.5rem;
        border-bottom: 1px solid #e1e5e9;
    }

    .custom-modal-header h3 {
        margin: 0;
        color: #495057;
        font-size: 1.3rem;
    }

    .custom-modal-body {
        padding: 1.5rem;
        color: #495057;
        line-height: 1.6;
    }

    .custom-modal-footer {
        padding: 1.5rem;
        border-top: 1px solid #e1e5e9;
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    @media (max-width: 768px) {
        /* ✅ Form rows: mỗi input trên 1 dòng trên mobile */
        .form-row {
            flex-direction: column;
            gap: 1rem;
        }
        
        .form-row .form-group {
            width: 100%;
            flex: none;
        }
        
        .form-row-2 {
            grid-template-columns: 1fr;
        }
        
        /* ✅ Modal footer: giữ 3 nút trên 1 dòng, lớn hơn, dễ bấm */
        .modal-footer {
            flex-direction: row;
            gap: 0.75rem;
            padding: 1rem;
            justify-content: space-between;
        }
        
        .modal-footer-left {
            display: flex;
            gap: 0.75rem;
            flex: 0 0 auto; /* Không flex, chỉ chiếm không gian cần thiết */
        }
        
        .modal-footer-right {
            display: flex;
            gap: 0.75rem;
            flex: 1;
            justify-content: flex-end;
        }
        
        /* ✅ Nút trong modal footer: lớn hơn, dễ bấm trên mobile */
        .modal-footer .btn {
            padding: 0.75rem 1rem;
            font-size: 1rem;
            min-height: 44px; /* Đảm bảo đủ lớn để dễ bấm */
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        
        /* ✅ Nút Xóa và Hủy: độ rộng bằng nhau (nhỏ hơn) */
        .modal-footer-left .btn,
        .modal-footer-right .btn.btn-secondary {
            flex: 0 0 auto;
            min-width: 100px;
        }
        
        /* ✅ Nút Lưu: to nhất */
        .modal-footer-right .btn.btn-primary,
        #saveTonKhoBtn,
        #saveNhapHangBtn,
        #saveBanHangBtn {
            flex: 0 0 auto;
            min-width: 150px;
        }
        
        .custom-modal {
            width: 95%;
            max-width: none;
        }
        
        /* ✅ Modal content: full width trên mobile */
        .modal-content {
            width: 95%;
            max-width: 95%;
            margin: 1rem auto;
        }
        
        /* ✅ Modal body: padding nhỏ hơn trên mobile */
        .modal-body {
            padding: 1rem;
        }
    }

    /* Table Cell Tooltip */
    .table-cell {
        cursor: pointer;
        position: relative;
    }

    .cell-tooltip {
        position: absolute;
        background-color: #333;
        color: white;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        font-size: 0.85rem;
        white-space: nowrap;
        z-index: 10002;
        pointer-events: none;
        opacity: 0;
        transform: translateY(5px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .cell-tooltip.show {
        opacity: 1;
        transform: translateY(0);
    }

    .cell-tooltip::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #333;
    }

    /* Toast Notification */
    .toast-notification {
        position: fixed;
        top: 20px;
        right: 20px;
        background-color: #28a745;
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        z-index: 10001;
        min-width: 250px;
        max-width: 400px;
        opacity: 0;
        transform: translateX(400px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        font-size: 0.95rem;
        font-weight: 500;
    }

    .toast-notification.show {
        opacity: 1;
        transform: translateX(0);
    }

    .toast-icon {
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .toast-message {
        flex: 1;
    }

    @media (max-width: 768px) {
        .toast-notification {
            top: 10px;
            right: 10px;
            left: 10px;
            min-width: auto;
            max-width: none;
            transform: translateY(-100px);
        }

        .toast-notification.show {
            transform: translateY(0);
        }
    }

    /* Responsive */
    @media (max-width: 768px) {
        .header {
            position: static;
        }
        
        .header-content {
            padding: 0 1rem;
        }
        
        .mobile-menu-toggle {
            display: none;
        }
        
        .header h1 {
            font-size: 1rem;
        }
        
        .nav {
            position: static;
        }
        
        .nav-content {
            padding: 0 1rem;
            display: flex;
            flex-direction: row;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        .nav-content.show {
            display: flex;
        }
        
        .main-content {
            padding: 1rem;
        }
        
        .nav-item {
            white-space: nowrap;
            padding: 1rem;
            border-bottom: none;
            border-right: 1px solid #e1e5e9;
        }
        
        .nav-item:last-child {
            border-right: none;
        }
        
        /* User info and dropdown on mobile */
        .user-info {
            gap: 0.4rem;
            padding: 0.4rem;
        }
        
        .user-info .user-name {
            font-size: 0.85rem;
            display: none; /* Hide user name on very small screens */
        }
        
        .user-info i.fa-user-circle {
            font-size: 1.3rem;
        }
        
        .user-info .dropdown-arrow {
            font-size: 0.7rem;
        }
        
        .user-dropdown {
            min-width: 180px;
            right: 0;
        }
        
        .dropdown-item {
            padding: 0.65rem 0.85rem;
            font-size: 0.85rem;
        }
        
        /* Header title section on mobile */
        .header-title-section {
            gap: 15px; /* Giảm khoảng cách trên mobile */
        }
        
        /* Year Selector on mobile */
        .year-selector {
            gap: 0.3rem;
            padding: 0.4rem 0.6rem;
        }
        
        .year-selector .fa-calendar-alt {
            font-size: 0.95rem;
        }
        
        .current-year {
            font-size: 0.9rem;
            min-width: 35px;
        }
        
        .year-dropdown {
            min-width: 200px;
            left: 50%;
            transform: translateX(-50%);
        }
        
        .year-dropdown-item {
            padding: 0.65rem 0.85rem;
            font-size: 0.85rem;
        }
        
        .year-dropdown-footer {
            padding: 0.65rem 0.85rem;
            font-size: 0.85rem;
        }
        
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        gap: 0.5rem;
        border-radius: 8px;
        min-height: auto;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .stat-content h3 {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    .stat-trend {
        font-size: 0.7rem;
        display: none;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
        
        .filter-group {
            flex-direction: column;
            align-items: stretch;
        }
        
        .filter-input,
        .filter-select {
            min-width: auto;
        }
        
        .actions {
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .data-table {
            font-size: 0.8rem;
        }
        
        .data-table th,
        .data-table td {
            padding: 0.5rem;
        }
        
        .tools-grid {
            grid-template-columns: 1fr;
        }
        
        .baocao-summary {
            flex-direction: column;
            gap: 1rem;
        }
        
        /* Search Module Mobile Styles */
        .search-controls-group {
            flex-direction: column;
            gap: 1rem;
            align-items: stretch;
        }
        
        .search-filter-item {
            min-width: auto;
            width: 100%;
        }
        
        .btn-search-customer {
            width: 100%;
            height: 56px;
        }
    }

    /* Utility Classes */
    .text-center { text-align: center; }
    .text-right { text-align: right; }
    .text-left { text-align: left; }

    .mb-1 { margin-bottom: 0.5rem; }
    .mb-2 { margin-bottom: 1rem; }
    .mb-3 { margin-bottom: 1.5rem; }
    .mb-4 { margin-bottom: 2rem; }

    .mt-1 { margin-top: 0.5rem; }
    .mt-2 { margin-top: 1rem; }
    .mt-3 { margin-top: 1.5rem; }
    .mt-4 { margin-top: 2rem; }

    .p-1 { padding: 0.5rem; }
    .p-2 { padding: 1rem; }
    .p-3 { padding: 1.5rem; }
    .p-4 { padding: 2rem; }

    .d-none { display: none; }
    .d-block { display: block; }
    .d-flex { display: flex; }
    .d-grid { display: grid; }

    .justify-center { justify-content: center; }
    .justify-between { justify-content: space-between; }
    .align-center { align-items: center; }

    /* Header Actions */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .last-update {
        font-size: 0.85rem;
        color: #666;
        font-style: italic;
    }

    /* BaoCao Container - Chia đôi màn hình */
    .baocao-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-top: 20px;
    }

    .baocao-tonkho,
    .baocao-topproducts {
        background: white;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    
    /* Ensure tables fit within their containers */
    .baocao-container .table-responsive {
        overflow-x: hidden;
        width: 100%;
    }
    
    .baocao-container .data-table {
        width: 100%;
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #f0f0f0;
    }

    .section-header h3 {
        margin: 0;
        color: #333;
        font-size: 1rem;
        white-space: nowrap;
    }

    .top-products-controls {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    

    .loading-indicator {
        text-align: center;
        padding: 20px;
        color: #666;
        font-style: italic;
    }

    .loading-indicator i {
        margin-right: 8px;
    }

    /* Section Divider */
    .section-divider {
        width: 100%;
        height: 5px;
        background-color: #e0e0e0;
        margin: 30px 0;
        border-radius: 2px;
    }

    /* Tồn Kho Báo Cáo Container - chỉ chiếm nửa màn hình */
    .tonkho-baocao-container {
        max-width: 50%;
        margin-top: 0;
    }

    .tonkho-baocao-section {
        background: white;
        border-radius: 8px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .tonkho-baocao-table {
        overflow-x: hidden;
        width: 100%;
    }

    .tonkho-baocao-table .data-table {
        width: 100%;
        min-width: auto;
        table-layout: fixed;
    }

    /* Điều chỉnh width cột cho bảng Tồn Kho Theo Dòng Máy trong tab Tồn Kho */
    /* Giống với style của bảng trong tab Báo Cáo để đồng nhất */
    .tonkho-baocao-table .data-table th:nth-child(1),
    .tonkho-baocao-table .data-table td:nth-child(1) {
        width: 10%;
        text-align: center;
    }

    .tonkho-baocao-table .data-table th:nth-child(2),
    .tonkho-baocao-table .data-table td:nth-child(2) {
        width: 40%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 0; /* Force text wrapping in fixed table layout */
    }

    .tonkho-baocao-table .data-table th:nth-child(3),
    .tonkho-baocao-table .data-table td:nth-child(3) {
        width: 25%;
        text-align: center;
    }

    .tonkho-baocao-table .data-table th:nth-child(4),
    .tonkho-baocao-table .data-table td:nth-child(4) {
        width: 25%;
        text-align: right;
    }

    /* Mobile Responsive Updates */
    @media (max-width: 768px) {
        .baocao-container {
            grid-template-columns: 1fr;
            gap: 15px;
        }
        
        .header-actions {
            flex-direction: column;
            gap: 10px;
        }
        
        .section-header {
            flex-direction: column;
            gap: 10px;
            align-items: flex-start;
        }

        .tonkho-baocao-container {
            max-width: 100%;
        }

        .section-divider {
            margin: 20px 0;
        }

        /* Trên mobile, cho phép scroll ngang nếu cần */
        .tonkho-baocao-table {
            overflow-x: auto;
        }

        .tonkho-baocao-table .data-table {
            table-layout: auto;
        }
    }

    .w-full { width: 100%; }
    .h-full { height: 100%; }

    /* Section Header Styling */
    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .section-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .last-update {
        font-size: 0.8rem;
        color: #666;
        font-style: italic;
        white-space: nowrap;
        min-width: 200px;
    }

    .top-products-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
        .section-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 0.5rem;
        }
        
        .section-actions {
            width: 100%;
            justify-content: space-between;
            flex-wrap: wrap;
        }
        
        .last-update {
            font-size: 0.7rem;
            min-width: auto;
            order: 2;
        }
        
        .top-products-controls {
            order: 1;
            flex-wrap: wrap;
        }
    }

    /* Form Controls for Edit Mode */
    .form-control {
        width: 100%;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        border: 1px solid #ddd;
        border-radius: 0.25rem;
        background-color: #fff;
    }

    .form-control:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    }

    /* Edit mode styling */
    tr.edit-mode {
        background-color: #f8f9fa;
    }

    tr.edit-mode td {
        padding: 0.25rem;
    }

    /* Button spacing in edit mode */
    tr.edit-mode .btn {
        margin: 0 0.125rem;
    }

    /* Edit mode button styling */
    tr.edit-mode .btn-danger {
        background-color: #dc3545;
        border-color: #dc3545;
    }

    tr.edit-mode .btn-danger:hover {
        background-color: #c82333;
        border-color: #bd2130;
    }

    /* Ensure buttons are visible in edit mode */
    tr.edit-mode td:last-child {
        white-space: nowrap;
        min-width: 120px;
    }

    /* Pagination Controls */
    .pagination-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .page-size-selector {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .page-size-selector label {
        font-size: 0.9rem;
        color: #666;
        white-space: nowrap;
    }

    .page-size-selector select {
        width: auto;
        min-width: 120px;
    }

    .page-navigation {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .page-info-wrapper {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 14px;
        color: #495057;
    }

    .page-input {
        width: 60px;
        text-align: center;
        padding: 4px 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        font-weight: 500;
        transition: border-color 0.2s;
    }

    .page-input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    }

    .page-input::-webkit-inner-spin-button,
    .page-input::-webkit-outer-spin-button {
        opacity: 1;
        cursor: pointer;
    }

    /* Responsive pagination */
    @media (max-width: 768px) {
        .pagination-controls {
            flex-direction: column;
            gap: 0.5rem;
        }
        
        .page-size-selector {
            order: 2;
        }
        
        .page-navigation {
            order: 1;
        }
    }

    /* Table Responsive - Horizontal Scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 20px;
    }

    .table-responsive table {
        min-width: 800px; /* Đảm bảo bảng không bị co lại quá nhỏ */
        margin-bottom: 0;
    }
    
    /* Override for BaoCao tables */
    .baocao-container .table-responsive table {
        min-width: auto;
        width: 100%;
    }

    /* Override for Tồn Kho Báo Cáo table - không cần min-width 800px */
    .tonkho-baocao-table table {
        min-width: auto;
        width: 100%;
    }

    /* Custom scrollbar for better UX */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    /* Mobile-specific table improvements */
    @media (max-width: 768px) {
        .table-responsive {
            border: 2px solid #007bff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .table-responsive::-webkit-scrollbar {
            height: 12px;
        }
        
        .table-responsive::-webkit-scrollbar-thumb {
            background: #007bff;
            border-radius: 6px;
        }
        
        .table-responsive::-webkit-scrollbar-thumb:hover {
            background: #0056b3;
        }
        
        /* Additional mobile improvements */
        .container {
            padding: 10px;
        }
        
        .nav-tabs {
            flex-wrap: wrap;
        }
        
        .nav-item {
            margin-bottom: 5px;
        }
        
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        
        .charts-grid {
            grid-template-columns: 1fr;
        }
        
    .baocao-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .baocao-tonkho,
    .baocao-topproducts {
        min-width: 0;
    }
    
    /* Fix BaoCao table columns on mobile */
    .baocao-container .table-responsive {
        overflow-x: visible;
    }
    
    .baocao-container .data-table {
        min-width: auto;
        width: 100%;
    }
    
    .baocao-container .data-table th,
    .baocao-container .data-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    /* Tồn Kho table (4 columns) */
    .baocao-tonkho .data-table th:nth-child(1),
    .baocao-tonkho .data-table td:nth-child(1) {
        width: 10%;
        text-align: center;
    }
    
    .baocao-tonkho .data-table th:nth-child(2),
    .baocao-tonkho .data-table td:nth-child(2) {
        width: 40%;
    }
    
    .baocao-tonkho .data-table th:nth-child(3),
    .baocao-tonkho .data-table td:nth-child(3) {
        width: 25%;
        text-align: center;
    }
    
    .baocao-tonkho .data-table th:nth-child(4),
    .baocao-tonkho .data-table td:nth-child(4) {
        width: 25%;
        text-align: right;
    }
    
    /* TOP Products table (3 columns) */
    .baocao-topproducts .data-table th:nth-child(1),
    .baocao-topproducts .data-table td:nth-child(1) {
        width: 15%;
        text-align: center;
    }
    
    .baocao-topproducts .data-table th:nth-child(2),
    .baocao-topproducts .data-table td:nth-child(2) {
        width: 60%;
    }
    
    .baocao-topproducts .data-table th:nth-child(3),
    .baocao-topproducts .data-table td:nth-child(3) {
        width: 25%;
        text-align: center;
    }
}

/* ============================================
   MOBILE-OPTIMIZED FILTERS FOR TONKHO
   ============================================ */

    .filters-mobile {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-bottom: 20px;
    }

    /* Filter Section */
    .filter-section {
        margin-bottom: 20px;
    }

    .filter-card {
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .filter-label {
        display: block;
        font-weight: 600;
        color: #495057;
        margin-bottom: 8px;
        font-size: 14px;
        position: relative;
        z-index: 1;
    }

    .filter-label i {
        margin-right: 6px;
        color: #007bff;
    }

    .filter-input-group {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        background: white;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        padding: 0;
        transition: all 0.3s;
        height: 48px;
        box-sizing: border-box;
    }

    .filter-input-group:hover {
        border-color: #007bff;
        background: #f8f9fa;
    }

    .filter-input-number {
        flex: 1;
        height: 100%;
        padding: 0 15px;
        border: none;
        border-radius: 0;
        font-size: 14px;
        background: transparent;
        outline: none;
        transition: all 0.3s;
        box-sizing: border-box;
    }

    .filter-input-number::placeholder {
        color: #6c757d;
    }

    .filter-input-number:focus {
        outline: none;
    }

    .filter-count {
        background: #007bff;
        color: white;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        margin-right: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Icon trong input group (nếu có) */
    .filter-input-group i,
    .filter-input-group .input-icon {
        padding-left: 15px;
        color: #007bff;
        margin-right: 8px;
        flex-shrink: 0;
    }

    /* Mobile Multi-Select */
    .mobile-multiselect {
        position: relative;
        background: transparent;
        border-radius: 8px;
    }

    .multiselect-btn {
        width: 100%;
        height: 48px;
        padding: 0 15px;
        background: white;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        transition: all 0.3s;
        box-sizing: border-box;
    }

    .multiselect-btn:hover {
        border-color: #007bff;
        background: #f8f9fa;
    }

    .multiselect-btn i {
        margin-right: 8px;
    }

    .multiselect-btn .count {
        background: #007bff;
        color: white;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 12px;
        margin-left: 8px;
        margin-right: 10px;
    }

    .multiselect-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        display: none;
        z-index: 1000;
    }

    .multiselect-dropdown.show {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-top: 5px;
        max-height: 250px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 4px 16px rgba(0,0,0,0.2);
        background: white;
    }

    .multiselect-options {
        max-height: none;
        overflow: visible;
        padding: 8px 0;
    }

    .multiselect-dropdown .multiselect-options {
        max-height: 200px;
        overflow-y: auto;
    }

.multiselect-empty {
    padding: 12px;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

    .multiselect-search {
        padding: 12px;
        border-bottom: 1px solid #dee2e6;
        background: #f8f9fa;
    }

    .multiselect-search-input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        font-size: 14px;
    }

    /* Removed duplicate */

    .multiselect-option {
        padding: 12px 15px;
        display: flex;
        align-items: center;
        cursor: pointer;
        border-bottom: 1px solid #f0f0f0;
        transition: background 0.2s;
    }

    .multiselect-option:hover {
        background: #f8f9fa;
    }

    .multiselect-option input[type="checkbox"] {
        margin-right: 12px;
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: #007bff;
    }

    .multiselect-option span {
        flex: 1;
        font-size: 14px;
        color: #495057;
    }

    .multiselect-actions {
        padding: 12px;
        display: flex;
        gap: 10px;
        border-top: 1px solid #dee2e6;
        background: #f8f9fa;
    }

    .multiselect-actions button {
        flex: 1;
        padding: 8px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        background: white;
        color: #495057;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .multiselect-actions button:hover {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }

    /* Clear Filters Button */
    .btn-clear-filters {
        width: 100%;
        padding: 12px;
        background: #dc3545;
        color: white;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s;
        display: none; /* Hidden by default, shown when filters are active */
        margin-top: 15px;
    }

    .btn-clear-filters:hover {
        background: #c82333;
        transform: translateY(-1px);
    }

    /* Filter Summary */
    .filter-summary {
        padding: 10px 15px;
        background: #e7f3ff;
        border-left: 4px solid #007bff;
        border-radius: 6px;
        margin-bottom: 15px;
        font-size: 14px;
        color: #004085;
    }

    .filter-summary small {
        display: flex;
        align-items: center;
        gap: 15px;
        color: #0056b3;
        font-size: 14px;
        font-weight: 500;
    }

    /* Total Records Info */
    .total-records-info {
        margin: 10px 0 15px 0;
        padding: 8px 15px;
        background: #e7f3ff;
        border-left: 3px solid #007bff;
        border-radius: 4px;
    }

    .total-records-info small {
        display: flex;
        align-items: center;
        gap: 15px;
        color: #0056b3;
        font-size: 13px;
        font-weight: 500;
    }

    .total-records-info span {
        /* font-weight: 600; */
        color: #004085;
    }

    .info-divider {
        display: inline-block;
        width: 3px;
        height: 20px;
        background-color: #007bff;
        flex-shrink: 0;
        align-self: center;
    }

    /* Mobile Responsive for Summary Bars */
    @media (max-width: 767px) {
        .filter-summary small,
        .total-records-info small {
            flex-wrap: wrap;
            gap: 8px;
            font-size: 12px;
        }
        
        .filter-summary,
        .total-records-info {
            padding: 8px 12px;
        }
        
        .info-divider {
            display: none; /* Hide dividers on mobile to save space */
        }
        
        .filter-summary small > span,
        .total-records-info small > span {
            white-space: nowrap;
        }
    }

    /* Desktop Responsive */
    @media (min-width: 768px) {
        /* Fix BaoCao tables on desktop */
        .baocao-container .table-responsive {
            overflow-x: visible;
        }
        
        .baocao-container .data-table {
            width: 100%;
            table-layout: fixed;
        }
        
        .baocao-container .data-table th,
        .baocao-container .data-table td {
            padding: 0.5rem;
            font-size: 0.85rem;
            word-wrap: break-word;
        }
        
        /* Tồn Kho table (4 columns) - Desktop */
        .baocao-tonkho .data-table th:nth-child(1),
        .baocao-tonkho .data-table td:nth-child(1) {
            width: 10%;
            text-align: center;
        }
        
        .baocao-tonkho .data-table th:nth-child(2),
        .baocao-tonkho .data-table td:nth-child(2) {
            width: 40%;
        }
        
        .baocao-tonkho .data-table th:nth-child(3),
        .baocao-tonkho .data-table td:nth-child(3) {
            width: 25%;
            text-align: center;
        }
        
        .baocao-tonkho .data-table th:nth-child(4),
        .baocao-tonkho .data-table td:nth-child(4) {
            width: 25%;
            text-align: right;
        }
        
        /* TOP Products table (3 columns) - Desktop */
        .baocao-topproducts .data-table th:nth-child(1),
        .baocao-topproducts .data-table td:nth-child(1) {
            width: 15%;
            text-align: center;
        }
        
        .baocao-topproducts .data-table th:nth-child(2),
        .baocao-topproducts .data-table td:nth-child(2) {
            width: 60%;
        }
        
        .baocao-topproducts .data-table th:nth-child(3),
        .baocao-topproducts .data-table td:nth-child(3) {
            width: 25%;
            text-align: center;
        }
        
        .filters-mobile {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 15px;
            align-items: stretch;
        }
        
        .filters-mobile {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 5px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
        }
        
        .filters-mobile .filter-card {
            background: transparent;
            box-shadow: none;
            padding: 0 !important;
        }
        
        .filter-input-group {
            width: 100%;
            background: white;
            border: 2px solid #dee2e6;
            border-radius: 8px;
            padding: 0;
            display: flex;
            align-items: center;
            transition: all 0.3s;
            height: 56px;
            box-sizing: border-box;
        }

        .filter-input-group:hover {
            border-color: #007bff;
            background: #f8f9fa;
        }
        
        .mobile-multiselect {
            background: white;
            border-radius: 8px;
            padding: 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            height: 56px;
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }
        
        .mobile-multiselect .multiselect-btn {
            background: white;
            border: 2px solid #dee2e6;
            border-radius: 8px;
            box-shadow: none;
            height: 56px;
            padding: 0 15px;
            transition: all 0.3s;
            box-sizing: border-box;
        }
        
        .mobile-multiselect .multiselect-btn:hover {
            border-color: #007bff;
            background: #f8f9fa;
        }
        
        .btn-clear-filters {
            grid-column: 1 / -1;
            margin-top: 15px;
        }
    }

    /* Mobile Specific Styles */
    @media (max-width: 767px) {
        .filters-mobile {
            padding: 10px;
        }
        
        /* Đảm bảo filter-card trong mobile layout không có padding */
        .filters-mobile .filter-card {
            padding: 0 !important;
        }
        
        /* Trên mobile, filter-input-group và multiselect-btn có height: 56px */
        .filter-input-group {
            height: 56px;
        }
        
        .multiselect-btn {
            height: 56px;
            padding: 0 15px;
        }
        
        .filter-input-number {
            font-size: 16px; /* Larger for mobile input */
            padding: 0 15px; /* Padding ngang, height tự fit */
        }

        .search-filter-item .filter-input-number {
            font-size: 16px;
            padding: 0 15px;
        }
        
        .mobile-multiselect {
            height: 56px;
        }
        
        .mobile-multiselect .multiselect-btn {
            height: 56px;
            padding: 0 15px;
        }
    }

    /* ============================================
       SUB NAVIGATION TABS (for Search Module)
       ============================================ */
    
    .sub-nav-tabs {
        display: flex;
        gap: 10px;
        margin-top: 0;
        margin-bottom: 1.5rem;
        overflow-x: auto;
        border-bottom: 1px solid #e1e5e9;
        padding-bottom: 0;
    }
    
    /* Sub-nav-tabs trong search module - không cần margin-top */
    #search .sub-nav-tabs {
        margin-top: 0;
    }
    
    .sub-nav-tab {
        padding: 12px 24px;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-size: 15px;
        font-weight: 500;
        color: #6c757d;
        transition: all 0.3s ease;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .sub-nav-tab:hover {
        color: #667eea;
        background-color: #f8f9fa;
    }
    
    .sub-nav-tab.active {
        color: #667eea;
        border-bottom-color: #667eea;
        background-color: transparent;
    }
    
    .sub-tab-content {
        display: none;
    }
    
    .sub-tab-content.active {
        display: block;
    }
    
    @media (max-width: 767px) {
        .sub-nav-tabs {
            gap: 5px;
            margin-bottom: 1rem;
        }
        
        .sub-nav-tab {
            padding: 10px 16px;
            font-size: 14px;
        }
    }

/* ==================================================
   YEAR MANAGEMENT SECTION
   ================================================== */

.year-management-section {
    padding: 1.5rem;
}

/* Template Section */
.template-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.template-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-header h3 i {
    color: #667eea;
    font-size: 0.9rem;
}

.template-content {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
}

.template-content .template-info {
    margin: 0.25rem 0;
}

.template-content .template-info strong {
    color: #333;
}

.template-content .template-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.template-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

/* Years List Section */
.years-list-section {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.years-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.years-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.years-header h3 i {
    color: #667eea;
    font-size: 0.9rem;
}

.years-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-icon {
    background: #f5f7fa;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #666;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #333;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-sm.btn-primary {
    background: #667eea;
    color: white;
}

.btn-sm.btn-primary:hover {
    background: #5568d3;
}

.btn-sm.btn-success {
    background: #28a745;
    color: white;
}

.btn-sm.btn-success:hover {
    background: #218838;
}

.btn-sm.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-sm.btn-warning:hover {
    background: #e0a800;
}

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

.btn-sm.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-sm.btn-info:hover {
    background: #138496;
}

.btn-sm.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm.btn-danger:hover {
    background: #c82333;
}

.years-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.years-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.years-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.years-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.years-table th,
.years-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.years-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

.years-table tr:hover {
    background: #f9fafb;
}

.years-table .year-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.years-table .year-actions .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.year-link {
    color: #667eea;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.year-link:hover {
    text-decoration: underline;
}

.no-years-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-size: 0.875rem;
}

.no-years-message i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Tooltip styles - Buttons with title should still have pointer cursor */
[title] {
    position: relative;
}

/* Buttons with title should have pointer cursor, not help */
button[title],
.btn[title],
[title].btn {
    cursor: pointer !important;
}

/* Responsive */
@media (max-width: 768px) {
    .years-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .years-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .template-actions {
        flex-wrap: wrap;
    }
    
    .years-table {
        font-size: 0.8rem;
    }
    
    .years-table th,
    .years-table td {
        padding: 0.5rem 0.4rem;
    }
}

/* Year Form Modal Styles */
.year-form-section {
    margin: 1.25rem 0;
}

.year-form-section:first-of-type {
    margin-top: 0;
}

.year-form-section:last-of-type {
    margin-bottom: 0;
}

.year-form-section label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #333;
}

.year-form-section input,
.year-form-section select,
.year-form-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.year-form-section textarea {
    resize: vertical;
    min-height: 80px;
}

.year-form-section input:focus,
.year-form-section select:focus,
.year-form-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.year-form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.template-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.template-radio {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.template-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #667eea;
}

.template-radio span {
    font-size: 0.95rem;
    line-height: 1.35;
}

.template-radio:hover {
    background-color: #f5f7ff;
    border-color: #dfe3f7;
}

.template-radio.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.year-form-success {
    padding: 1rem;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
    margin-bottom: 1rem;
}

.year-form-success i {
    color: #28a745;
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .year-action-cards {
        grid-template-columns: 1fr;
    }
    
    .years-table {
        font-size: 0.85rem;
    }
    
    .years-table th,
    .years-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .year-action-card {
        flex-direction: column;
        text-align: center;
    }
    
    .year-action-card .card-icon {
        font-size: 2rem;
    }
}

/* Website Config Styles */
.website-config-section {
    padding: 1.5rem;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.config-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-header h3 i {
    color: #667eea;
}

.config-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e1e5e9;
}

.config-info {
    margin-bottom: 1rem;
}

.config-info div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.config-info strong {
    color: #333;
    margin-right: 0.5rem;
}

.config-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.config-form {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.config-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.config-loading i {
    margin-right: 0.5rem;
}

#websiteConfigLastUpdate {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}
