/* === FONT & RESET === */
@font-face {
    font-family: 'bentonmoddisp-blackitalic';
    src: url('~/bentonmoddisp-blackitalic.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* === LAYOUT === */
.container {
    display: flex;
    height: auto !important;
    width: 100%;
    overflow: hidden;
}

.nav-container {
    width: 10%;
    max-width: 250px;
    min-width: 60px;
    height: 100vh;
    position: relative;
    background-color: #ffffff;
}

.nav-column {
    height: 100%;
    overflow-y: auto;
    width: 250px;
    transition: width 0.3s ease;
    padding-top: 35px;
    background-color: #fff;
}

.nav-column.closed {
    width: 60px;
}

.main-container {
    flex: 1;
    display: grid;
    grid-template-rows: auto auto auto auto auto;
    padding: 20px 100px 20px 20px;
    overflow: auto;
    font-family: 'Inter', sans-serif;
}

/* === BREADCRUMB === */
.breadcrumb {
    grid-row: 1;
    padding: 10px 12px;
    font-size: 16px;
    color: #828282;
}

.breadcrumb a {
    color: #828282;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #828282;
    margin-left: 8px;
}

/* === COMMAND BAR === */
.command-bar {
    grid-row: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    margin: 10px 0;
    overflow-x: auto;
}

.command-bar h4 {
    color: #000;
    margin: 0;
    white-space: nowrap;
    font-size: 1.1rem;
    font-weight: 600;
}

#totalRecords {
    font-size: 15px;
    color: grey;
    margin-left: 10px;
}

/* === TABLE === */
.table-wrapper {
    grid-row: 3;
    overflow: auto;
    margin: 0;
}

.table-container {
    width: 100%;
    max-height: 615px;
    overflow: auto;
    position: relative;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

#BOMTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 2000px;
    table-layout: auto;
}

#BOMTable th,
#BOMTable td {
    font-size: 13px;
    padding: 6px;
    border: 2px solid #ddd;
    border-top: 0;
    border-left: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 30px;
}

#BOMTable th:first-child,
#BOMTable td:first-child {
    border-left: 2px solid #ddd;
}

#BOMTable tr:first-child th {
    border-top: 2px solid #ddd;
}

#BOMTable th {
    font-size: 15px;
    background-color: #FFCD00 !important;
    color: #000 !important;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.4);
}

#BOMTable tbody tr:hover {
    background-color: #FFF5CC;
    cursor: pointer;
}

#BOMTable tbody tr.selected {
    background-color: #FFE066;
}

/* === SORT ICON === */
.sort-icon {
    display: none;
}

.sort-icon::before {
    content: "↑↓";
}

/* Khi đang sort */
.sort-icon.asc::before {
    content: "↑";
}

.sort-icon.desc::before {
    content: "↓";
}

/* === PAGINATION === */
.pagination-container {
    grid-row: 4;
    text-align: center;
    margin: 15px 0;
}

.pagination-container button {
    padding: 8px 16px;
    margin: 0 10px;
    cursor: pointer;
    background-color: #FFCD00;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    min-width: 80px;
    font-weight: 500;
}

.pagination-container button:disabled {
    background-color: #ddd;
    cursor: not-allowed;
    opacity: 0.7;
}

.pagination-container span {
    font-size: 16px;
    margin: 0 10px;
}

.pagination-container input[type="number"] {
    width: 80px;
    padding: 8px;
    margin: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

/* === LOADING === */
#loading {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loading img {
    width: 150px;
    height: 150px;
}

/* === FILTER DROPDOWN === */
.filter-dropdown {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    min-width: 200px;
}

.filter-dropdown label {
    display: block;
    padding: 5px 10px;
    cursor: pointer;
}

.filter-dropdown label:hover {
    background-color: #f0f0f0;
}

.filter-icon {
    margin-left: 8px;
    cursor: pointer;
}

#clearFiltersBtn,
.command-bar button[onclick="downloadCSV()"] {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
}

#clearFiltersBtn:hover,
.command-bar button[onclick="downloadCSV()"]:hover {
    background-color: #FFCD00 !important;
    border-color: #FFCD00 !important;
}

/* === RESPONSIVE === */
@media screen and (max-width: 768px) {
    .main-container { padding: 15px; }
    .command-bar { flex-direction: column; align-items: flex-start; }
}