* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f7fb;
    color: #172033;
}

/* HEADER LAMA */
.topbar {
    background: #003D7C;
    color: #fff;
    padding: 18px 26px;
    border-bottom: 4px solid #F6C700;
}

.topbar h1 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
}

.topbar p {
    margin: 5px 0 0;
    color: #fff;
    opacity: .85;
    font-size: 13px;
}

/* LAYOUT */
.annotation-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: calc(100vh - 106px);
    transition: grid-template-columns .2s ease;
}

.annotation-layout.sidebar-collapsed {
    grid-template-columns: 48px minmax(0, 1fr);
}

.annotation-main {
    min-width: 0;
    padding: 24px;
    background: #f5f7fb;
}

/* =========================================================
   DATASET SIDEBAR - NEW DESIGN
   ========================================================= */
.dataset-sidebar {
    position: relative;
    width: 280px;
    min-width: 280px;
    background: #fff;
    border-right: 1px solid #e4e7ec;
    padding: 20px 14px;
    overflow-y: auto;
    transition: width .2s ease, min-width .2s ease, padding .2s ease;
}

.dataset-sidebar.collapsed {
    width: 48px;
    min-width: 48px;
    padding: 20px 8px;
}

.dataset-sidebar.collapsed .sidebar-title,
.dataset-sidebar.collapsed .dataset-search,
.dataset-sidebar.collapsed .dataset-type-tabs,
.dataset-sidebar.collapsed .dataset-tree-panel {
    display: none;
}

.dataset-sidebar.collapsed .dataset-collapse-btn {
    right: 9px;
}

.sidebar-title {
    margin-bottom: 15px;
    padding: 0 30px 0 1px;
}

.sidebar-title h2 {
    margin: 0;
    color: #182230;
    font-size: 15px;
    font-weight: 700;
}

.sidebar-title p {
    margin: 4px 0 0;
    color: #8a94a6;
    font-size: 11px;
}

.dataset-collapse-btn {
    position: absolute;
    top: 16px;
    right: 9px;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.dataset-collapse-btn:hover {
    background: #f2f4f7;
    color: #206bc4;
}

.dataset-search {
    margin-bottom: 14px;
}

.dataset-search .form-control {
    height: 38px;
    border-color: #dfe3e8;
    border-radius: 7px;
    font-size: 11px;
    box-shadow: none;
}

.dataset-search .form-control:focus {
    border-color: #84adE8;
    box-shadow: 0 0 0 3px rgba(32, 107, 196, .08);
}

.dataset-search .input-icon-addon {
    color: #98a2b3;
    font-size: 14px;
}

/* TYPE TABS */
.dataset-type-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-bottom: 16px;
    padding: 3px;
    background: #f2f4f7;
    border-radius: 8px;
}

.dataset-type-tab {
    min-width: 0;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #667085;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.dataset-type-tab:hover {
    color: #344054;
}

.dataset-type-tab.active {
    background: #fff;
    color: #206bc4;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

.dataset-type-tab small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #eef2f6;
    color: #667085;
    font-size: 9px;
    font-weight: 600;
}

.dataset-type-tab.active small {
    background: #eaf2ff;
    color: #206bc4;
}

/* TREE PANEL */
.dataset-tree-panel {
    display: none;
}

.dataset-tree-panel.active {
    display: block;
}

.dataset-tree-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 2px 7px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.dataset-tree-heading span:last-child {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* TREE */
.dataset-tree {
    font-size: 11px;
    color: #344054;
}

.dataset-folder {
    margin: 1px 0;
}

.dataset-folder summary {
    list-style: none;
}

.dataset-folder summary::-webkit-details-marker {
    display: none;
}

.folder-name {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 33px;
    padding: 5px 7px;
    border-radius: 7px;
    color: #344054;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, color .15s ease;
}

.folder-name:hover {
    background: #f5f7fa;
    color: #206bc4;
}

.folder-arrow {
    width: 14px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    color: #98a2b3;
    font-size: 12px;
    transition: transform .15s ease;
}

.dataset-folder[open]>.folder-name .folder-arrow {
    transform: rotate(90deg);
}

.folder-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    color: #667085;
    font-size: 15px;
}

.dataset-folder[open]>.folder-name .folder-icon {
    color: #206bc4;
}

.folder-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
}

.folder-children {
    margin-left: 13px;
    padding-left: 9px;
    border-left: 1px solid #eaecf0;
}

.dataset-file {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 33px;
    margin: 1px 0;
    padding: 5px 7px;
    border-radius: 7px;
    color: #667085;
    text-decoration: none;
    font-size: 10px;
    line-height: 1.35;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.dataset-file:hover {
    background: #f5f7fa;
    color: #206bc4;
}

.dataset-file.active {
    background: #eaf2ff;
    color: #175cd3;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #206bc4;
}

.file-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    color: #98a2b3;
    font-size: 13px;
}

.dataset-file:hover .file-icon,
.dataset-file.active .file-icon {
    color: #206bc4;
}

.file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 30px 10px;
    color: #98a2b3;
    font-size: 10px;
    text-align: center;
}

.tree-empty i {
    font-size: 22px;
}

.empty-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 35px 10px;
    color: #98a2b3;
    font-size: 11px;
    text-align: center;
}

.empty-sidebar i {
    font-size: 24px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .dataset-sidebar {
        width: 260px;
        min-width: 260px;
    }
}

/* EMPTY SIDEBAR */
.empty-sidebar {
    padding: 25px 10px;
    text-align: center;
    color: #737b8a;
    font-size: 12px;
}

/* PREVIEW CARD */
.preview-card {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 10px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e8ef;
}

.preview-header h2 {
    margin: 0;
    color: #172033;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.table-path {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
    word-break: break-all;
}

.table-unit {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.table-mode-badge {
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
}

.row-count {
    padding: 5px 10px;
    border-radius: 6px;
    background: #f3f5f9;
    color: #596477;
    font-size: 12px;
}

/* TABLE */
.table-container {
    width: 100%;
    max-height: 70vh;
    overflow: auto;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 9px 10px;
    border-right: 1px solid #dbe1e8;
    border-bottom: 1px solid #dbe1e8;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f8fb;
    color: #26364d;
    font-weight: 700;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

/* HIERARCHICAL TABLE */
.hierarchical-table .hierarchical-head {
    position: sticky;
    top: 0;
    z-index: 10;
}

.hierarchical-table .hierarchical-head th {
    position: sticky;
    box-sizing: border-box;
    background: #f7f8fb;
    color: #26364d;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    min-width: 100px;
    font-weight: 700;
}

.hierarchical-table .hierarchical-head th:first-child {
    z-index: 11;
}

.hierarchical-table tbody td {
    white-space: nowrap;
}

/* EMPTY TABLE */
.empty-table {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #737b8a;
}

.empty-table h3 {
    margin: 10px 0 5px;
    color: #374151;
    font-size: 15px;
}

.empty-table p {
    max-width: 430px;
    margin: 0;
    color: #737b8a;
    font-size: 12px;
    line-height: 1.6;
}

.empty-icon {
    font-size: 25px;
    color: #9aa3b2;
}

/* ALERT */
.alert {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 7px;
    font-size: 12px;
}

.alert.success {
    background: #eaf7ee;
    color: #21653a;
}

.alert.error {
    background: #fdecec;
    color: #8d2727;
}

/* NAVBAR ACTIVE */
.navbar-nav .nav-link.active {
    color: #206bc4;
    background: #eef4ff;
    border-radius: 6px;
}

/* RESPONSIVE */
@media (max-width: 800px) {

    .annotation-layout,
    .annotation-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .dataset-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 320px;
        border-right: 0;
        border-bottom: 1px solid #e5e8ef;
    }

    .dataset-sidebar.collapsed {
        width: 100%;
        min-width: 100%;
        height: 48px;
        max-height: 48px;
    }

    .annotation-main {
        padding: 14px;
    }

    .preview-header {
        flex-direction: column;
    }

    .preview-actions {
        width: 100%;
    }
}

/* DATASET PAGE */

.dataset-page {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: calc(100vh - 106px);
    transition: grid-template-columns .2s ease;
}

.dataset-page:has(.dataset-sidebar.collapsed) {
    grid-template-columns: 48px minmax(0, 1fr);
}

.dataset-page .dataset-sidebar {
    min-width: 0;
}

.dataset-main {
    min-width: 0;
    padding: 18px 22px 30px;
    background: #f5f7fb;
}

.dataset-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 14px;
    padding: 3px;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 7px;
    width: fit-content;
}

.dataset-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 5px;
    color: #596477;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.dataset-tab:hover {
    background: #f3f5f9;
    color: #206bc4;
}

.dataset-tab.active {
    background: #eaf2ff;
    color: #206bc4;
    font-weight: 600;
}

.dataset-tab i {
    font-size: 14px;
}

.dataset-info-card,
.comparison-card,
.matching-card,
.page-card {
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
}

.dataset-info-card {
    margin-bottom: 14px;
}

.dataset-info-main {
    padding: 16px 18px;
}

.dataset-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.dataset-kicker,
.page-kicker {
    margin-bottom: 4px;
    color: #7a8495;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
}

.dataset-title-row h1,
.page-card-header h1 {
    margin: 0;
    color: #172033;
    font-size: 17px;
    font-weight: 700;
}

.dataset-path {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    word-break: break-all;
}

.dataset-unit {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
}

.dataset-badges {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.dataset-badge,
.status-badge,
.source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f3f5f9;
    color: #596477;
    font-size: 10px;
    font-weight: 700;
}

.dataset-badge-blue {
    background: #eaf2ff;
    color: #206bc4;
}

.comparison-card {
    overflow: hidden;
}

.comparison-header,
.matching-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 18px;
    border-bottom: 1px solid #e5e8ef;
}

.comparison-header h2,
.matching-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.comparison-header p,
.matching-header p {
    margin: 4px 0 0;
    color: #737b8a;
    font-size: 11px;
}

.status-pending {
    background: #fff7df;
    color: #946b00;
}

.status-pass {
    background: #eaf7ee;
    color: #21653a;
}

.status-fail {
    background: #fdecec;
    color: #8d2727;
}

.comparison-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.comparison-panel {
    min-width: 0;
    border-right: 1px solid #e5e8ef;
}

.comparison-panel:last-child {
    border-right: 0;
}

.comparison-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #fafbfc;
    border-bottom: 1px solid #e5e8ef;
}

.comparison-label {
    display: block;
    margin-bottom: 2px;
    color: #7a8495;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
}

.comparison-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
}

.source-badge {
    background: #eef2ff;
    color: #334155;
}

.source-bps {
    background: #fff3e6;
    color: #a45b00;
}

.comparison-table-container {
    max-height: 470px;
    overflow: auto;
}

.comparison-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.comparison-table th,
.comparison-table td {
    padding: 8px 9px;
    border-right: 1px solid #dbe1e8;
    border-bottom: 1px solid #dbe1e8;
    white-space: nowrap;
}

.comparison-table th {
    background: #f7f8fb;
    color: #26364d;
    font-weight: 700;
    text-align: center;
}

.comparison-table tbody tr:hover {
    background: #fafbfc;
}

.bps-placeholder {
    min-height: 470px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px;
    text-align: center;
}

.bps-placeholder-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 50%;
    background: #f1f4f8;
    color: #7a8495;
    font-size: 20px;
}

.bps-placeholder h3 {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
}

.bps-placeholder p {
    max-width: 330px;
    margin: 0 0 14px;
    color: #737b8a;
    font-size: 11px;
    line-height: 1.6;
}

.comparison-empty {
    min-height: 470px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a94a6;
    font-size: 11px;
}

.matching-card {
    margin-top: 14px;
}

.matching-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 18px;
}

.matching-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #e1e5eb;
    border-radius: 7px;
    cursor: pointer;
    transition: .15s ease;
}

.matching-option:hover {
    border-color: #b8c9e8;
    background: #f8faff;
}

.matching-option.selected {
    border-color: #206bc4;
    background: #f2f6ff;
}

.matching-option input {
    margin: 0;
}

.matching-option-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f3f5f9;
    color: #64748b;
}

.matching-pass .matching-option-icon {
    background: #eaf7ee;
    color: #21653a;
}

.matching-fail .matching-option-icon {
    background: #fdecec;
    color: #b42318;
}

.matching-option strong {
    display: block;
    color: #293548;
    font-size: 12px;
}

.matching-option small {
    display: block;
    margin-top: 2px;
    color: #7a8495;
    font-size: 10px;
}

.matching-note {
    padding: 0 18px 14px;
}

.matching-note label {
    display: block;
    margin-bottom: 5px;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
}

.matching-note textarea {
    font-size: 11px;
}

.matching-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 18px;
    border-top: 1px solid #e5e8ef;
}

.matching-info {
    color: #7a8495;
    font-size: 10px;
}

.matching-info i {
    margin-right: 3px;
}

.dataset-welcome {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
    text-align: center;
}

.dataset-welcome-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 10px;
    background: #eaf2ff;
    color: #206bc4;
    font-size: 24px;
}

.dataset-welcome h1 {
    margin: 0 0 5px;
    font-size: 17px;
}

.dataset-welcome p {
    max-width: 400px;
    margin: 0;
    color: #737b8a;
    font-size: 11px;
    line-height: 1.6;
}

/* SIMPLE DATASET PAGES */

.dataset-simple-page {
    min-height: calc(100vh - 106px);
    padding: 18px 22px 30px;
    background: #f5f7fb;
}

.page-card {
    overflow: hidden;
}

.page-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 18px;
    border-bottom: 1px solid #e5e8ef;
}

.page-card-header p {
    margin: 4px 0 0;
    color: #737b8a;
    font-size: 11px;
}

.dataset-filter {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid #e5e8ef;
}

.dataset-filter-search {
    width: 300px;
}

.dataset-filter-search .form-control,
.dataset-filter-select {
    height: 36px;
    font-size: 11px;
}

.dataset-filter-select {
    width: 160px;
}

.dataset-list-table {
    margin: 0;
    font-size: 11px;
}

.dataset-list-table th {
    color: #596477;
    font-size: 10px;
    font-weight: 700;
}

.dataset-list-name {
    color: #26364d;
    font-weight: 600;
}

.annotator-check-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.check-info {
    padding: 18px;
    border-right: 1px solid #e5e8ef;
}

.check-form {
    padding: 18px;
}

.check-form h3 {
    margin: 0;
    font-size: 14px;
}

.check-description {
    margin: 4px 0 14px;
    color: #737b8a;
    font-size: 11px;
}

.check-info-box {
    margin-top: 15px;
    border: 1px solid #e5e8ef;
    border-radius: 7px;
}

.check-info-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 10px;
    border-bottom: 1px solid #e5e8ef;
    font-size: 11px;
}

.check-info-row:last-child {
    border-bottom: 0;
}

.check-info-row span {
    color: #737b8a;
}

.check-info-row strong {
    color: #293548;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    margin-bottom: 7px;
    border: 1px solid #e5e8ef;
    border-radius: 7px;
    cursor: pointer;
}

.check-item:hover {
    background: #fafbfc;
}

.check-item input {
    margin-top: 3px;
}

.check-item strong {
    display: block;
    font-size: 11px;
}

.check-item small {
    display: block;
    margin-top: 2px;
    color: #737b8a;
    font-size: 10px;
}

.check-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

/* RESPONSIVE */

@media (max-width: 900px) {

    .comparison-grid,
    .matching-options,
    .annotator-check-grid {
        grid-template-columns: 1fr;
    }

    .comparison-panel {
        border-right: 0;
        border-bottom: 1px solid #e5e8ef;
    }

    .comparison-panel:last-child {
        border-bottom: 0;
    }

    .check-info {
        border-right: 0;
        border-bottom: 1px solid #e5e8ef;
    }
}

@media (max-width: 700px) {

    .dataset-main,
    .dataset-simple-page {
        padding: 12px;
    }

    .dataset-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .dataset-tab {
        white-space: nowrap;
    }

    .dataset-title-row,
    .comparison-header,
    .matching-header,
    .matching-footer,
    .page-card-header {
        flex-direction: column;
    }

    .dataset-filter {
        flex-direction: column;
    }

    .dataset-filter-search,
    .dataset-filter-select {
        width: 100%;
    }
}

.table-responsive {
    padding: 8px;
}

.table-responsive .table {
    margin-bottom: 0;
    font-size: 12px;
}

.table-responsive .table th,
.table-responsive .table td {
    white-space: nowrap;
    vertical-align: middle;
}

.dataset-table-area {
    width: 100%;
    padding: 8px 10px 12px;
}

.dataset-table-area .table-responsive {
    width: 100%;
    overflow-x: auto;
}

.dataset-table-area .data-table {
    margin-bottom: 0;
    font-size: 12px;
}

.dataset-table-area .data-table th,
.dataset-table-area .data-table td {
    vertical-align: middle;
    white-space: nowrap;
}

.dataset-table-area .hierarchical-table th {
    text-align: center;
    white-space: normal;
}

.dataset-table-area .hierarchical-table th:first-child,
.dataset-table-area .hierarchical-table td:first-child {
    min-width: 170px;
}

.dataset-table-area .data-table thead th {
    background: #f5f7fa;
    font-weight: 600;
}

.dataset-table-area .data-table tbody tr:hover td {
    background: #f8fafc;
}

.bps-preview {
    width: 100%;
    height: 700px;
    overflow: hidden;
    background: #fff;
}

.bps-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

.bps-preview-footer {
    padding: 10px 14px;
    border-top: 1px solid #e6e8eb;
    text-align: right;
}

.bps-table-wrapper {
    width: 100%;
    max-height: 700px;
    overflow: auto;
    padding: 12px;
}

.bps-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bps-table-wrapper th,
.bps-table-wrapper td {
    border: 1px solid #dfe3e8;
    padding: 7px 9px;
    vertical-align: middle;
}

.bps-table-wrapper th {
    background: #f5f7fa;
    font-weight: 600;
    text-align: center;
}

.bps-table-wrapper tbody tr:hover td {
    background: #f8fafc;
}

.bps-table-footer {
    padding: 10px 14px;
    border-top: 1px solid #e6e8eb;
    text-align: right;
}

.matching-section {
    padding: 18px 20px;
    border-bottom: 1px solid #e6e8eb;
}

.matching-section-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #182433;
}

.matching-question {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.hierarchy-result {
    display: none;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 13px;
}

.hierarchy-result.visible {
    display: flex;
}


/* =========================================================
   APP HEADER
   ========================================================= */
.app-header {
    position: relative;
    z-index: 1000;
    height: 64px;
    background: #182536;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.app-header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.app-brand {
    flex: 0 0 auto;
    color: #fff;
    text-decoration: none;
    padding-right: 10px;
}

.app-brand-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.app-main-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    height: 100%;
}

.app-nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.app-nav-link {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border-radius: 7px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.app-nav-link i {
    font-size: 16px;
}

.app-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.app-nav-link.active {
    color: #fff;
    background: #206bc4;
}

.app-nav-link.dropdown-toggle::after {
    margin-left: 2px;
    opacity: .7;
}

.app-dropdown-menu {
    min-width: 245px;
    padding: 6px;
    margin-top: 8px !important;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
}

.app-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 6px;
    color: #293548;
}

.app-dropdown-menu .dropdown-item:hover {
    background: #f4f7fb;
}

.app-dropdown-menu .dropdown-item.active {
    background: #eaf2ff;
    color: #206bc4;
}

.app-dropdown-menu .dropdown-item-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    border-radius: 6px;
    background: #f3f5f9;
    color: #64748b;
}

.app-dropdown-menu .dropdown-item.active .dropdown-item-icon {
    background: #dceaff;
    color: #206bc4;
}

.app-dropdown-menu .dropdown-item strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.app-dropdown-menu .dropdown-item small {
    display: block;
    margin-top: 2px;
    color: #8a94a6;
    font-size: 10px;
    line-height: 1.3;
}

/* =========================================================
   USER DROPDOWN
   ========================================================= */

.app-user {
    position: relative;
    margin-left: auto;
    flex: 0 0 auto;
}

.app-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 6px 8px;
    cursor: pointer;
    color: #fff;
    border-radius: 8px;
}

.app-user-trigger:hover {
    background: rgba(255, 255, 255, .08);
}

.app-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #206bc4;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.app-user-info {
    min-width: 0;
    text-align: left;
}

.app-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

.app-user-role {
    margin-top: 1px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    line-height: 15px;
    white-space: nowrap;
}

.app-user-chevron {
    font-size: 16px;
    color: rgba(255, 255, 255, .55);
    transition: transform .15s ease;
}

.app-user.open .app-user-chevron {
    transform: rotate(180deg);
}

/* DROPDOWN CONTAINER */
.app-user-dropdown-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: 260px;
    min-width: 260px;
    padding: 6px;
    display: none;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
}

.app-user.open .app-user-dropdown-menu {
    display: block !important;
}

/* DROPDOWN HEADER */
.app-user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.app-user-dropdown-header strong {
    display: block;
    color: #1f2937;
    font-size: 13px;
    line-height: 18px;
}

.app-user-dropdown-header small {
    display: block;
    margin-top: 2px;
    color: #667085;
    font-size: 11px;
    line-height: 15px;
}

.app-user-avatar-large {
    width: 38px;
    height: 38px;
}

/* DIVIDER */
.app-user-dropdown-menu .dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: #e5e7eb;
}

/* LOGOUT ITEM */
.app-user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    margin: 0;
    color: #293548;
    text-decoration: none;
    border-radius: 7px;
    background: transparent;
}

.app-user-dropdown-menu .dropdown-item:hover {
    background: #f5f7fa;
    color: #206bc4;
}

.app-user-dropdown-menu .dropdown-item-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    border-radius: 6px;
    background: #f3f5f9;
    color: #64748b;
}

.app-user-dropdown-menu .dropdown-item:hover .dropdown-item-icon {
    background: #eaf2ff;
    color: #206bc4;
}

.app-user-dropdown-menu .dropdown-item>span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-user-dropdown-menu .dropdown-item strong {
    display: block;
    color: #293548;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.app-user-dropdown-menu .dropdown-item small {
    display: block;
    margin-top: 2px;
    color: #8a94a6;
    font-size: 10px;
    line-height: 1.3;
}

.app-user-info {
    line-height: 1.2;
}

.app-user-name {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.app-user-role {
    margin-top: 3px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
}

.app-user-chevron {
    margin-left: 2px;
    color: rgba(255, 255, 255, .55);
    font-size: 14px;
}

@media (max-width: 1000px) {
    .app-header-inner {
        gap: 12px;
    }

    .app-brand {
        padding-right: 2px;
    }

    .app-brand-title {
        font-size: 17px;
    }

    .app-nav-link {
        padding: 0 9px;
    }

    .app-nav-link span {
        display: none;
    }

    .app-nav-link i {
        font-size: 17px;
    }
}

@media (max-width: 700px) {
    .app-header {
        height: auto;
    }

    .app-header-inner {
        min-height: 60px;
        height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
    }

    .app-main-nav {
        order: 3;
        width: 100%;
        height: 42px;
        overflow-x: auto;
    }

    .app-nav-link span {
        display: inline;
    }

    .app-user-info,
    .app-user-chevron {
        display: none;
    }
}

/* =========================================================
   DATASET MATCHING - REDESIGN
   ========================================================= */

.dataset-info-card {
    margin-bottom: 12px;
}

.dataset-info-main {
    padding: 14px 18px;
}

.dataset-title-row {
    align-items: center;
}

.dataset-title-content {
    min-width: 0;
}

.dataset-title-row h1 {
    font-size: 17px;
    line-height: 1.35;
}

.dataset-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
    color: #667085;
    font-size: 10px;
}

.dataset-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.dataset-meta i {
    color: #98a2b3;
    font-size: 12px;
}

.dataset-badges {
    align-items: center;
}

.comparison-card {
    overflow: hidden;
}

.comparison-header {
    padding: 13px 18px;
    background: #fff;
}

.comparison-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.comparison-title>i {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eef4ff;
    color: #206bc4;
    font-size: 15px;
}

.comparison-header h2 {
    font-size: 14px;
}

.comparison-header p {
    margin-top: 3px;
}

.comparison-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

.comparison-status i {
    font-size: 12px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
}

.comparison-panel {
    min-width: 0;
    border-right: 1px solid #e5e8ef;
    overflow: hidden;
}

.comparison-panel:last-child {
    border-right: 0;
}

.comparison-panel-header {
    min-height: 58px;
    padding: 10px 13px;
    background: #fafbfc;
}

.comparison-source {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.comparison-source-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    border-radius: 7px;
    font-size: 14px;
}

.json-icon {
    background: #eef4ff;
    color: #206bc4;
}

.bps-icon {
    background: #fff4e5;
    color: #a45b00;
}

.comparison-source>div:last-child {
    min-width: 0;
}

.comparison-label {
    margin-bottom: 1px;
    font-size: 8px;
}

.comparison-panel-header h3 {
    font-size: 12px;
}

.comparison-table-container {
    height: 500px;
    max-height: 500px;
    overflow: auto;
    padding: 0;
    background: #fff;
}

.comparison-table {
    width: max-content !important;
    min-width: 100%;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.comparison-table th,
.comparison-table td {
    padding: 7px 9px;
    border-right: 1px solid #dfe3e8;
    border-bottom: 1px solid #dfe3e8;
    white-space: nowrap;
    vertical-align: middle;
}

.comparison-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f5f7fa;
    color: #26364d;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.comparison-table tbody td {
    color: #344054;
    background: #fff;
}

.comparison-table tbody tr:hover td {
    background: #f8fafc;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    min-width: 150px;
}

.hierarchical-table thead th {
    white-space: normal;
    min-width: 90px;
    line-height: 1.35;
}

.hierarchical-table thead tr:first-child th {
    z-index: 7;
}

.bps-table-container {
    padding: 0;
}

.bps-table-container>table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.bps-table-container th,
.bps-table-container td {
    padding: 7px 9px;
    border-right: 1px solid #dfe3e8;
    border-bottom: 1px solid #dfe3e8;
    white-space: nowrap;
    vertical-align: middle;
}

.bps-table-container thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f5f7fa;
    color: #26364d;
    font-weight: 600;
    text-align: center;
}

.bps-table-container tbody td {
    background: #fff;
}

.bps-table-container tbody tr:hover td {
    background: #f8fafc;
}

.bps-table-footer {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px;
    border-top: 1px solid #e5e8ef;
    background: #fafbfc;
}

.comparison-empty {
    height: 500px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #98a2b3;
    text-align: center;
}

.comparison-empty i {
    margin-bottom: 5px;
    font-size: 28px;
}

.comparison-empty strong {
    color: #475467;
    font-size: 12px;
}

.comparison-empty span {
    font-size: 10px;
}

/* =========================================================
   DATATABLES
   ========================================================= */

.comparison-panel .dt-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comparison-panel .dt-layout-row {
    margin: 0 !important;
    padding: 7px 10px;
}

.comparison-panel .dt-layout-row:first-child {
    border-bottom: 1px solid #e5e8ef;
    background: #fff;
}

.comparison-panel .dt-layout-row:last-child {
    border-top: 1px solid #e5e8ef;
    background: #fafbfc;
}

.comparison-panel .dt-search {
    display: flex;
    align-items: center;
}

.comparison-panel .dt-search label {
    display: none;
}

.comparison-panel .dt-search input {
    width: 190px !important;
    height: 30px;
    margin: 0 !important;
    padding: 4px 9px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    outline: none;
    box-shadow: none;
    font-size: 10px;
}

.comparison-panel .dt-search input::placeholder {
    color: #98a2b3;
}

.comparison-panel .dt-search input:focus {
    border-color: #84ade8;
    box-shadow: 0 0 0 2px rgba(32, 107, 196, .08);
}

.comparison-panel .dt-info {
    padding: 0 !important;
    color: #667085;
    font-size: 9px;
}

.comparison-panel .dt-paging {
    display: flex;
    align-items: center;
    gap: 2px;
}

.comparison-panel .dt-paging-button {
    min-width: 25px;
    height: 25px;
    padding: 2px 6px !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: transparent !important;
    color: #667085 !important;
    font-size: 9px !important;
}

.comparison-panel .dt-paging-button:hover {
    background: #eef4ff !important;
    color: #206bc4 !important;
}

.comparison-panel .dt-paging-button.current {
    background: #206bc4 !important;
    color: #fff !important;
}

.comparison-panel .dt-length {
    display: none;
}

.comparison-panel .dt-column-order {
    opacity: .5;
}

.comparison-panel .dt-empty {
    height: 350px;
    color: #98a2b3;
    text-align: center;
}

/* TABLE AREA */
.comparison-panel .dt-layout-table {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 !important;
}

.comparison-panel .dt-layout-table .dt-table {
    width: max-content !important;
    min-width: 100%;
    margin: 0 !important;
}

.comparison-panel .dt-scroll-body {
    max-height: none !important;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .comparison-panel {
        border-right: 0;
        border-bottom: 1px solid #e5e8ef;
    }

    .comparison-panel:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 700px) {
    .dataset-meta {
        gap: 7px;
    }

    .comparison-header {
        flex-direction: column;
    }

    .comparison-table-container {
        height: 420px;
        max-height: 420px;
    }

    .comparison-panel .dt-search input {
        width: 150px !important;
    }
}

/* =========================================================
   TABLE MATCHING - FINAL VISUAL
   ========================================================= */

.comparison-card {
    overflow: hidden;
    background: #f8fafc;
}

.comparison-header {
    background: #fff;
    padding: 15px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    background: #f5f7fb;
}

.comparison-panel {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe4ec;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.comparison-panel:last-child {
    border-right: 1px solid #dfe4ec;
}

.comparison-panel-header {
    min-height: 62px;
    padding: 11px 13px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.comparison-panel:first-child .comparison-panel-header {
    background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
    border-top: 3px solid #206bc4;
}

.comparison-panel:last-child .comparison-panel-header {
    background: linear-gradient(180deg, #fff8ed 0%, #ffffff 100%);
    border-top: 3px solid #f59f00;
}

.comparison-source {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comparison-source-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    border-radius: 8px;
    font-size: 15px;
}

.json-icon {
    background: #e8f1ff;
    color: #206bc4;
}

.bps-icon {
    background: #fff0d9;
    color: #d97706;
}

.comparison-label {
    color: #98a2b3;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .08em;
}

.comparison-panel-header h3 {
    margin: 2px 0 0;
    color: #182230;
    font-size: 12px;
    font-weight: 700;
}

.comparison-panel:first-child .source-badge {
    background: #e8f1ff;
    color: #206bc4;
}

.comparison-panel:last-child .source-badge {
    background: #fff0d9;
    color: #c46a00;
}

.comparison-table-container {
    height: 480px;
    max-height: 480px;
    overflow: auto;
    padding: 0;
    background: #fff;
}

.comparison-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.comparison-table-container::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.comparison-table-container::-webkit-scrollbar-thumb {
    background: #c7ced8;
    border-radius: 10px;
}

.comparison-table-container::-webkit-scrollbar-thumb:hover {
    background: #aeb7c4;
}

/* =========================================================
   JSON DATATABLE
   ========================================================= */

.comparison-panel:first-child .dt-container {
    width: 100%;
    background: #fff;
}

.comparison-panel:first-child .dt-layout-row {
    margin: 0 !important;
    padding: 8px 10px;
}

.comparison-panel:first-child .dt-layout-row:first-child {
    background: #f8fbff;
    border-bottom: 1px solid #e4eaf2;
}

.comparison-panel:first-child .dt-layout-row:last-child {
    background: #f8fbff;
    border-top: 1px solid #e4eaf2;
}

.comparison-panel:first-child .dt-search {
    width: 100%;
}

.comparison-panel:first-child .dt-search label {
    display: none;
}

.comparison-panel:first-child .dt-search input {
    width: 100% !important;
    height: 31px;
    margin: 0 !important;
    padding: 5px 10px 5px 31px;
    border: 1px solid #d8e1ef;
    border-radius: 6px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    font-size: 10px;
    box-shadow: none;
}

.comparison-panel:first-child .dt-search input:focus {
    border-color: #75a9e8;
    box-shadow: 0 0 0 2px rgba(32, 107, 196, .08);
}

.comparison-panel:first-child .dt-layout-table {
    padding: 0 !important;
    overflow: auto;
}

.comparison-panel:first-child .dt-layout-table .dt-table {
    width: max-content !important;
    min-width: 100%;
    margin: 0 !important;
}

.comparison-panel:first-child .comparison-table {
    width: max-content !important;
    min-width: 100%;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.comparison-panel:first-child .comparison-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #eef5ff;
    color: #23466f;
    border-color: #d6e2f0;
    font-weight: 700;
    text-align: center;
}

.comparison-panel:first-child .comparison-table tbody td {
    background: #fff;
    color: #344054;
    border-color: #e4e8ee;
}

.comparison-panel:first-child .comparison-table tbody tr:nth-child(even) td {
    background: #fafcff;
}

.comparison-panel:first-child .comparison-table tbody tr:hover td {
    background: #eef6ff;
}

.comparison-panel:first-child .dt-info {
    color: #667085;
    font-size: 9px;
}

.comparison-panel:first-child .dt-paging-button {
    min-width: 26px;
    height: 26px;
    margin-left: 2px !important;
    padding: 3px 7px !important;
    border: 1px solid transparent !important;
    border-radius: 5px !important;
    background: transparent !important;
    color: #667085 !important;
    font-size: 9px !important;
}

.comparison-panel:first-child .dt-paging-button:hover {
    background: #e8f1ff !important;
    border-color: #d5e4f8 !important;
    color: #206bc4 !important;
}

.comparison-panel:first-child .dt-paging-button.current {
    background: #206bc4 !important;
    border-color: #206bc4 !important;
    color: #fff !important;
}

/* =========================================================
   BPS TABLE
   ========================================================= */

.bps-table-container {
    height: 480px;
    max-height: 480px;
    padding: 0;
    overflow: auto;
    background: #fff;
}

.bps-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bps-table-container::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.bps-table-container::-webkit-scrollbar-thumb {
    background: #d6d0c6;
    border-radius: 10px;
}

.bps-table-container>table {
    width: max-content;
    min-width: 100%;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
}

.bps-table-container>table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff7e8;
    color: #704900;
    border-color: #eadfcd;
    font-weight: 700;
    text-align: center;
}

.bps-table-container>table td {
    background: #fff;
    color: #344054;
    border-color: #e5e7eb;
}

.bps-table-container>table tbody tr:nth-child(even) td {
    background: #fffdfa;
}

.bps-table-container>table tbody tr:hover td {
    background: #fff6e6;
}

.bps-table-footer {
    padding: 8px 10px;
    background: #fffaf3;
    border-top: 1px solid #eadfcd;
}

/* =========================================================
   COMPARISON STATUS
   ========================================================= */

.comparison-status.status-pending {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff7df;
    border: 1px solid #f4df9a;
    color: #946b00;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1000px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .comparison-panel {
        border-right: 1px solid #dfe4ec;
    }
}

.dataset-location {
    color: #667085;
    font-weight: 600;
}

.comparison-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-success {
    color: #198754;
    background: #eaf7ee;
}

.status-warning {
    color: #b54708;
    background: #fff4e5;
}

.status-pending {
    color: #667085;
    background: #f2f4f7;
}


.matching-reason {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.matching-reason label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #344054;
}

.matching-reason textarea {
    display: block;
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #101828;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.matching-reason textarea:focus {
    border-color: #206bc4;
    box-shadow: 0 0 0 3px rgba(32, 107, 196, .12);
}

.matching-reason textarea::placeholder {
    color: #98a2b3;
}

.comparison-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#refreshBpsBtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#refreshBpsBtn.loading {
    pointer-events: none;
    opacity: .7;
}

#refreshBpsIcon {
    transition: transform .3s ease;
}

#refreshBpsBtn.loading #refreshBpsIcon {
    animation: bpsSpin .8s linear infinite;
}

@keyframes bpsSpin {
    from {
        transform: rotate(0deg)
    }

    to {
        transform: rotate(360deg)
    }
}


/* .app-dropdown-menu {
    min-width: 245px;
    padding: 6px;
    margin-top: 8px !important;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
    box-shadow: 0 10px 30px rgba(16,24,40,.12);
} */

/* .app-nav-item.dropdown{
    position:relative;
}

.app-nav-item.dropdown .app-dropdown-menu{
    top:100%;
    left:0;
    right:auto;
    margin-top:8px !important;
} */

/* FIX DROPDOWN NAVBAR */
.app-nav-item.dropdown {
    position: relative !important;
}

.app-nav-item.dropdown .app-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    transform: none !important;
    margin-top: 8px !important;
}

/* =========================================================
   NAVBAR CUSTOM DROPDOWN
   ========================================================= */

.app-main-nav .app-custom-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.app-main-nav .app-custom-dropdown-trigger {
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.app-main-nav .app-custom-dropdown-trigger::after {
    content: "";
    display: inline-block;
    margin-left: 7px;
    vertical-align: middle;
    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.app-main-nav .app-custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: 280px;
    min-width: 280px;
    padding: 6px;
    margin: 0;
    display: none;
    z-index: 2000;
    background: #fff;
    border: 1px solid #e5e8ef;
    border-radius: 9px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
}

.app-main-nav .app-custom-dropdown.open .app-custom-dropdown-menu {
    display: block;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    color: #1f2937;
    text-decoration: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item:hover {
    background: #f5f7fa;
    color: #206bc4;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item>span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.3;
    color: #6b7280;


}


/* =========================================================
   DROPDOWN FALLBACK - TANPA JAVASCRIPT
   ========================================================= */

.app-main-nav .app-custom-dropdown:focus-within .app-custom-dropdown-menu {
    display: block !important;
}

.app-user.app-custom-dropdown:focus-within .app-user-dropdown-menu {
    display: block !important;
}

.app-main-nav .app-custom-dropdown:focus-within > .app-custom-dropdown-trigger{
    color:#fff;
}

/* RESET BUTTON UNTUK NAVBAR DROPDOWN */
.app-main-nav .app-custom-dropdown-trigger{
    appearance:none;
    -webkit-appearance:none;
    border:0;
    outline:0;
    background:transparent;
    color:#fff;
    font-family:inherit;
    font-size:13px;
    font-weight:500;
    line-height:normal;
    box-shadow:none;
}

.app-main-nav .app-custom-dropdown-trigger:hover{
    color:#fff;
    background:rgba(255,255,255,.08);
}

.app-main-nav .app-custom-dropdown:focus-within > .app-custom-dropdown-trigger{
    color:#fff;
    background:rgba(255,255,255,.08);
}

.app-main-nav .app-custom-dropdown-trigger:focus{
    outline:0;
    box-shadow:none;
}

.app-main-nav .app-custom-dropdown:focus-within > .app-nav-link.active,
.app-main-nav .app-nav-link.active{
    color:#fff;
    background:#206bc4;
}

/* ==============================
   LOGIN - ANOTASI BPS DATASET
   ============================== */
.login-page {
    --login-primary: #4169f5;
    --login-purple: #a855f7;
    --login-ink: #172554;
    --login-muted: #7b849d;
    --login-border: #e5e9f4;
    margin: 0;
    min-height: 100vh;
    background: #f6f7fc;
    color: var(--login-ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
    min-height: 100vh;
}
.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    overflow: hidden;
    padding: 42px clamp(30px, 5vw, 76px) 24px;
    background:
        radial-gradient(ellipse at 15% 90%, rgba(170, 153, 255, .28), transparent 40%),
        radial-gradient(ellipse at 90% 10%, rgba(126, 166, 255, .3), transparent 38%),
        linear-gradient(145deg, #f4f1ff 0%, #edf3ff 55%, #e5edff 100%);
}
.login-visual::before,
.login-visual::after {
    position: absolute;
    content: "";
    border: 1px solid rgba(104, 119, 224, .12);
    border-radius: 50%;
    pointer-events: none;
}
.login-visual::before {
    width: 420px;
    height: 420px;
    top: 25%;
    left: -230px;
}
.login-visual::after {
    width: 330px;
    height: 330px;
    right: -180px;
    bottom: 8%;
}
.visual-content,
.visual-footer {
    position: relative;
    z-index: 1;
}
.brand-mark,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #182a64;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .5px;
    text-decoration: none;
}
.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #3679ff, #9a61ff);
    box-shadow: 0 8px 18px rgba(76, 98, 227, .2);
    font-size: 23px;
}
.brand-divider {
    color: #a2a9c2;
    font-weight: 400;
}
.visual-heading {
    max-width: 560px;
    margin-top: 60px;
}
.eyebrow {
    display: inline-block;
    color: #6676c8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}
.visual-heading h1 {
    margin: 16px 0 16px;
    color: #192b60;
    font-size: clamp(30px, 3.2vw, 47px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1.5px;
}
.visual-heading h1 span {
    color: #8664ed;
}
.visual-heading p {
    max-width: 440px;
    margin: 0;
    color: #68769b;
    font-size: 14px;
    line-height: 1.9;
}
.illustration-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    margin: 10px -15px 0;
}
.login-illustration {
    display: block;
    width: 100%;
    max-width: 490px;
    max-height: 310px;
    object-fit: contain;
    filter: drop-shadow(0 15px 20px rgba(78, 93, 174, .07));
}
.visual-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.feature-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(111, 123, 220, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .75);
    color: #6b63e9;
    font-size: 19px;
}
.feature-item strong,
.feature-item small {
    display: block;
}
.feature-item strong {
    color: #283866;
    font-size: 10px;
    font-weight: 750;
}
.feature-item small {
    margin-top: 3px;
    color: #8390b1;
    font-size: 10px;
}
.visual-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(108, 123, 192, .16);
    color: #8994b4;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(25px, 5vw, 78px);
    background: #fff;
}
.login-card {
    width: 100%;
    max-width: 400px;
}
.mobile-brand {
    display: none;
}
.login-heading {
    margin-bottom: 32px;
}
.login-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 53px;
    height: 53px;
    margin-bottom: 24px;
    border: 1px solid #e7e8ff;
    border-radius: 17px;
    background: linear-gradient(145deg, #f0f0ff, #f8f4ff);
    color: #7363e9;
    font-size: 27px;
}
.login-heading h2 {
    margin: 11px 0 9px;
    color: #172554;
    font-size: clamp(25px, 2.2vw, 31px);
    font-weight: 800;
    letter-spacing: -.8px;
}
.login-heading p {
    margin: 0;
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.8;
}
.login-page .form-label {
    margin-bottom: 9px;
    color: #344267;
    font-size: 12px;
    font-weight: 700;
}
.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.login-input-wrap > i {
    position: absolute;
    left: 15px;
    z-index: 2;
    color: #9aa5c0;
    font-size: 18px;
    pointer-events: none;
}
.login-page .login-input {
    width: 100%;
    height: 49px;
    padding: 0 44px;
    border: 1px solid var(--login-border);
    border-radius: 12px;
    background: #fafbff;
    color: #24345d;
    font-size: 13px;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-page .login-input::placeholder {
    color: #aab2c7;
}
.login-page .login-input:focus {
    border-color: #8b87fa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(112, 103, 239, .10);
}
.password-toggle {
    position: absolute;
    right: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a95af;
    font-size: 18px;
    cursor: pointer;
}
.password-toggle:hover {
    background: #f0f1ff;
    color: #6659df;
}
.login-options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 15px 0 23px;
    color: #8490aa;
    font-size: 11px;
}
.login-options i {
    margin-right: 4px;
    color: #6b73df;
    font-size: 14px;
    vertical-align: -2px;
}
.btn-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 49px;
    padding: 12px 20px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(105deg, #3678ff 0%, #7165f5 60%, #b65fe9 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 9px 20px rgba(98, 96, 236, .22);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-login i {
    font-size: 18px;
    transition: transform .2s;
}
.btn-login:hover {
    transform: translateY(-2px);
    filter: saturate(1.1);
    box-shadow: 0 13px 25px rgba(98, 96, 236, .3);
    color: #fff;
}
.btn-login:hover i {
    transform: translateX(4px);
}
.btn-login:active {
    transform: translateY(0);
}
.btn-login:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid rgba(93, 105, 242, .4);
    outline-offset: 3px;
}
.login-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 30px 0 18px;
    color: #a2abc0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
}
.login-divider::before,
.login-divider::after {
    flex: 1;
    height: 1px;
    background: #edf0f7;
    content: "";
}
.login-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid #edf0fb;
    border-radius: 13px;
    background: #f8f9ff;
}
.note-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #e9edff;
    color: #6874e6;
    font-size: 18px;
}
.login-note p {
    margin: 0;
    color: #7c88a5;
    font-size: 11px;
    line-height: 1.8;
}
.login-copyright {
    margin: 33px 0 0;
    color: #98a1b8;
    text-align: center;
    font-size: 10px;
    line-height: 1.9;
}
.login-copyright span {
    display: block;
    color: #b0b7c9;
}
.login-alert {
    margin-bottom: 22px;
    border-radius: 11px;
    font-size: 12px;
}
@media (min-width: 1500px) {
    .login-layout {
        grid-template-columns: 1.1fr .9fr;
    }
    .login-visual {
        padding-right: 85px;
        padding-left: 85px;
    }
}
@media (max-width: 1050px) {
    .login-layout {
        grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    }
    .login-visual {
        padding: 32px;
    }
    .visual-heading {
        margin-top: 45px;
    }
    .visual-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .feature-item strong {
        font-size: 11px;
    }
    .feature-item small {
        font-size: 10px;
    }
    .login-panel {
        padding: 35px;
    }
}
@media (max-width: 767px) {
    .login-layout {
        display: flex;
        min-height: 100vh;
        flex-direction: column;
    }
    .login-visual {
        display: none;
    }
    .login-panel {
        flex: 1;
        align-items: center;
        padding: 35px 24px;
        background:
            radial-gradient(ellipse at 100% 0%, rgba(173, 159, 255, .14), transparent 40%),
            #fff;
    }
    .login-card {
        max-width: 420px;
    }
    .mobile-brand {
        display: inline-flex;
        margin-bottom: 42px;
    }
    .login-heading {
        margin-bottom: 29px;
    }
    .login-symbol {
        margin-bottom: 20px;
    }
    .login-copyright {
        margin-top: 30px;
    }
}
@media (max-width: 380px) {
    .login-panel {
        padding: 25px 18px;
    }
    .mobile-brand {
        margin-bottom: 32px;
    }
    .login-heading h2 {
        font-size: 25px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .btn-login,
    .btn-login i,
    .login-page .login-input {
        transition: none;
    }
}



/* =========================================
   HEADER - SELARAS DENGAN LOGIN
   Tambahkan di akhir app.css
   ========================================= */

.app-header {
    background: linear-gradient(105deg, #202c55 0%, #353b78 58%, #514b91 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 3px 14px rgba(44, 48, 100, .10);
}

.app-brand-title {
    color: #fff;
    letter-spacing: -.3px;
}

.app-nav-link {
    color: rgba(255, 255, 255, .84);
    border-radius: 9px;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.app-nav-link i {
    color: inherit;
}

.app-nav-link:hover,
.app-main-nav .app-custom-dropdown-trigger:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.app-nav-link.active,
.app-main-nav .app-custom-dropdown-trigger.active,
.app-main-nav .app-custom-dropdown:focus-within > .app-nav-link.active {
    color: #fff;
    background: linear-gradient(105deg, #3678ff 0%, #7165f5 65%, #9562eb 100%);
    box-shadow: 0 4px 12px rgba(27, 30, 90, .18);
}

.app-main-nav .app-custom-dropdown-trigger {
    color: rgba(255, 255, 255, .84);
    border-radius: 9px;
}

.app-main-nav .app-custom-dropdown-trigger::after {
    opacity: .85;
}

.app-user-trigger {
    border-radius: 10px;
    transition: background .2s ease;
}

.app-user-trigger:hover,
.app-user.app-custom-dropdown.open > .app-user-trigger {
    background: rgba(255, 255, 255, .12);
}

.app-user-avatar {
    background: linear-gradient(135deg, #3678ff, #9562eb);
    box-shadow: 0 3px 10px rgba(20, 25, 80, .2);
}

.app-user-name {
    color: #fff;
}

.app-user-role,
.app-user-chevron {
    color: rgba(255, 255, 255, .65);
}

/* Dropdown tetap terang agar mudah dibaca */
.app-main-nav .app-custom-dropdown-menu,
.app-user-dropdown-menu {
    background: #fff;
    border: 1px solid #e8e9f5;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(39, 43, 90, .16);
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item:hover,
.app-user-dropdown-menu .dropdown-item:hover {
    background: #f3f4ff;
    color: #6258d9;
}

.app-main-nav .app-custom-dropdown-menu .dropdown-item:hover .dropdown-item-icon,
.app-user-dropdown-menu .dropdown-item:hover .dropdown-item-icon {
    background: #e9eaff;
    color: #6258d9;
}

/* Fokus keyboard */
.app-nav-link:focus-visible,
.app-user-trigger:focus-visible,
.app-main-nav .app-custom-dropdown-trigger:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .app-header {
        background: linear-gradient(105deg, #202c55 0%, #353b78 58%, #514b91 100%);
    }
}


/* Perbaikan header bertingkat DataTables */
.table-matching-page .comparison-panel .comparison-table-container {
    position: relative;
    overflow: auto;
    max-width: 100%;
}

.table-matching-page .comparison-panel .comparison-table-container .dt-scroll {
    position: relative;
    overflow: visible;
}

.table-matching-page .comparison-panel .comparison-table-container .dt-scroll-head {
    overflow: hidden;
}

.table-matching-page .comparison-panel .comparison-table-container .dt-scroll-headInner {
    box-sizing: border-box;
}

.table-matching-page .comparison-panel .comparison-table-container .dt-scroll-head table,
.table-matching-page .comparison-panel .comparison-table-container .dt-scroll-body table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.table-matching-page .comparison-panel .comparison-table thead th {
    vertical-align: middle;
    white-space: normal;
    overflow: visible;
    height: auto;
    min-height: 36px;
    line-height: 1.4;
}

.table-matching-page .comparison-panel .comparison-table thead tr {
    height: auto;
}

.table-matching-page .comparison-panel .comparison-table thead th[rowspan],
.table-matching-page .comparison-panel .comparison-table thead th[colspan] {
    vertical-align: middle;
}

/* Hindari header terpotong oleh container */
.table-matching-page .comparison-panel .comparison-table-container table {
    border-collapse: separate;
    border-spacing: 0;
}