:root {
    color-scheme: light;
    --ink: #243248;
    --muted: #7d8ba0;
    --line: #ccd7e5;
    --blue: #0699df;
    --blue-dark: #087fbd;
    --pale: #f2f5f9;
    --green: #199778;
    --shadow: 0 12px 40px rgba(37, 56, 95, .055);
}

* { box-sizing: border-box; }
html { min-width: 360px; scroll-behavior: smooth; }
body { margin: 0; background: var(--pale); color: var(--ink); font-family: Arial, 'Segoe UI', sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topbar { width: min(1680px, calc(100% - 12px)); height: 76px; margin: 3px auto 0; background: #fff; border: 1px solid #e4e9f0; border-bottom: 0; border-radius: 13px 13px 0 0; display: flex; align-items: center; padding: 0 30px; gap: 25px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #17243b; font: 800 17px Manrope, sans-serif; letter-spacing: -.6px; white-space: nowrap; }
.brand-light { font-weight: 500; color: #66748a; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #637df2, #405dd9); color: #fff; font: 800 16px Manrope, sans-serif; box-shadow: 0 4px 9px #526ee23b; }
.topnav { display: flex; flex: 1 1 auto; align-items: center; gap: 24px; height: 100%; min-width: 0; }
.topnav a { height: 100%; display: flex; align-items: center; border-bottom: 2px solid transparent; color: #7a8799; font-size: 13px; font-weight: 600; }
.topnav a.active, .topnav a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.dataset-tabs { display: flex; width: fit-content; align-items: center; gap: 3px; height: 40px; padding: 4px; border-radius: 8px; background: #f0f4f8; }
.dataset-tab { flex: 0 0 auto; height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: #697991; font-size: 14px; font-weight: 600; white-space: nowrap; }
.dataset-tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dataset-tab:hover { color: #126fa9; background: #e4edf5; }
.dataset-tab.active { color: #fff; background: var(--blue); box-shadow: 0 1px 3px #087fbd30; }
.dataset-tab .tab-count { min-width: 22px; padding: 3px 5px; border-radius: 10px; background: #ffffff2c; color: inherit; text-align: center; font: 600 10px Arial, sans-serif; }
.dataset-tab:not(.active) .tab-count { background: #e4eaf1; color: #728198; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.period-filter { display: inline-flex; align-items: center; gap: 11px; min-height: 37px; padding: 0 10px; border: 1px solid #cbd6e4; border-radius: 6px; color: #8a9ab0; font-size: 13px; white-space: nowrap; }
.period-filter select { min-width: 66px; padding: 0 16px 0 0; border: 0; outline: 0; color: #334258; background: transparent; font: 600 13px Arial, sans-serif; cursor: pointer; }
.logout-form { margin: 0; }
.admin-chip, .admin-badge { color: #536178; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.online-dot, .status-dot, .note-dot { height: 7px; width: 7px; flex: 0 0 7px; border-radius: 50%; background: #2fb58e; }

.page-shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; min-height: calc(100vh - 128px); }
.page-shell.home-shell { width: min(1680px, calc(100% - 12px)); min-height: calc(100vh - 135px); padding: 1px 30px 24px; border: 1px solid #e4e9f0; border-top: 0; background: #fff; }
.eyebrow { color: #6479d9; margin: 0 0 13px; font-size: 10px; font-weight: 700; letter-spacing: 1.65px; }
.catalog { margin: 12px 0 30px; }
.section-note { margin: 0 2px 3px; color: #8792a3; font-size: 11px; }

.data-panel { border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.search-row { min-height: 0; padding: 0; display: flex; align-items: center; gap: 20px; border: 0; }
.search-box { display: flex; align-items: center; gap: 10px; width: 100%; height: 47px; padding: 6px 9px; border: 1px solid #ccd8e7; border-radius: 5px; background: #fff; }
.search-box:focus-within { border-color: #56aee0; box-shadow: 0 0 0 2px #0699df18; }
.search-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 4px; background: var(--blue); }
.search-box svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: #fff; stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; padding: 0 2px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #9aa8bb; }
.result-summary { margin: 11px 0 12px; color: #7c899b; font-size: 13px; white-space: nowrap; }
.table-wrap { min-height: 255px; position: relative; overflow-x: auto; border-radius: 7px 7px 0 0; }
.data-table { width: 100%; min-width: 1200px; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: left; }
.data-table th { padding: 12px 13px; border-right: 1px solid #52709a; background: #082f70; color: #fff; font-size: 14px; font-weight: 700; line-height: 1.35; }
.data-table th:first-child { border-top-left-radius: 7px; }
.data-table th:last-child { border-right: 0; border-top-right-radius: 7px; }
.data-table td { padding: 11px 13px; border-right: 1px solid #cbd6e4; border-bottom: 1px solid #cbd6e4; color: #344154; font-size: 13px; line-height: 1.5; vertical-align: top; overflow-wrap: anywhere; }
.data-table td:last-child { border-right: 0; }
.data-table tbody tr:nth-child(odd) { background: #e2e8f0; }
.data-table tbody tr:nth-child(even) { background: #fff; }
.data-table tbody tr:hover { background: #d7e5f4; }
.data-table .row-number { width: 48px; text-align: center; }
.data-table .code-cell { color: #324358; font: 400 13px Arial, sans-serif; white-space: nowrap; }
.data-table .name-cell { color: #28374b; font-weight: 400; }
.data-table .definition-cell, .data-table .relation-cell { color: #344154; }
.data-table .category-list { margin: 0; padding-left: 19px; }
.data-table .category-list li { padding-left: 2px; }
.data-table .category-list li + li { margin-top: 2px; }
.data-table .reference-list { margin: 0; padding-left: 19px; }
.data-table .reference-list li { padding-left: 2px; }
.data-table .reference-list li + li { margin-top: 3px; }
.data-table .relation-list { margin: 0; padding-left: 19px; }
.data-table .relation-list li { padding-left: 2px; }
.data-table .relation-list li + li { margin-top: 2px; }
.data-table .relation-search-link { display: inline; padding: 0; border: 0; color: #126eae; background: transparent; font: inherit; text-align: left; text-decoration: underline; text-decoration-color: #9abbd3; text-underline-offset: 2px; cursor: pointer; }
.data-table .relation-search-link:hover { color: #084f83; text-decoration-color: currentColor; }
.data-table .relation-search-link:focus-visible { outline: 2px solid #0699df; outline-offset: 2px; border-radius: 2px; }
.data-table .reference-link { color: #126eae; text-decoration-color: #7caed1; }
.data-table[data-dataset="klasifikasi"] th:nth-child(1) { width: 52px; }
.data-table[data-dataset="klasifikasi"] th:nth-child(2) { width: 105px; }
.data-table[data-dataset="klasifikasi"] th:nth-child(3) { width: 100px; }
.data-table[data-dataset="klasifikasi"] th:nth-child(4) { width: 210px; }
.data-table[data-dataset="klasifikasi"] th:nth-child(5),
.data-table[data-dataset="klasifikasi"] th:nth-child(6) { width: 25%; }
.data-table[data-dataset="klasifikasi"] th:nth-child(7) { width: 170px; }
.data-table[data-dataset="klasifikasi"] th:nth-child(8) { width: 170px; }
.data-table[data-dataset="sds"] th:nth-child(1) { width: 52px; }
.data-table[data-dataset="sds"] th:nth-child(2) { width: 100px; }
.data-table[data-dataset="sds"] th:nth-child(3) { width: 100px; }
.data-table[data-dataset="sds"] th:nth-child(4) { width: 210px; }
.data-table[data-dataset="sds"] th:nth-child(5) { width: 180px; }
.data-table[data-dataset="sds"] th:nth-child(6) { width: 25%; }
.data-table[data-dataset="sds"] th:nth-child(7) { width: 180px; }
.data-table[data-dataset="sds"] th:nth-child(8), .data-table[data-dataset="sds"] th:nth-child(9) { width: 95px; }
.data-table[data-dataset="sds"] th:nth-child(10) { width: 190px; }
.data-table[data-dataset="konsep"] th:nth-child(1) { width: 52px; }
.data-table[data-dataset="konsep"] th:nth-child(2) { width: 110px; }
.data-table[data-dataset="konsep"] th:nth-child(3) { width: 110px; }
.data-table[data-dataset="konsep"] th:nth-child(4) { width: 240px; }
.data-table[data-dataset="konsep"] th:nth-child(5) { width: 45%; }
.data-table[data-dataset="konsep"] th:nth-child(6) { width: 220px; }
.data-table .reference-link { display: inline-block; max-width: 100%; color: #4b67d7; text-decoration: underline; text-decoration-color: #b7c3f1; text-underline-offset: 2px; overflow-wrap: anywhere; }
.data-table .reference-link:hover { color: #304fc4; text-decoration-color: currentColor; }
.data-table tbody tr:hover { background: #fcfdff; }
.empty-state { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; color: #8a95a5; font-size: 11px; }
.empty-state strong { color: #445169; font-size: 13px; }
.empty-icon { width: 37px; height: 37px; margin-bottom: 2px; border: 1px solid #e8ecf3; border-radius: 12px; display: grid; place-items: center; color: #8291a8; font-size: 22px; }
.loading-state { padding: 18px; color: #8190a3; text-align: center; font-size: 11px; }
.spinner { display: inline-block; width: 13px; height: 13px; margin-right: 7px; border: 2px solid #dfe5f5; border-top-color: var(--blue); border-radius: 50%; vertical-align: -3px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }
.inline-error { padding: 16px 22px; color: #bd3f4b; font-size: 11px; }
.data-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 17px 0 0; color: #929cad; font-size: 11px; }
.note-dot { width: 6px; height: 6px; flex-basis: 6px; }
.footer { min-height: 56px; padding: 0 max(calc((100vw - 1180px) / 2), 5.2vw); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ebeff5; background: #fff; color: #99a2b0; font-size: 10px; }

.button { min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 5px 12px #4667e826; }
.button-primary:hover { background: var(--blue-dark); }
.button-outline { border-color: #e2e7ef; color: #5e6b80; background: #fff; }
.button-outline:hover { border-color: #b8c5e8; color: var(--blue); }
.button-small { min-height: 32px; padding: 0 11px; font-size: 10px; }
.button-wide { width: 100%; margin-top: 6px; min-height: 43px; }
.flash { margin: 20px 0 0; padding: 12px 16px; border: 1px solid; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.flash-success { color: #176e55; background: #edfaf5; border-color: #d3f0e5; }
.flash-error { color: #a8424d; background: #fff3f3; border-color: #f4dddd; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(ellipse at 80% 10%, #e7edff 0, transparent 38%), #f5f7fb; }
.auth-shell { width: min(430px, calc(100% - 36px)); margin: auto; padding: 25px 0; }
.auth-card { padding: 37px 38px 31px; border: 1px solid #e8edf4; border-radius: 14px; background: #fff; box-shadow: 0 15px 48px #293e6811; }
.auth-brand { margin-bottom: 35px; }
.auth-card .eyebrow { font-size: 9px; margin-bottom: 9px; }
.auth-card h1 { margin: 0; font: 750 23px Manrope, sans-serif; letter-spacing: -.65px; }
.auth-copy { margin: 9px 0 23px; color: #7f8a9b; font-size: 12px; line-height: 1.65; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-stack label { display: flex; flex-direction: column; gap: 7px; color: #46536a; font-size: 11px; font-weight: 600; }
.form-stack input:not([type=file]) { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #e3e8f0; border-radius: 6px; outline: 0; color: #26344b; background: #fff; font-size: 12px; font-weight: 400; }
.form-stack input:focus { border-color: #96a8ef; box-shadow: 0 0 0 3px #4c6de912; }
.form-stack small { color: #8994a4; font-size: 10px; font-weight: 400; }
.back-link { display: block; margin-top: 22px; color: #7d899a; text-align: center; font-size: 11px; }
.back-link:hover { color: var(--blue); }

.admin-heading { margin: 39px 0 22px; display: flex; justify-content: space-between; align-items: center; }
.admin-heading .eyebrow { margin-bottom: 7px; font-size: 9px; }
.admin-heading h1 { margin: 0; font: 750 25px Manrope, sans-serif; letter-spacing: -.7px; }
.admin-heading p:not(.eyebrow) { margin: 7px 0 0; color: #828da0; font-size: 12px; }
.admin-badge { padding: 8px 11px; border: 1px solid #dfeee8; border-radius: 30px; color: #35866e; background: #f2faf6; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.stat-card { min-height: 119px; padding: 17px 19px; position: relative; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; float: right; border-radius: 8px; font: 700 12px Manrope, sans-serif; }
.stat-sds { color: #5270e5; background: #eef1ff; }
.stat-klasifikasi { color: #1d9a83; background: #e9f8f4; }
.stat-konsep { color: #bd8c29; background: #fff6e3; }
.stat-label { display: block; margin-bottom: 8px; color: #7d899b; font-size: 10px; font-weight: 600; }
.stat-card strong { display: inline-block; margin-right: 6px; font: 750 21px Manrope, sans-serif; letter-spacing: -.5px; }
.stat-foot { color: #9aa4b2; font-size: 10px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.admin-card { padding: 21px 22px 23px; }
.card-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.card-heading h2 { font-size: 14px; }
.card-heading p { margin: 5px 0 0; color: #8a95a5; font-size: 10px; line-height: 1.5; }
.card-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 8px; background: #eff2ff; color: #5770df; font-size: 16px; }
.card-icon-lock { color: #198f7b; background: #ebf8f4; }
.card-icon-db { color: #c28d2e; background: #fff7e8; }
.upload-form { gap: 12px; }
.upload-form label { gap: 7px; }
.field-hint { float: right; color: #a1aab8; font-size: 9px; font-weight: 400; }
.form-stack input[type=file] { min-width: 0; padding: 8px; border: 1px dashed #dce3ee; border-radius: 6px; color: #6d7a8e; background: #fbfcfe; font-size: 10px; font-weight: 400; }
.form-stack input[type=file]::file-selector-button { margin-right: 10px; padding: 5px 8px; border: 1px solid #e0e6f0; border-radius: 4px; color: #5c6a80; background: #fff; font-size: 9px; cursor: pointer; }
.form-note { padding: 9px 10px; border-radius: 5px; color: #7e8999; background: #f7f8fb; font-size: 9px; line-height: 1.6; }
.admin-card .button { align-self: flex-start; margin-top: 2px; }
.records-card { margin: 16px 0 42px; padding: 20px 22px 6px; }
.records-card .card-heading { margin-bottom: 11px; }
.status-row { min-height: 44px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: center; border-top: 1px solid #f0f2f6; color: #637086; font-size: 10px; }
.status-row > span { display: inline-flex; align-items: center; gap: 8px; }
.status-row strong { color: #445169; font-size: 10px; }
.status-row time { color: #929cad; text-align: right; font-size: 9px; }
.not-found { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.not-found-code { color: #dbe2f2; font: 800 68px Manrope, sans-serif; letter-spacing: -5px; }
.not-found h1 { margin: 0; font: 700 22px Manrope, sans-serif; }
.not-found p { margin: 9px 0 20px; color: #8390a3; font-size: 12px; }

@media (max-width: 760px) {
    .topbar { height: auto; min-height: 62px; flex-wrap: wrap; padding: 9px 16px; gap: 8px; }
    .brand { font-size: 15px; gap: 8px; }
    .brand-mark { width: 28px; height: 28px; }
    .topnav { order: 1; flex: 1 1 100%; height: auto; gap: 13px; }
    .topnav a { font-size: 11px; }
    .dataset-tabs { width: 100%; height: 38px; justify-content: flex-start; gap: 3px; }
    .dataset-tab { height: 30px; gap: 5px; padding: 0 9px; font-size: 11px; }
    .dataset-tab .tab-count { min-width: 21px; padding: 3px 5px; }
    .top-actions { order: 2; width: 100%; margin-left: 0; justify-content: flex-end; gap: 8px; }
    .period-filter { min-height: 31px; margin-right: auto; font-size: 11px; }
    .period-filter select { font-size: 11px; }
    .admin-chip { display: none; }
    .page-shell { width: calc(100% - 32px); }
    .page-shell.home-shell { width: calc(100% - 12px); padding: 0 13px 20px; }
    .catalog { margin-top: 20px; }
    .search-row { padding: 0; gap: 8px; flex-wrap: wrap; }
    .search-box { width: 100%; }
    .result-summary { margin: 9px 0; white-space: normal; }
    .footer { padding: 0 18px; }
    .admin-heading { margin-top: 27px; }
    .admin-heading h1 { font-size: 21px; }
    .admin-badge { font-size: 9px; padding: 7px 8px; }
    .stats-grid { gap: 8px; }
    .stat-card { min-height: 108px; padding: 13px 11px; }
    .stat-label { font-size: 9px; }
    .stat-card strong { font-size: 18px; }
    .stat-foot { font-size: 9px; }
    .stat-icon { width: 24px; height: 24px; }
    .admin-grid { grid-template-columns: 1fr; }
    .status-row { grid-template-columns: 1fr auto; }
    .status-row time { grid-column: 2; grid-row: 1; }
    .status-row strong { grid-column: 1; grid-row: 2; padding: 0 0 8px 15px; color: #8792a3; font-weight: 500; }
}

@media (max-width: 430px) {
    .topbar { padding: 8px 10px; gap: 7px; }
    .brand { font-size: 13px; }
    .topnav { gap: 9px; }
    .topnav a { font-size: 10px; }
    .dataset-tabs { gap: 2px; }
    .dataset-tab { gap: 4px; padding: 0 7px; font-size: 10px; }
    .dataset-tab svg { width: 14px; height: 14px; }
    .dataset-tab .tab-count { min-width: 18px; padding: 2px 4px; font-size: 9px; }
    .button-small { min-height: 29px; padding: 0 8px; }
    .page-shell { width: calc(100% - 24px); }
    .auth-card { padding: 30px 24px 27px; }
}
