* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    padding-top: 100px;  /* Increased from 80px to account for taller top bar */
    padding-bottom: 0;
}

/* For home page specific styling, add this override */
body.home-body {
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-top: 0;
}

/* Add this to push content to take available space and push footer down */
.container, .home-container {
    flex: 1 0 auto; /* Take remaining space but don't shrink */
}

.container {
    width: 100%;
    max-width: none; /* Bỏ giới hạn max-width */
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden; /* Ngăn scroll ngang */
    margin-top: 20px;  /* Add some space after the top bar */
}

.main-title {
    text-align: center;
    margin: 0 0 30px 0;
    color: #333;
    font-size: 28px;
    font-weight: bold;
    width: 100%;
}

.upload-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #4CAF50;
    background: #f5f5f5;
}

.upload-area.highlight {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.upload-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.upload-content p {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.browse-link {
    color: #4CAF50;
    text-decoration: underline;
    pointer-events: all;
    cursor: pointer;
}

.browse-link:hover {
    color: #45a049;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: #4CAF50;
    color: white;
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #ddd;
}

.file-list {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-list h3 {
    margin-bottom: 10px;
    color: #333;
}

.file-list ul {
    list-style: none;
    padding: 0;
}

.file-list li {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list li:last-child {
    border-bottom: none;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background-color: #4CAF50;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background-color: #45a049;
}

.btn.primary:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn.secondary {
    background-color: #f44336;
    color: white;
}

.btn.secondary:hover:not(:disabled) {
    background-color: #da190b;
}

.btn.tertiary {
    background-color: #2196F3; /* Blue color for Reset View */
    color: white;
}

.btn.tertiary:hover:not(:disabled) {
    background-color: #0b7dda; /* Darker blue on hover */
}

.btn-delete {
    background-color: #f44336;
    border: 1px solid #d32f2f;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.btn-delete:hover {
    transform: scale(1.1);
    background-color: #d32f2f;
}

.trash-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z'/%3E%3C/svg%3E") no-repeat center;
}

.message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.message.success {
    display: block;
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.message.error {
    display: block;
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.imported-files-section {
    width: 100%;
    margin-top: 40px;
    background: white;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-selector {
    max-width: 800px;
    margin: 0 auto 20px;
    display: flex;
    gap: 10px;
}

.file-selector form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-grow: 1;
}

.file-selector form > * {
    height: 38px;
    display: flex;
    align-items: center;
}

.file-selector select {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.file-selector .btn {
    padding: 0 20px;
    white-space: nowrap;
    height: 40px;
}

.data-table {
    width: 100%;
    margin-top: 20px;
    overflow-x: auto;
}

.data-table table {
    min-width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: #8b0000; /* Màu đỏ đô */
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-size: 14px;
}

.data-table td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f5f5f5;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
}

.page-info {
    color: #666;
    font-size: 14px;
}

.sort-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-link::after {
    content: '⇅';
    opacity: 0.3;
}

.sort-link.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.sort-link.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

.table-container {
    max-height: calc(100vh - 400px); /* Chiều cao tối đa là chiều cao màn hình trừ đi khoảng trống cho các phần khác */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.table-container table {
    margin-top: 0;
    width: 100%;
    min-width: 100%;
}

.table-container thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #8b0000; /* Màu đỏ đô - phải set cả ở đây vì thead sticky */
}

.table-container th {
    position: relative;
    user-select: none;
    white-space: nowrap;  /* Ngăn text wrap để tính toán width chính xác */
    min-width: 100px;  /* Đặt độ rộng tối thiểu cho mỗi cột */
    font-size: 14px;
}

.resize-handle {
    position: absolute;
    right: -2px;  /* Điều chỉnh vị trí để dễ nắm hơn */
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.1);
    cursor: col-resize;
    z-index: 1;
}

.resize-handle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.resize-handle.active {
    background-color: rgba(255, 255, 255, 0.5);
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-jump input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.page-jump .btn {
    padding: 8px 12px;
}

/* Add style for the static data values */
.data-value {
    display: block;
    padding: 4px 8px;
    font-size: 15px;
}

/* Comment out edit-related styles but keep them for reference */
/*
.edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    background: transparent;
}

.edit-input:hover {
    border-color: #ddd;
    background: #fff;
}

.edit-input:focus {
    border-color: #4CAF50;
    background: #fff;
    outline: none;
}

.edit-controls {
    position: fixed; 
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
}
*/

.loading-container {
    margin-top: 20px;
    text-align: center;
}

.loading-text {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background-color: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    width: 30%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 2px;
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* Xóa các styles không cần thiết */
.filter-row,
.filter-container,
.filter-dropdown,
.filter-search,
.filter-options,
.filter-option,
.filter-actions,
.column-filter,
.filter-dropdown-btn {
    display: none;
}

.modal-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(100vh);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1100;
    max-width: 600px; /* Tăng từ 400px lên 600px */
    width: 90%;
    display: none;
    transition: transform 0.5s ease;
}

.modal-alert.show {
    transform: translate(-50%, -50%) translateY(0);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-alert.success {
    border-left: 4px solid #4CAF50;
}

.modal-alert.error {
    border-left: 4px solid #f44336;
}

.modal-content {
    margin-bottom: 15px;
    line-height: 1.6;
    padding: 15px 20px;
    text-align: left;
    font-size: 14px;
    white-space: pre-wrap;
    color: #333;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.modal-content li {
    padding: 8px 0 8px 20px;
    position: relative;
}

.modal-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #f44336;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 15px;
}

.search-bar {
    padding: 10px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Remove highlight styles */
.search-highlight {
    display: none;
}

.search-highlight:hover {
    display: none;
}

.top-bar {
    background-color: #9f1c2eb8;
    width: 100%;
    height: 100px; /* Increased from 60px */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.logo {
    height: 85px; /* Increased from 40px */
    width: auto;
    padding-left: 70px;
}

.logo-link {
    height: 85px;
    display: flex;
    align-items: center;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.selected-file {
    font-size: 16px;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

.tab-container {
    width: 100%;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* .tab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #8b0000;
    color: white;
} */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.stats-table {
    width: 100%;
    overflow-y: auto;
    background: white;
}

.stats-table-container {
    flex: 1;
    overflow: hidden;
    margin: 0 -15px;
    padding: 0 15px;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    background-color: #8b0000;
    color: white;
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.stats-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.stats-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.stats-table tr:hover {
    background-color: #f5f5f5;
}

.stats-table.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.stats-table.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.stats-table.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.stats-table.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.stats-table.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.file-search {
    margin-bottom: 10px;
    width: 100%;
}

.file-search input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.file-search input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

.file-option {
    padding: 8px;
}

.file-option:hover {
    background-color: #f5f5f5;
}

.select-container {
    position: relative;
    width: 100%;
}

.select-container input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    font-size: 14px;
    border-bottom: none;
}

.select-container select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.button-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    align-items: center;  /* Thêm dòng này để căn giữa theo chiều dọc */
}

.button-container a.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;  /* Thêm height 100% */
    text-decoration: none;  /* Bỏ gạch chân của link */
    padding: 10px 20px;  /* Thêm padding giống các button khác */
}

.main-content {
    display: flex;
    width: 100%;
    gap: 30px;
    margin-top: 20px;
}

.left-section {
    flex: 2;  /* Changed from 1 to 2 to make it take up 2/3 */
    max-width: none; /* Remove max-width limit */
}

.right-section {
    flex: 1;
    max-width: 400px; /* Add max-width for better readability */
    display: flex;
    flex-direction: column;
}

.stats-container {
    height: 360px; /* Match height with left upload section */
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.stats-header {
    padding: 0 5px;
    margin-bottom: 15px;
}

.stats-table-container {
    flex: 1;
    position: relative;
    overflow: hidden;  /* Prevent container overflow */
    margin: 0 -15px;
    padding: 0 15px;
}

.stats-table {
    width: 100%;
    overflow-y: auto;
    background: white;
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.stats-table table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #8b0000;
}

.stats-table-container {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.stats-table-container::-webkit-scrollbar {
    width: 6px;
}

.stats-table-container::-webkit-scrollbar-track {
    background: transparent;
}

.stats-table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.stats-table-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.right-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden; /* For border-radius to work with table */
}

.stats-table th {
    background-color: #8b0000;
    color: white;
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
    font-weight: normal;
}

.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table tr:hover {
    background-color: #f9f9f9;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    background-color: #8b0000;
    color: white;
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
}

.stats-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.stats-table tr:hover {
    background-color: #f5f5f5;
}

/* Common table styles */
table th {
    font-size: 16px;
    padding: 12px;
}

table td {
    font-size: 15px;
    padding: 10px;
}

/* Stats table specific */
.stats-table th {
    font-size: 15px;
}

.stats-table td {
    font-size: 15px;
}

.data-table .edit-input {
    font-size: 15px;
}

/* File list table adjustments */
.file-list li {
    font-size: 15px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.date-filter input[type="date"]:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 3px rgba(76, 175, 80, 0.3);
}

.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

/* Shared scrollbar styles */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Apply to stats table */
.stats-table-container {
    flex: 1;
    overflow-y: auto;
}

.stats-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #8b0000;
}

/* Apply to imported files table */
.table-container {
    max-height: calc((100vh - 400px) * 1.5); /* Increased by 1.5x from previous value */
    overflow-y: auto;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #8b0000;
}

/* Update all scrollable containers */
.stats-table-container,
.table-container,
.select-container select {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.stats-table-container::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.select-container select::-webkit-scrollbar {
    width: 6px;
}

.stats-table-container::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.select-container select::-webkit-scrollbar-track {
    background: transparent;
}

.stats-table-container::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.select-container select::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.stats-table-container::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.select-container select::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.right-section iframe.stats-container {
    width: 100%;
    height: 360px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: white;
}

/* Modify styles for the totals row */
.totals-header-row {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.totals-header-row td {
    border: 1px solid #dee2e6;
    padding: 4px 8px;
    font-size: 15px;
}

.total-value {
    color: #8b0000;
    text-align: center;
    display: block;
    font-weight: bold;
}

.total-label {
    font-weight: bold;
    color: #333;
    padding-left: 8px;
}

/* Add these styles */
.user-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 20px;
}

.user-greeting {
    color: white;
    font-size: 16px;
}

.nav-logout {
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Add these styles for login alert */
.alert {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Footer styles */
.site-footer {
    width: 100%;
    padding: 8px 0;
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: auto;
    flex-shrink: 0; /* Don't allow footer to shrink */
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    clear: both;
    display: block;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #ddd;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
}

.footer-version {
    font-weight: bold;
    margin-bottom: 2px;
}

.footer-creator {
    font-style: italic;
}

/* File selection popup styles */
.file-select-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 1200;
    display: none;
    padding: 20px;
    overflow: hidden;
}

.file-select-modal.show {
    display: block;
}

.file-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.file-select-title {
    font-size: 18px;
    font-weight: bold;
}

.file-select-close {
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.file-select-search {
    padding: 10px 0;
}

.file-select-search input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.file-select-table-container {
    overflow-y: auto;
    max-height: calc(80vh - 160px);
}

.file-select-table {
    width: 100%;
    border-collapse: collapse;
}

.file-select-table th {
    background-color: #8b0000; /* Changed from light gray to dark red to match other tables */
    color: white; /* Explicitly setting text color to white for better contrast */
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    cursor: pointer;
}

.file-select-table th.sorted-asc:after {
    content: ' ↑';
}

.file-select-table th.sorted-desc:after {
    content: ' ↓';
}

.file-select-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.file-select-table tr:hover {
    background: #f9f9f9;
    cursor: pointer;
}

.file-select-table tr.selected {
    background: #d1e9ff; /* Darker blue background */
    font-weight: bold; /* Make text bold */
    border-left: 3px solid #2196F3; /* Add blue left border */
}

.selected-file-display {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: white;
    margin-bottom: 10px;
    gap: 5px; /* Add spacing between the text elements */
}

.viewing-text {
    color: #666;
    font-weight: 500;
}

#selectedFileName {
    color: #333;padding: 8px;
    display: flex;
}

.selected-file-display {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;    display: flex;    justify-content: flex-start; /* Changed from space-between to flex-start */    align-items: center;    background: white;    margin-bottom: 10px; /* Add margin to create space below */
}

#selectedFileName {
    color: #333;
}

/* Remove duplicate option-buttons styles and fix positioning */
.option-buttons {
    position: fixed;
    left: 20px;
    top: 120px;
    z-index: 100;
    width: auto;
    margin-bottom: 0;
    justify-content: flex-start;
    display: block;
}

/* Fix hamburger menu container to allow hover on dropdown */
.hamburger-container {
    position: relative;
    display: inline-block;
    /* Make container smaller */
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease; /* Add transition for container */
}

/* Add hover effect to container */
.hamburger-container:hover {
    transform: scale(1.05); /* Slightly enlarge on hover */
}

/* Hamburger icon */
.hamburger-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Make icon smaller */
    width: 40px;
    height: 40px;
    cursor: pointer;
    background-color: #8b0000;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    padding: 8px;
    transition: all 0.3s ease; /* Make all transitions smooth */
}

.hamburger-menu:hover {
    background-color: #a01010;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Enhanced shadow on hover */
}

/* SVG menu icon style */
.menu-icon {
    width: 20px;
    height: 20px;
    display: block;
    transition: transform 0.3s ease; /* Add transition for icon */
}

/* Add rotation effect to icon on hover */
.hamburger-container:hover .menu-icon {
    transform: rotate(5deg); /* Slight rotation effect */
}

/* Improve dropdown-content styling with gradual appearance */
.dropdown-content {
    visibility: hidden; /* Use visibility instead of display */
    position: absolute;
    left: 0;
    top: 45px;
    background-color: white;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 101;
    padding: 5px 0;
    border: 1px solid #eee;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s; /* Add delay to visibility */
    pointer-events: none; /* Prevent interaction while hidden */
}

/* Show dropdown with gradual animation */
.hamburger-container:hover .dropdown-content,
.dropdown-content:hover {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s; /* Remove delay for visibility */
    pointer-events: auto; /* Allow interaction when visible */
}

/* Enhance dropdown option styling */
.dropdown-option {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
    color: #8b0000;
}

.dropdown-option.active {
    background-color: #f0f0f0;
    color: #8b0000;
    font-weight: bold;
    border-left: 3px solid #8b0000;
    padding-left: 12px; /* Adjust padding to account for border */
}

/* Fix hover behavior - create a bridge between hamburger and dropdown */
.hamburger-container::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
    z-index: 100;
}

/* Show dropdown on hover over container OR dropdown itself */
.hamburger-container:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}

/* Keep the styles for option-btn but they won't be used with the hamburger menu */
.option-btn {
    padding: 12px 20px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    max-width: 300px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.option-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.option-btn.active {
    background-color: #8b0000;
    color: white;
}

/* View-only mode styles for AP users */
.upload-section-disabled {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
    filter: grayscale(30%);
}

.view-only-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.view-only-text {
    background-color: rgba(139, 0, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: rotate(-10deg);
    user-select: none;
}

/* Export Orders Report styles */
.column-selector {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: white;
}

.column-selector h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.column-checkbox {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    width: calc(25% - 15px); /* Exactly 4 items per row with gap consideration */
    background-color: white;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 0;
    min-width: unset;
}

.column-checkbox:hover {
    background-color: #f0f8ff;
    border-color: #c0d8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.column-checkbox input[type="checkbox"] {
    width: 20px;  /* Increased from 18px */
    height: 20px; /* Increased from 18px */
    margin-right: 12px;
    cursor: pointer;
    accent-color: #8b0000;
    flex-shrink: 0; /* Prevent checkbox from shrinking */
}

.column-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive cho column-checkbox */
@media screen and (max-width: 1200px) {
    .column-checkbox {
        width: calc(33.33% - 15px);
    }
}

@media screen and (max-width: 768px) {
    .column-checkbox {
        width: calc(50% - 15px);
    }
}

@media screen and (max-width: 480px) {
    .column-checkbox {
        width: 100%;
    }
    .column-checkbox-container {
        gap: 10px;
        padding: 15px;
    }
}

.date-filter-container {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.date-filter-container label {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.date-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-grow: 1;
    max-width: 200px; /* Adjust width as needed */
    font-size: 14px;
}

.record-count {
    background-color: #e0e0e0; /* Lighter background */
    color: #333; /* Darker text */
    padding: 6px 12px; /* Match small button padding */
    border-radius: 4px; /* Match button radius */
    font-size: 13px; /* Match small button font size */
    font-weight: normal; /* Normal weight */
    margin-left: auto; /* Push to the right */
}

.select-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.select-all-btn, .deselect-all-btn {
    padding: 8px 12px;
    font-size: 14px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
}

.select-all-btn:hover, .deselect-all-btn:hover {
    background-color: #e0e0e0;
}

.columns-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.column-checkbox {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.column-checkbox:hover {
    background-color: #f9f9f9;
}

.column-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.column-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.export-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.export-actions .btn {
    padding: 10px 20px;
    font-size: 16px;
}

.column-checkbox-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.column-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.export-actions {
    display: flex;
    justify-content: flex-end;
    margin: 20px 0;
}

.order-table-container {
    overflow-x: auto; /* Cho phép cuộn ngang khi bảng rộng hơn */
    overflow-y: auto; /* Cho phép cuộn dọc khi bảng cao hơn */
    margin: 20px 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    min-height: 200px;
    max-height: calc(100vh - 300px); /* Giới hạn chiều cao tối đa */
    position: relative; /* Để scrollbar hiển thị đúng */
    width: 100%; /* Đảm bảo container chiếm toàn bộ chiều rộng */
}

/* Style cho scrollbar */
.order-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.order-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.order-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.order-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px; /* Đảm bảo bảng có chiều rộng tối thiểu để hiển thị tất cả cột */
}

.order-table th {
    background-color: #8b0000;
    color: white;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap; /* Tránh header bị ngắt dòng */
    font-size: 14px
}

.order-table td {
    padding: 8px;
    border: 1px solid #ddd;
    white-space: nowrap; /* Tránh nội dung bị ngắt dòng */
    font-size: 14px
}

.order-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.order-table tr:hover {
    background-color: #f0f0f0;
}

.select-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.no-data-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    font-size: 18px;
    color: #666;
    font-style: italic;
}

.loading-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #8b0000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.pagination button {
    padding: 8px 15px;
    border: none;
    background-color: #8b0000;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background-color: #6b0000;
}

.page-info {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style cho export-section để làm container chính */
.export-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cập nhật style cho select-buttons */
.select-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Style cho container chứa danh sách cột */

.date-filter-container {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.date-filter-container label {
    font-weight: bold;
    color: #333;
    margin-right: 10px;
}

.date-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-grow: 1;
    max-width: 400px;
    font-size: 14px;
}

.date-info {
    margin-left: 10px;
}

.record-count {
    background-color: #8b0000;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}

.column-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.export-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Style cho nút Export */
.export-actions {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Style cho order-table-container */
.order-table-container {
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    overflow: hidden; /* Để border-radius hoạt động với overflow */
    margin-bottom: 20px;
    position: relative;
}

/* Container cho bảng có cuộn */
#data-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#data-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#data-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#data-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#data-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Style cho bảng order */
.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table th {
    background-color: #8b0000;
    color: white;
    padding: 12px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.order-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.order-table tr:hover {
    background-color: #f9f9f9;
}

/* Style cho loading spinner */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8b0000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Style cho thông báo không có dữ liệu */
.no-data-message {
    padding: 40px;
    text-align: center;
    color: #666;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cải thiện style cho pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #f9f9f9;
    gap: 10px;
}

.page-info {
    flex: 1;
    text-align: center;
    color: #444;
    font-size: 15px;
}

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-jump input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.page-jump .btn {
    padding: 8px 12px;
}

.insert-buttons { /* New style for the button container */
    display: flex;
    gap: 10px;
    margin-top: 10px; /* Add some space above the buttons */
}
