:root {
  --navy: #173b57;
  --navy-dark: #102a3d;
  --blue: #2b6e9d;
  --blue-soft: #eaf3f9;
  --teal: #1f8a70;
  --bg: #f4f7fa;
  --panel: #ffffff;
  --text: #17212b;
  --muted: #667784;
  --line: #dce5ec;
  --danger: #b83232;
  --shadow: 0 12px 30px rgba(21, 52, 75, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 24px 18px;
  color: #fff;
  background: linear-gradient(180deg, var(--navy-dark), var(--navy));
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 8px 0 30px rgba(16, 42, 61, 0.12);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; letter-spacing: -.5px; background: #fff; color: var(--navy);
}
.brand strong, .brand span { display: block; }
.brand span { margin-top: 2px; font-size: 12px; color: rgba(255,255,255,.65); }
.nav-list { display: grid; gap: 8px; margin-top: 24px; }
.nav-item {
  width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; color: rgba(255,255,255,.78);
  background: transparent; text-align: left; display: flex; gap: 11px; align-items: center; transition: .2s ease;
}
.nav-icon { width: 20px; flex: 0 0 20px; text-align: center; font-size: 18px; }
.nav-label { flex: 1; min-width: 0; }
.nav-arrow { width: auto; margin-left: auto; font-size: 22px; line-height: 1; transition: transform .18s ease; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.12); transform: translateX(2px); }

.nav-group { position: relative; }
.nav-group.open .nav-arrow { transform: rotate(90deg); }
.nav-submenu {
  position: absolute; left: calc(100% + 8px); top: 0; z-index: 70; width: 220px; padding: 8px;
  display: none; gap: 5px; border: 1px solid rgba(220,229,236,.9); border-radius: 12px;
  background: #fff; box-shadow: 0 16px 38px rgba(16,42,61,.2);
}
.nav-submenu::before { content: ""; position: absolute; left: -10px; top: 0; width: 12px; height: 100%; }
.nav-group:hover .nav-submenu, .nav-group.open .nav-submenu { display: grid; }
.nav-subitem {
  width: 100%; border: 0; border-radius: 8px; padding: 11px 12px; text-align: left;
  display: flex; align-items: center; gap: 10px; background: transparent; color: #29465b; font-weight: 650;
}
.nav-subitem > span { width: 19px; text-align: center; color: var(--blue); }
.nav-subitem:hover, .nav-subitem.active { background: var(--blue-soft); color: var(--navy); }
.sidebar-note {
  margin-top: auto; padding: 16px; border-radius: 12px; background: rgba(255,255,255,.08);
  display: grid; gap: 6px; font-size: 12px; color: rgba(255,255,255,.7); line-height: 1.5;
}
.sidebar-note strong { color: #fff; font-size: 13px; }

.main-content { width: calc(100% - 260px); margin-left: 260px; padding: 28px 32px 46px; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: clamp(24px, 2vw, 32px); letter-spacing: -.7px; }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.menu-toggle { display: none; border: 0; background: #fff; border-radius: 9px; padding: 9px 12px; box-shadow: var(--shadow); }
.status-pill {
  margin-left: auto; white-space: nowrap; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); background: #fff; font-size: 13px;
}
.status-pill span { width: 8px; height: 8px; border-radius: 50%; background: #d59f32; }
.status-pill.ok span { background: #24a148; }
.status-pill.error span { background: #d64545; }

.page { display: none; }
.page.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.summary-card {
  position: relative; overflow: hidden; padding: 20px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.summary-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -35px; bottom: -42px; border-radius: 50%; background: var(--blue-soft); }
.summary-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.summary-card strong { display: block; font-size: 26px; letter-spacing: -.5px; position: relative; z-index: 1; }
.summary-card small { color: var(--muted); position: relative; z-index: 1; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel-heading { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { padding-bottom: 15px; }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-heading .pivot-jenis { margin-top: 2px; font-weight: 600; color: var(--text); }

.button-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-weight: 650; font-size: 13px; transition: .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(43,110,157,.2); }
.btn-secondary { background: var(--blue-soft); color: var(--blue); border-color: #c9deec; }
.btn-ghost { background: #fff; color: #4b5b67; border-color: var(--line); }
.btn-danger { background: #fff1f1; color: var(--danger); border-color: #f1caca; }
.btn-large { min-width: 180px; padding: 12px 18px; font-size: 14px; }

.filter-grid { padding: 18px 22px 22px; display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 12px; }
.filter-grid label { display: grid; gap: 6px; color: #43515c; font-size: 12px; font-weight: 700; }
.filter-grid select, .filter-grid input {
  width: 100%; min-height: 40px; border: 1px solid #cfdbe4; border-radius: 8px; padding: 8px 10px; color: var(--text); background: #fff; outline: none;
}
.filter-grid select:focus, .filter-grid input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,110,157,.11); }
.search-field { grid-column: span 2; }

.month-range-field { grid-column: span 2; display: grid; gap: 6px; min-width: 0; }
.filter-field-title { color: #43515c; font-size: 12px; font-weight: 700; }
.month-range-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.month-range-controls select { min-width: 0; }
.month-range-separator { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; text-align: center; }
.btn-history-delete { padding: 6px 9px; white-space: nowrap; }


.table-toolbar { padding: 10px 18px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.legend { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 5px; }
.dot.level-0 { background: var(--navy); }.dot.level-1 { background: var(--blue); }.dot.level-2 { background: #78a6c4; }
.table-wrap { width: 100%; overflow: auto; position: relative; }
.pivot-table, .dataset-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; font-size: 13px; }
.pivot-table th, .pivot-table td, .dataset-table th, .dataset-table td { padding: 9px 12px; border-right: 1px solid #e3eaf0; border-bottom: 1px solid #e3eaf0; }
.pivot-table th, .dataset-table th { position: sticky; top: 0; z-index: 5; color: #fff; background: var(--navy); text-align: right; white-space: nowrap; }
.pivot-table th:first-child, .dataset-table th:first-child { text-align: left; left: 0; z-index: 7; }
.pivot-table td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pivot-table td:first-child { position: sticky; left: 0; z-index: 2; text-align: left; min-width: 360px; max-width: 560px; white-space: normal; background: #fff; }
.pivot-table tr:hover td { background: #f7fafc; }
.pivot-table tr.level-0 td { font-weight: 800; background: #eaf3f9; }
.pivot-table tr.level-0:hover td { background: #dcecf6; }
.pivot-table tr.level-1.field-r4 td:first-child { font-weight: 700; }
.pivot-table tr.level-1:not(.field-r4) td:first-child { font-weight: 400; }
.pivot-table tfoot td { position: sticky; bottom: 0; z-index: 4; font-weight: 800; color: #fff; background: var(--navy); }
.pivot-table tfoot td:first-child { z-index: 6; }
.tree-label { display: flex; align-items: flex-start; gap: 5px; }
.tree-toggle { flex: 0 0 20px; width: 20px; height: 20px; border: 0; border-radius: 5px; background: rgba(43,110,157,.1); color: var(--blue); padding: 0; line-height: 20px; font-weight: 900; }
.tree-toggle.placeholder { visibility: hidden; }
.pivot-panel.tree-toggles-hidden .tree-toggle { display: none; }
.pivot-panel.tree-toggles-hidden .tree-label { gap: 0; }
.tree-text { line-height: 1.45; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 28px; }
.empty-state h3 { margin: 0; color: var(--text); }.empty-state p { margin-bottom: 0; }
.loading-row td { text-align: center !important; padding: 40px !important; color: var(--muted); }

.upload-panel { max-width: 1050px; }
#uploadForm { padding: 22px; }
.drop-zone { border: 2px dashed #b9cad6; border-radius: 14px; padding: 40px 20px; text-align: center; background: #f8fbfd; transition: .2s ease; }
.drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.drop-zone h3 { margin: 8px 0 4px; }.drop-zone p { margin: 0 0 18px; color: var(--muted); }
.drop-icon { margin: 0 auto; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--blue); font-size: 30px; }
#selectedFile { display: block; margin-top: 13px; color: var(--muted); font-size: 13px; }
.upload-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.radio-card { display: flex; align-items: flex-start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--blue); }
.radio-card strong, .radio-card small { display: block; }.radio-card small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.required-columns { margin-top: 18px; padding: 18px; border-radius: 12px; background: #f8fafb; border: 1px solid var(--line); }
.required-columns h3 { margin: 0 0 12px; font-size: 15px; }.required-columns p { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; }.chip-list span { padding: 6px 9px; border-radius: 999px; background: #fff; border: 1px solid #d6e1e8; color: #40515d; font-size: 12px; }
.upload-actions { margin-top: 18px; text-align: right; }
.progress-box { margin-top: 18px; display: flex; gap: 13px; align-items: center; padding: 14px; border-radius: 10px; background: #fff8e8; border: 1px solid #f0dba3; }
.progress-box[hidden] { display: none; }.progress-box p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.spinner { width: 26px; height: 26px; border: 3px solid #eadfbf; border-top-color: #c68f16; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dataset-wrap { min-height: 240px; }
.dataset-table th { text-align: left; }.dataset-table td { background: #fff; vertical-align: middle; }
.dataset-table tbody tr:hover td { background: #f8fbfd; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.badge.ready { color: #146c43; background: #e4f7ed; }.badge.failed { color: #a72b2b; background: #ffe8e8; }.badge.importing { color: #7a5a11; background: #fff4d7; }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }.switch span { position: absolute; inset: 0; border-radius: 999px; background: #c8d2d9; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 5px rgba(0,0,0,.18); }
.switch input:checked + span { background: var(--teal); }.switch input:checked + span::before { transform: translateX(18px); }
.table-actions { display: flex; gap: 6px; }
.table-actions .btn { padding: 6px 9px; }

.toast-container { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; }
.toast { width: min(380px, calc(100vw - 36px)); padding: 14px 16px; border-radius: 11px; color: #fff; box-shadow: 0 16px 40px rgba(0,0,0,.18); animation: toastIn .22s ease; }
.toast.success { background: #177c55; }.toast.error { background: #a93434; }.toast.info { background: var(--navy); }
.toast strong { display: block; margin-bottom: 3px; }.toast span { font-size: 13px; opacity: .9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 1; }
  .month-range-field { grid-column: span 2; }
  .panel-heading { align-items: flex-start; }
}
@media (max-width: 850px) {
  .sidebar { transform: translateX(-105%); transition: .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .nav-submenu { position: static; width: auto; margin: 6px 0 0 14px; padding: 6px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); box-shadow: none; }
  .nav-submenu::before { display: none; }
  .nav-group:hover .nav-submenu { display: none; }
  .nav-group.open .nav-submenu { display: grid; }
  .nav-subitem { color: rgba(255,255,255,.82); }
  .nav-subitem > span { color: rgba(255,255,255,.68); }
  .nav-subitem:hover, .nav-subitem.active { color: #fff; background: rgba(255,255,255,.12); }
  .main-content { width: 100%; margin-left: 0; padding: 20px 16px 36px; }
  .menu-toggle { display: inline-block; }
  .status-pill { display: none; }
  .topbar h1 { font-size: 24px; }
  .panel-heading { flex-direction: column; }
  .button-row { justify-content: flex-start; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-options { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .search-field { grid-column: span 1; }
  .month-range-field { grid-column: span 1; }
  .topbar p { font-size: 13px; }
  .panel-heading, #uploadForm { padding: 16px; }
  .pivot-table td:first-child { min-width: 270px; }
  .button-row .btn { width: 100%; }
}

/* Revisi tampilan tabelaris */
.summary-card strong {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.15;
  overflow: visible;
}

.pivot-panel .table-toolbar {
  justify-content: flex-end;
}

.pivot-panel .table-wrap {
  overflow-x: hidden;
  overflow-y: visible;
}

.pivot-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: var(--pivot-font-size, 13px);
}

.pivot-table th,
.pivot-table td {
  padding: 8px 6px;
  overflow: hidden;
  text-overflow: clip;
}

.pivot-table th {
  white-space: normal;
  line-height: 1.25;
}

.pivot-table td:not(:first-child) {
  white-space: nowrap;
  font-size: .96em;
}

.pivot-table th:first-child,
.pivot-table td:first-child {
  width: auto;
  min-width: 0;
  max-width: none;
}

.pivot-table.many-columns {
  font-size: var(--pivot-font-size, 13px);
}

.pivot-table.many-columns th,
.pivot-table.many-columns td {
  padding-left: 3px;
  padding-right: 3px;
}

.pivot-panel:fullscreen,
.pivot-panel.is-fullscreen,
.pivot-panel.fullscreen-fallback {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.pivot-panel.fullscreen-fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.pivot-panel:fullscreen .panel-heading,
.pivot-panel.is-fullscreen .panel-heading,
.pivot-panel.fullscreen-fallback .panel-heading {
  flex: 0 0 auto;
  padding: 14px 18px;
}

.pivot-panel:fullscreen .table-toolbar,
.pivot-panel.is-fullscreen .table-toolbar,
.pivot-panel.fullscreen-fallback .table-toolbar {
  flex: 0 0 auto;
}

.pivot-panel:fullscreen .table-wrap,
.pivot-panel.is-fullscreen .table-wrap,
.pivot-panel.fullscreen-fallback .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.pivot-panel:fullscreen .pivot-table,
.pivot-panel.is-fullscreen .pivot-table,
.pivot-panel.fullscreen-fallback .pivot-table {
  font-size: var(--pivot-font-size, 13px);
}

body.fullscreen-lock {
  overflow: hidden;
}

#fullscreenPivot {
  min-width: 112px;
}

@media (max-width: 850px) {
  .pivot-panel .table-wrap {
    overflow-x: auto;
  }
  .pivot-table {
    min-width: 720px;
  }
}


/* Kontrol ukuran tabel dan ekspor PNG */
.pivot-panel {
  --pivot-font-size: 13px;
}

.font-size-control {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #4b5b67;
  white-space: nowrap;
}


.font-step {
  width: 30px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d4e0e8;
  border-radius: 7px;
  background: #f7fafc;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.font-step:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: #b9d3e3;
}

.font-step:disabled {
  cursor: not-allowed;
  opacity: .38;
}


#downloadPng[disabled] {
  cursor: wait;
  opacity: .65;
}

@media (max-width: 560px) {
  .font-size-control {
    width: 100%;
    justify-content: center;
  }
}

/* Pengaturan susunan uraian */
.hierarchy-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.hierarchy-preset-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #40515d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.hierarchy-preset-label select {
  min-width: 245px;
  height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid #cfdce5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.hierarchy-levels {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.hierarchy-levels label {
  cursor: pointer;
}

.hierarchy-levels input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hierarchy-levels span {
  min-width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #5b6c78;
  font-size: 12px;
  font-weight: 800;
  transition: .15s ease;
}

.hierarchy-levels input:checked + span {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 6px rgba(43, 110, 157, .22);
}

.hierarchy-levels label:hover span {
  background: var(--blue-soft);
  color: var(--navy);
}

.hierarchy-levels input:checked + span:hover {
  color: #fff;
  background: var(--blue);
}

.dedupe-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #40515d;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.dedupe-control input {
  accent-color: var(--blue);
}

.hierarchy-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pivot-panel:fullscreen .hierarchy-toolbar,
.pivot-panel.is-fullscreen .hierarchy-toolbar,
.pivot-panel.fullscreen-fallback .hierarchy-toolbar {
  flex: 0 0 auto;
}

@media (max-width: 1050px) {
  .hierarchy-status {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 650px) {
  .hierarchy-toolbar {
    align-items: stretch;
    padding: 10px 14px;
  }
  .hierarchy-preset-label {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }
  .hierarchy-preset-label select {
    width: 100%;
    min-width: 0;
  }
  .hierarchy-levels {
    width: 100%;
  }
  .hierarchy-levels label {
    flex: 1 1 0;
  }
  .hierarchy-levels span {
    width: 100%;
  }
  .dedupe-control {
    width: 100%;
  }
}


/* Update Raw Data */
.raw-update-panel { max-width: 1180px; }
#rawUploadForm { padding: 22px; }
#selectedRawFile { display: block; margin-top: 13px; color: var(--muted); font-size: 13px; }
.raw-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; background: #f2f7fa; border: 1px solid var(--line); color: #40515d; font-size: 12px; font-weight: 700; }
.raw-flow b { color: var(--blue); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-card { padding: 12px; border-radius: 10px; border: 1px solid #dce5ec; background: #fff; }
.sheet-card strong, .sheet-card small { display: block; }
.sheet-card strong { color: var(--navy); font-size: 13px; }
.sheet-card small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.raw-notice { display: grid; gap: 4px; margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: #edf8f4; border: 1px solid #bfe4d5; }
.raw-notice strong { color: #146c43; }
.raw-notice span { color: #49645a; font-size: 13px; line-height: 1.45; }
.raw-result { display: grid; gap: 10px; margin-top: 18px; padding: 15px 16px; border-radius: 10px; border: 1px solid var(--line); }
.raw-result[hidden] { display: none; }
.raw-result.success { background: #edf8f4; border-color: #bfe4d5; }
.raw-result.warning { background: #fff8e8; border-color: #f0dba3; }
.raw-result.error { background: #fff0f0; border-color: #efc2c2; }
.raw-result small { line-height: 1.5; color: var(--muted); }
.raw-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.raw-result-grid span { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.72); font-size: 12px; }
.raw-history-panel { margin-top: 18px; }
.raw-history-table { min-width: 1320px; }
.raw-history-table th, .raw-history-table td { white-space: nowrap; font-size: 12px; }
.raw-history-table td:first-child { white-space: normal; min-width: 220px; }
.raw-unmatched { display: inline-flex; min-width: 32px; justify-content: center; padding: 4px 7px; border-radius: 999px; background: #fff0d0; color: #805c0b; font-weight: 800; }
.raw-matched { display: inline-flex; min-width: 32px; justify-content: center; padding: 4px 7px; border-radius: 999px; background: #e4f7ed; color: #146c43; font-weight: 800; }
.raw-error-text { color: #a93434; font-size: 11px; margin-top: 4px; white-space: normal; }
@media (max-width: 900px) {
  .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .raw-result-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  #rawUploadForm { padding: 16px; }
  .sheet-grid, .raw-result-grid { grid-template-columns: 1fr; }
  .raw-flow b { display: none; }
}

/* Lihat Database */
.database-panel { overflow: hidden; }
.database-heading { align-items: flex-start; }
.database-context { margin: 0 18px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7fafc; color: #53636f; font-size: 12px; }
.database-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 14px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.database-tab { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: #44545f; font-weight: 700; cursor: pointer; }
.database-tab b { min-width: 26px; border-radius: 999px; padding: 3px 7px; background: #edf3f7; color: var(--navy); font-size: 11px; text-align: center; }
.database-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.database-tab.active b { background: rgba(255,255,255,.18); color: #fff; }
.database-toolbar { padding: 13px 18px; display: flex; justify-content: space-between; gap: 14px; align-items: end; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.database-title-wrap { display: grid; gap: 3px; }
.database-title-wrap strong { color: var(--navy); font-size: 15px; }
.database-title-wrap span { color: var(--muted); font-size: 12px; }
.database-tools { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; justify-content: flex-end; }
.database-search { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.database-search input { min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff; }
.database-notice { margin: 12px 18px; padding: 10px 12px; border-radius: 9px; background: #fff8e8; border: 1px solid #f0dba3; color: #6b592d; font-size: 12px; line-height: 1.45; }
.database-table-wrap { max-height: calc(100vh - 360px); min-height: 320px; }
.database-table { min-width: 1200px; font-size: 12px; }
.database-table th, .database-table td { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.database-table th:first-child, .database-table td:first-child { position: sticky; left: 0; z-index: 4; min-width: 64px; width: 64px; background: #fff; text-align: center; }
.database-table th:first-child { background: var(--navy); z-index: 8; }
.database-table th:last-child, .database-table td:last-child { position: sticky; right: 0; z-index: 4; min-width: 135px; background: #fff; }
.database-table th:last-child { background: var(--navy); z-index: 8; }
.db-row-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.db-actions { flex-wrap: nowrap; }
.db-null { color: #a6b0b8; }
.database-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fbfcfd; }
.database-pagination span { color: #52626d; font-size: 12px; font-weight: 700; min-width: 120px; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(13,31,44,.62); display: grid; place-items: center; padding: 24px; }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(960px, 96vw); max-height: 92vh; overflow: auto; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(7,24,35,.32); }
.modal-header { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; gap: 18px; padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0 0 4px; font-size: 18px; color: var(--navy); }
.modal-header p { margin: 0; color: var(--muted); font-size: 12px; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 22px; cursor: pointer; color: #53636f; }
.database-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 20px; }
.database-form-grid label { display: grid; gap: 5px; color: #465762; font-size: 12px; font-weight: 700; }
.database-form-grid input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; font: inherit; color: #263843; background: #fff; }
.database-form-grid input:focus, .database-search input:focus { outline: 2px solid rgba(43,110,157,.16); border-color: var(--blue); }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: #fff; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .database-toolbar { align-items: stretch; flex-direction: column; }
  .database-tools { justify-content: stretch; }
  .database-tools .btn, .database-search, .database-search input { width: 100%; min-width: 0; }
  .database-form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
}

/* v1.7: pilihan satuan dan desimal tabelaris */
.display-setting-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #40515d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.display-setting-control select {
  height: 28px;
  min-width: 105px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 25px 0 8px;
  background: #fff;
  color: var(--navy);
  font: inherit;
  outline: none;
}

/* v1.7: seleksi massal database */
.database-selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 12px;
}
.database-selection-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.database-table th:first-child,
.database-table td:first-child {
  min-width: 98px;
  width: 98px;
}
.db-select-head label,
.db-select-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.db-select-head input,
.db-select-cell input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

/* v1.7: impor Excel per sheet */
.database-import-modal-card { width: min(760px, 96vw); }
.database-import-body { display: grid; gap: 16px; padding: 20px; }
.database-import-file { display: grid; gap: 8px; color: #465762; font-size: 12px; font-weight: 700; }
.database-import-file input {
  width: 100%;
  border: 1px dashed #b9cbd7;
  border-radius: 10px;
  padding: 13px;
  background: #f8fbfd;
}
.database-import-file span { color: var(--muted); font-weight: 500; }
.database-import-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.database-import-note {
  padding: 11px 12px;
  border: 1px solid #f0dba3;
  border-radius: 9px;
  background: #fff8e8;
  color: #6b592d;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .display-setting-control { width: 100%; justify-content: space-between; }
  .display-setting-control select { flex: 1; }
  .database-selection-toolbar { align-items: stretch; flex-direction: column; }
  .database-import-modes { grid-template-columns: 1fr; }
}

/* v1.13 - multi tahun dan perbandingan 2 tahun */
.year-multi-field {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.year-multi-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfdbe4;
  border-radius: 8px;
  padding: 8px 34px 8px 10px;
  color: var(--text);
  background: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.year-multi-button::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--muted);
  font-size: 16px;
}
.year-multi-field.open .year-multi-button {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,110,157,.11);
}
.year-multi-menu {
  display: none;
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  max-height: 280px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(16,42,61,.16);
}
.year-multi-field.open .year-multi-menu { display: grid; gap: 2px; }
.year-multi-actions { padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.year-multi-clear {
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 8px 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}
.year-multi-option {
  display: grid !important;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px !important;
  padding: 8px 7px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 650 !important;
  color: var(--text) !important;
}
.year-multi-option:hover { background: #f5f9fc; }
.year-multi-option input {
  width: 16px !important;
  min-height: 16px !important;
  height: 16px;
  margin: 0;
  padding: 0 !important;
  box-shadow: none !important;
}
.year-multi-option small { color: var(--blue); font-size: 10px; font-weight: 700; white-space: nowrap; }

.pivot-table .comparison-percent { font-weight: 750; }
.pivot-table .comparison-percent.up { color: #147a45; }
.pivot-table .comparison-percent.down { color: #c33737; }
.pivot-table .comparison-percent.flat { color: var(--muted); }
.pivot-table .comparison-trend-cell { text-align: center !important; }
.trend-indicator {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  vertical-align: middle;
}
.trend-indicator.up { background: #e9f7ef; box-shadow: inset 0 0 0 1px #c6ead5; }
.trend-indicator.down { background: #fff0f0; box-shadow: inset 0 0 0 1px #f1cece; }
.trend-indicator.flat { background: #eef2f5; box-shadow: inset 0 0 0 1px #dce4e9; }
.trend-arrow { width: 0; height: 0; display: block; }
.trend-indicator.up .trend-arrow {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 11px solid #1c9b57;
  transform: translateY(-1px);
}
.trend-indicator.down .trend-arrow {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid #d64545;
  transform: translateY(1px);
}
.trend-indicator.flat .trend-arrow {
  width: 13px;
  height: 3px;
  border-radius: 999px;
  background: #7c8b96;
}
.pivot-table.comparison-mode th:last-child,
.pivot-table.comparison-mode td:last-child { text-align: center; }

@media (max-width: 850px) {
  .year-multi-menu { position: fixed; left: 16px; right: 16px; top: auto; max-height: 45vh; }
}


/* v1.14 - dropdown tahun scroll + penyederhanaan label database */
.filter-panel {
  overflow: visible;
  position: relative;
  z-index: 30;
}
.filter-panel .filter-grid {
  position: relative;
  z-index: 31;
}
.year-multi-field {
  z-index: 40;
}
.year-multi-field.open {
  z-index: 120;
}
.year-multi-menu {
  z-index: 999;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9eb8ca #eef4f8;
}
.year-multi-menu::-webkit-scrollbar { width: 9px; }
.year-multi-menu::-webkit-scrollbar-track { background: #eef4f8; border-radius: 999px; }
.year-multi-menu::-webkit-scrollbar-thumb { background: #9eb8ca; border-radius: 999px; border: 2px solid #eef4f8; }
.year-multi-menu::-webkit-scrollbar-thumb:hover { background: #769bb4; }
.database-search {
  display: flex;
  align-items: center;
}
.database-search input {
  min-height: 40px;
}
@media (max-width: 850px) {
  .year-multi-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    max-height: min(300px, 45vh);
  }
}

/* v1.15 - Grafik dashboard */
.chart-panel { overflow: hidden; }
.chart-heading { align-items: center; }
.chart-toolbar {
  padding: 14px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.chart-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: #43515c;
  font-size: 12px;
  font-weight: 700;
}
.chart-toolbar select {
  min-height: 38px;
  border: 1px solid #cfdbe4;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.chart-toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,110,157,.11); }
.chart-legend { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 38px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 7px; color: #43515c; font-size: 12px; font-weight: 700; }
.chart-legend-swatch { width: 22px; height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 430px;
  padding: 16px 18px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 18px; width: 100%; }
.chart-card { min-width: 0; overflow-x: auto; border: 1px solid #dce6ed; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(16,42,61,.05); }
.dashboard-chart-canvas { display: block; height: 390px; min-width: 100%; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  background: rgba(255,255,255,.92);
}
.chart-empty[hidden] { display: none; }
.chart-close-fullscreen { display: none; }
.chart-panel.chart-fullscreen {
  position: fixed;
  inset: 12px;
  z-index: 5000;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: 0 22px 70px rgba(16,42,61,.35);
}
.chart-panel.chart-fullscreen .chart-close-fullscreen { display: inline-flex; }
.chart-panel.chart-fullscreen #fullscreenChart { display: none; }
.chart-panel.chart-fullscreen .chart-canvas-wrap { flex: 1 1 auto; min-height: 0; }
.chart-panel.chart-fullscreen .chart-canvas-wrap { overflow-y: auto; }
.chart-panel.chart-fullscreen .dashboard-chart-canvas { min-height: 390px; }
body.chart-fullscreen-lock { overflow: hidden; }
body.chart-fullscreen-lock::before { content: ""; position: fixed; inset: 0; z-index: 4990; background: rgba(9,27,40,.62); backdrop-filter: blur(2px); }

@media (max-width: 850px) {
  .chart-toolbar { align-items: stretch; }
  .chart-toolbar label { flex: 1 1 140px; }
  .chart-legend { flex: 1 0 100%; margin-left: 0; }
  .chart-canvas-wrap { min-height: 380px; padding-left: 10px; padding-right: 10px; }
  .dashboard-chart-canvas { height: 340px; }
  .chart-panel.chart-fullscreen { inset: 6px; }
  .chart-panel.chart-fullscreen .dashboard-chart-canvas { min-height: 340px; }
}

/* v1.16 - kontrol persentase grafik */
.chart-toolbar .chart-percentage-control { min-width: 205px; }
.chart-toolbar .chart-percentage-control select { min-width: 205px; }

/* v1.17 - mode data grafik dinamis */
.chart-toolbar label:first-child { min-width: 190px; }
.chart-toolbar label:first-child select { min-width: 190px; }
.chart-panel.chart-fullscreen .chart-grid { padding-bottom: 12px; }

/* v1.18 — Login, role, user, pengaturan, backup, dan log */
[hidden] { display: none !important; }
.privileged-only.role-hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 15%, rgba(43,110,157,.15), transparent 34%),
    radial-gradient(circle at 88% 85%, rgba(31,138,112,.12), transparent 32%),
    linear-gradient(135deg, #eef5fa 0%, #f9fbfd 52%, #eef6f3 100%);
}
.login-layout { width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 430px); gap: 28px; align-items: stretch; }
.login-layout.no-prelogin { grid-template-columns: minmax(340px, 430px); justify-content: center; }
.prelogin-panel, .login-card {
  border: 1px solid rgba(207,219,228,.95); border-radius: 22px; background: rgba(255,255,255,.96);
  box-shadow: 0 24px 70px rgba(16,42,61,.13); overflow: hidden;
}
.prelogin-panel { min-height: 520px; padding: 34px; display: flex; align-items: stretch; }
.prelogin-text-view { width: 100%; display: flex; flex-direction: column; justify-content: center; }
.prelogin-brand { display: inline-flex; align-self: flex-start; padding: 8px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--navy); font-weight: 800; margin-bottom: 22px; }
.prelogin-text { white-space: pre-wrap; font-size: clamp(20px, 2.1vw, 34px); line-height: 1.45; color: var(--navy); font-weight: 720; letter-spacing: -.4px; }
.prelogin-chart-view { width: 100%; display: grid; grid-template-rows: auto minmax(360px, 1fr) auto; gap: 14px; }
.prelogin-chart-heading h2 { margin: 0; font-size: 24px; }.prelogin-chart-heading p { margin: 5px 0 0; color: var(--muted); }
#preloginChartCanvas { width: 100%; height: 100%; min-height: 360px; display: block; }
.prelogin-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; color: #43515c; font-size: 12px; }
.prelogin-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }.prelogin-chart-legend i { width: 20px; height: 5px; border-radius: 999px; display: inline-block; }
.login-card { padding: 38px; align-self: center; }
.login-brand-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 16px; background: var(--navy); color: #fff; font-weight: 900; font-size: 20px; }
.login-card h1 { margin: 0; font-size: 27px; letter-spacing: -.6px; }.login-card > p { margin: 8px 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 15px; }.login-card label, .settings-form label, .backup-card label, #resetPasswordForm label { display: grid; gap: 7px; font-size: 12px; font-weight: 750; color: #43515c; }
.login-card input, .settings-form input, .settings-form select, .settings-form textarea, .backup-card input, .backup-card select, #userForm input, #userForm select, #resetPasswordForm input {
  width: 100%; min-height: 42px; border: 1px solid #cfdbe4; border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--text); outline: none;
}
.settings-form textarea { resize: vertical; min-height: 140px; }
.login-card input:focus, .settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus, .backup-card input:focus, .backup-card select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,110,157,.11); }
.captcha-box { min-height: 58px; border: 1px solid #d7e2ea; border-radius: 11px; padding: 10px 12px; background: #f7fafc; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.captcha-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }.captcha-box strong { font-size: 18px; letter-spacing: .4px; }
.captcha-refresh { width: 38px; height: 38px; border: 1px solid #cbd9e3; border-radius: 9px; background: #fff; color: var(--blue); font-weight: 900; font-size: 18px; }
.login-message { padding: 10px 12px; border-radius: 9px; background: #fff0f0; border: 1px solid #f0c7c7; color: #9d2e2e; font-size: 12px; line-height: 1.45; }
.login-button { min-height: 45px; margin-top: 2px; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.topbar-actions .status-pill { margin-left: 0; }
.user-pill { display: grid; gap: 1px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; line-height: 1.2; }
.user-pill strong { font-size: 12px; }.user-pill span { color: var(--muted); font-size: 10px; }
.logout-button { white-space: nowrap; }

.settings-panel { max-width: 1100px; }.narrow-panel { max-width: 720px; }
.settings-form { padding: 22px; display: grid; gap: 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }.settings-grid-chart { grid-template-columns: repeat(3, minmax(0,1fr)); }
.settings-note, .password-policy { padding: 11px 13px; border-radius: 9px; background: #f7fafc; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.backup-actions-grid { padding: 22px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.backup-card { border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: #fbfdfe; display: grid; gap: 12px; align-content: start; }
.backup-card h3 { margin: 0; font-size: 15px; }.backup-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.backup-list-wrap { border-top: 1px solid var(--line); }
.log-toolbar { justify-content: flex-end; }.log-toolbar input { width: min(420px,100%); min-height: 40px; border: 1px solid #cfdbe4; border-radius: 8px; padding: 8px 10px; }
.log-table td:last-child { max-width: 520px; white-space: normal; word-break: break-word; font-size: 11px; color: var(--muted); }

@media (max-width: 980px) {
  .login-layout { grid-template-columns: 1fr; max-width: 720px; }.prelogin-panel { min-height: 420px; }.login-card { width: 100%; }
  .settings-grid-chart { grid-template-columns: repeat(2, minmax(0,1fr)); }.backup-actions-grid { grid-template-columns: 1fr; }
  .topbar-actions .status-pill { display: none; }
}
@media (max-width: 680px) {
  .login-screen { padding: 16px; }.login-card, .prelogin-panel { padding: 24px; border-radius: 16px; }
  .settings-grid, .settings-grid-chart { grid-template-columns: 1fr; }.topbar-actions { gap: 5px; }.user-pill { display: none; }.logout-button { padding: 8px 10px; }
}

/* v1.18.2 — navigasi, branding, login, modal password, dan responsif */
.sidebar { z-index: 400; overflow: visible; }
.main-content { min-width: 0; }
.nav-group.open { z-index: 480; }
.nav-submenu {
  z-index: 500;
  max-height: min(430px, calc(100vh - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* Child menu dibuka dengan klik agar tidak ada dua flyout terbuka karena hover. */
.nav-group:hover:not(.open) .nav-submenu { display: none; }
.nav-group.open .nav-submenu { display: grid; }
.filter-panel { z-index: 20; }

.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.brand-visual { overflow: hidden; flex: 0 0 auto; }
.brand-visual img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.brand-visual img[hidden] { display: none !important; }
.brand-visual > span { display: grid; width: 100%; height: 100%; place-items: center; }

/* Login tulisan dibuat seperti hero informasi, bukan bidang kosong. */
.prelogin-panel {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 92% 12%, rgba(43,110,157,.15), transparent 26%),
    radial-gradient(circle at 8% 88%, rgba(31,138,112,.13), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f7fbfe 52%, #f2f8f6 100%);
}
.prelogin-panel::before,
.prelogin-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
}
.prelogin-panel::before { width: 220px; height: 220px; right: -82px; top: -76px; border: 28px solid rgba(43,110,157,.055); }
.prelogin-panel::after { width: 170px; height: 170px; left: -68px; bottom: -72px; border: 22px solid rgba(31,138,112,.05); }
.prelogin-text-view { justify-content: space-between; gap: 30px; min-height: 100%; }
.prelogin-copy-header { display: flex; align-items: center; justify-content: space-between; }
.prelogin-copy-brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.prelogin-brand-visual {
  width: 50px; height: 50px; border-radius: 14px; background: var(--navy); color: #fff;
  font-weight: 900; box-shadow: 0 10px 28px rgba(23,59,87,.16);
}
.prelogin-copy-brand-text { display: grid; gap: 2px; min-width: 0; }
.prelogin-copy-brand-text strong { color: var(--navy); font-size: 16px; line-height: 1.2; }
.prelogin-copy-brand-text span { color: var(--muted); font-size: 12px; }
.prelogin-copy-card {
  width: min(720px, 100%);
  margin: auto 0;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(202,219,230,.92);
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 20px 50px rgba(16,42,61,.09);
  backdrop-filter: blur(8px);
}
.prelogin-eyebrow {
  display: inline-flex; align-items: center; margin-bottom: 15px; padding: 7px 11px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
}
.prelogin-text { font-size: clamp(22px, 2.2vw, 34px); line-height: 1.42; font-weight: 760; }
.prelogin-copy-footer { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-card { width: 100%; }
.login-brand-mark { padding: 0; }

/* Editor identitas aplikasi */
.branding-settings-panel { max-width: 900px; }
.branding-logo-editor {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfe;
}
.branding-logo-preview {
  width: 132px; height: 132px; display: grid; place-items: center; overflow: hidden;
  border: 1px solid #d3e0e8; border-radius: 22px; background: #fff; color: var(--navy);
  font-size: 34px; font-weight: 900; box-shadow: 0 10px 24px rgba(16,42,61,.08);
}
.branding-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.branding-logo-preview img[hidden] { display: none !important; }
.branding-logo-controls { display: grid; gap: 9px; min-width: 0; }
.branding-logo-controls > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.branding-logo-controls input[type="file"] { padding: 9px; background: #fff; }
.branding-logo-buttons { justify-content: flex-start; }

/* Modal ubah password user tidak lagi selebar modal database. */
.password-modal-card { width: min(520px, calc(100vw - 32px)); max-height: min(620px, 92vh); }
.compact-modal-form { padding: 20px; display: grid; gap: 14px; }
.compact-modal-form .password-policy { margin: 0; }
.password-modal-card .modal-actions { padding: 14px 20px 18px; }

/* Responsif lintas laptop, tablet, HP. */
@media (max-width: 1180px) {
  .main-content { padding-left: 24px; padding-right: 24px; }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { min-width: 0; }
}

@media (max-width: 980px) {
  .login-layout { max-width: 680px; }
  .login-card { order: 1; max-width: 620px; justify-self: center; }
  .prelogin-panel { order: 2; min-height: 320px; }
  .prelogin-copy-card { margin: 12px 0 0; }
  .branding-logo-editor { grid-template-columns: 120px minmax(0,1fr); }
  .branding-logo-preview { width: 108px; height: 108px; border-radius: 18px; }
}

@media (max-width: 850px) {
  .sidebar {
    width: min(86vw, 300px);
    z-index: 3000;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .sidebar.open { box-shadow: 18px 0 50px rgba(9,27,40,.32); }
  .nav-submenu {
    position: static;
    width: auto;
    max-height: none;
    margin: 6px 0 0 14px;
    overflow: visible;
  }
  .main-content { padding: 18px 14px 32px; }
  .topbar { gap: 10px; margin-bottom: 18px; }
  .topbar > div:nth-child(2) { min-width: 0; flex: 1; }
  .topbar h1 { white-space: normal; }
  .topbar-actions { width: auto; margin-left: auto; }
  .panel { border-radius: 12px; }
  .panel-heading { gap: 12px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .database-table, .dataset-table { min-width: 760px; }
  .log-table { min-width: 980px; }
  .modal-backdrop { padding: 12px; }
  .modal-card { width: min(720px, 100%); max-height: calc(100vh - 24px); }
  .password-modal-card { width: min(520px, 100%); }
}

@media (max-width: 680px) {
  .login-layout { gap: 16px; }
  .login-card { padding: 24px 20px; }
  .prelogin-panel { padding: 22px 18px; min-height: 280px; }
  .prelogin-text-view { gap: 20px; }
  .prelogin-copy-card { padding: 22px 18px; border-radius: 17px; }
  .prelogin-text { font-size: clamp(20px, 7vw, 28px); }
  .prelogin-chart-view { grid-template-rows: auto minmax(280px, 1fr) auto; }
  #preloginChartCanvas { min-height: 280px; }
  .branding-logo-editor { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .branding-logo-controls { width: 100%; }
  .branding-logo-buttons { width: 100%; }
  .branding-logo-buttons .btn { flex: 1 1 140px; width: auto; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .logout-button { min-width: 88px; }
  .settings-form { padding: 16px; }
  .compact-modal-form { padding: 16px; }
  .password-modal-card .modal-actions { padding: 12px 16px 16px; }
}

@media (max-width: 480px) {
  .login-screen { padding: 10px; align-items: start; }
  .login-layout { width: 100%; }
  .login-card, .prelogin-panel { border-radius: 14px; }
  .login-card h1 { font-size: 23px; }
  .login-brand-mark { width: 50px; height: 50px; margin-bottom: 16px; }
  .prelogin-copy-brand-text strong { font-size: 14px; }
  .prelogin-copy-brand-text span { font-size: 11px; }
  .prelogin-brand-visual { width: 44px; height: 44px; border-radius: 12px; }
  .summary-grid { gap: 10px; }
  .summary-card { padding: 16px; }
  .summary-card strong { font-size: 23px; }
  .topbar-actions { justify-content: stretch; }
  .logout-button { flex: 1; }
  .panel-heading { padding: 15px; }
  .filter-grid { padding: 14px; gap: 10px; }
  .modal-header { padding: 14px 16px; }
  .modal-actions { padding-left: 16px; padding-right: 16px; }
}
.sidebar-backdrop { display: none; }
@media (max-width: 850px) {
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 2990; border: 0; padding: 0;
    background: rgba(9,27,40,.46); backdrop-filter: blur(1px);
  }
  .sidebar-backdrop:not([hidden]) { display: block; }
}

/* v1.18.3 - preview tampilan publik, pilihan logo, copyright */
[hidden] { display: none !important; }

/* Mode tulisan sebelum login: fokus pada isi yang diatur admin, tanpa identitas duplikat/fixed copy. */
.prelogin-text-view {
  min-height: 100%;
  justify-content: center;
  align-items: stretch;
}
.prelogin-copy-card {
  width: min(760px, 100%);
  margin: auto;
  padding: clamp(28px, 5vw, 52px);
  text-align: left;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
}
.prelogin-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.45vw, 38px);
  line-height: 1.42;
  color: var(--navy);
}

/* Editor pilihan logo teks / image. */
.branding-mode-grid { align-items: end; }
#brandingLogoTextField input { text-transform: none; font-weight: 800; letter-spacing: .02em; }

/* Preview grafik pada pengaturan sebelum login. */
.prelogin-admin-preview {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfe;
  overflow: hidden;
}
.prelogin-admin-preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.prelogin-admin-preview-heading h3 { margin: 0; font-size: 16px; color: var(--navy); }
.prelogin-admin-preview-heading p { margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.prelogin-admin-preview-canvas {
  width: 100%;
  min-height: 360px;
  overflow-x: auto;
  border: 1px solid #e2eaf0;
  border-radius: 12px;
  background: #fff;
}
#preloginPreviewCanvas { display: block; width: 100%; min-height: 360px; }
#preloginPreviewLegend { margin-top: 12px; }

/* Footer selalu tampil di halaman login dan aplikasi. */
.global-footer {
  color: #667784;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.global-footer strong { color: var(--navy); font-weight: 800; }
.footer-separator { display: inline-block; margin: 0 7px; color: #9aa8b2; }
.login-screen { flex-direction: column; gap: 18px; }
.login-global-footer { width: min(1180px, 100%); padding: 2px 12px 4px; }
.app-global-footer { margin-top: 28px; padding: 18px 12px 2px; border-top: 1px solid var(--line); }
.copyright-preview {
  padding: 14px 16px;
  border: 1px dashed #c8d9e5;
  border-radius: 10px;
  background: #f7fbfe;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.copyright-preview strong { color: var(--navy); }

@media (max-width: 720px) {
  .prelogin-admin-preview { padding: 12px; }
  .prelogin-admin-preview-heading { display: grid; }
  .prelogin-admin-preview-heading p { text-align: left; }
  .prelogin-admin-preview-canvas { min-height: 300px; }
  #preloginPreviewCanvas { min-height: 300px; }
  .global-footer { font-size: 11px; }
}

/* Pastikan footer berada di bawah viewport bila konten pendek. */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.main-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-global-footer { margin-top: auto; width: 100%; }

/* v1.18.4 — logo selalu berada di dalam bingkai putih. */
.brand .brand-mark.brand-visual {
  background: #fff;
  color: var(--navy);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 5px 16px rgba(0,0,0,.10);
}
.brand .brand-mark.brand-visual > span {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  margin: 0;
  color: var(--navy) !important;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.2px;
}
.brand .brand-mark.brand-visual > img {
  width: 100%; height: 100%;
  padding: 5px;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  background: #fff;
}
.branding-logo-preview { background: #fff; }
.branding-logo-preview > span { color: var(--navy) !important; font-weight: 900; }
.branding-logo-preview > img { padding: 8px; object-fit: contain; background: #fff; }

/* Copyright tanpa separator titik: Disediakan oleh DJA Tahun 2026. */
.copyright-year-label { margin-left: .35em; white-space: nowrap; }
.footer-separator { display: none !important; }

/* Kamus kode. */
.code-dictionary-toolbar { justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.code-dictionary-toolbar input { width: min(620px, 100%); min-height: 42px; border: 1px solid #cfdbe4; border-radius: 9px; padding: 9px 12px; }
.code-dictionary-summary { margin: 10px 0 12px; color: var(--muted); font-size: 13px; }
.code-dictionary-table { min-width: 1180px; }
.code-dictionary-table th:nth-child(1) { width: 115px; }
.code-dictionary-table th:nth-child(2) { width: 210px; }
.code-dictionary-table th:nth-child(3) { width: 230px; }
.code-dictionary-table th:nth-child(4) { width: 270px; }
.code-dictionary-table th:nth-child(5) { width: 230px; }
.code-dictionary-table code { display: inline-block; white-space: normal; word-break: break-word; color: #17466a; background: #f0f6fa; border: 1px solid #dbe8f0; padding: 3px 6px; border-radius: 6px; font-size: 11px; line-height: 1.45; }

/* Log keamanan. */
.log-toolbar { justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.log-toolbar select { width: min(220px,100%); min-height: 40px; border: 1px solid #cfdbe4; border-radius: 8px; padding: 8px 10px; background: #fff; }
.log-toolbar input { width: min(460px,100%); }
.security-log-legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.log-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: #edf2f5; color: #536472; }
.log-badge.success { background: #e7f7ef; color: #0c7a4b; }
.log-badge.warning { background: #fff5d9; color: #946100; }
.log-badge.danger { background: #ffebeb; color: #b42318; }
.log-badge.neutral { background: #edf3f7; color: #405768; }
.log-table { min-width: 1260px; }
.log-table td:nth-child(7) { max-width: 220px; }
.log-table td:nth-child(8) { max-width: 360px; white-space: normal; word-break: break-word; }

@media (max-width: 850px) {
  .code-dictionary-toolbar > * { width: 100% !important; }
  .log-toolbar > * { width: 100% !important; }
}
.brand-visual > span[hidden], .branding-logo-preview > span[hidden] { display: none !important; }
\n\n/* v1.18.5 — sidebar ringkas, status/user/logout berada di sidebar. */\n.sidebar {\n  padding: 16px 14px 14px;\n  overflow: visible;\n}\n.brand { padding: 0 6px 14px; gap: 10px; }\n.brand-mark { width: 42px; height: 42px; border-radius: 11px; }\n.brand-copy strong { font-size: 14px; font-weight: 650; }\n.brand-copy span { font-size: 11px; }\n.nav-list {\n  margin-top: 14px;\n  gap: 4px;\n  flex: 0 0 auto;\n}\n.nav-item {\n  padding: 9px 11px;\n  min-height: 40px;\n  border-radius: 9px;\n  font-size: 14px;\n  font-weight: 400;\n}\n.nav-icon { width: 18px; flex-basis: 18px; font-size: 15px; }\n.nav-arrow { font-size: 18px; }\n.nav-item:hover, .nav-item.active { transform: none; font-weight: 400; }\n.nav-subitem {\n  padding: 9px 10px;\n  min-height: 38px;\n  font-size: 13px;\n  font-weight: 400;\n}\n.nav-subitem:hover, .nav-subitem.active { font-weight: 400; }\n\n.sidebar-session {\n  margin-top: auto;\n  padding: 12px 4px 0;\n  border-top: 1px solid rgba(255,255,255,.12);\n  display: grid;\n  gap: 8px;\n  min-width: 0;\n}\n.sidebar .status-pill {\n  margin: 0;\n  width: 100%;\n  min-height: 34px;\n  justify-content: flex-start;\n  border-color: rgba(255,255,255,.12);\n  background: rgba(255,255,255,.07);\n  color: rgba(255,255,255,.88);\n  padding: 7px 9px;\n  font-size: 11px;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n.sidebar .status-pill.ok {\n  background: rgba(36,161,72,.13);\n  border-color: rgba(83,211,116,.24);\n  color: #d8f7df;\n}\n.sidebar .status-pill.error {\n  background: rgba(214,69,69,.14);\n  border-color: rgba(255,117,117,.26);\n  color: #ffe1e1;\n}\n.sidebar-user-pill {\n  display: grid;\n  gap: 2px;\n  padding: 8px 10px;\n  border: 1px solid rgba(255,255,255,.12);\n  border-radius: 9px;\n  background: rgba(255,255,255,.06);\n  color: #fff;\n  min-width: 0;\n}\n.sidebar-user-pill strong {\n  min-width: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-size: 12px;\n  line-height: 1.25;\n  font-weight: 500;\n}\n.sidebar-user-pill span {\n  color: rgba(255,255,255,.64);\n  font-size: 10px;\n  line-height: 1.2;\n  font-weight: 400;\n}\n.sidebar-logout {\n  width: 100%;\n  min-height: 34px;\n  padding: 7px 10px;\n  border: 1px solid rgba(255,255,255,.15);\n  border-radius: 9px;\n  background: rgba(255,255,255,.09);\n  color: #fff;\n  font-size: 12px;\n  font-weight: 400;\n  box-shadow: none;\n}\n.sidebar-logout:hover { background: rgba(255,255,255,.15); transform: none; }\n.topbar { min-height: 42px; }\n.topbar-actions { display: none !important; }\n\n/* Pada layar pendek, semua tombol utama sidebar tetap muat tanpa scroll. */\n@media (min-width: 851px) and (max-height: 760px) {\n  .sidebar { padding-top: 11px; padding-bottom: 10px; }\n  .brand { padding-bottom: 9px; }\n  .brand-mark { width: 36px; height: 36px; }\n  .brand-copy strong { font-size: 13px; }\n  .brand-copy span { font-size: 10px; }\n  .nav-list { margin-top: 9px; gap: 2px; }\n  .nav-item { min-height: 35px; padding: 7px 10px; font-size: 13px; }\n  .nav-icon { font-size: 14px; }\n  .sidebar-session { padding-top: 8px; gap: 5px; }\n  .sidebar .status-pill, .sidebar-logout { min-height: 30px; padding-top: 5px; padding-bottom: 5px; }\n  .sidebar-user-pill { padding: 6px 9px; }\n}\n@media (min-width: 851px) and (max-height: 620px) {\n  .brand-copy span { display: none; }\n  .brand { padding-bottom: 7px; }\n  .nav-list { margin-top: 7px; }\n  .nav-item { min-height: 31px; padding: 5px 9px; font-size: 12px; }\n  .sidebar-session { gap: 4px; }\n}\n\n@media (max-width: 850px) {\n  .sidebar {\n    padding: 14px 12px 12px;\n    overflow: hidden;\n  }\n  .brand { padding-bottom: 11px; }\n  .nav-list { margin-top: 11px; gap: 3px; }\n  .nav-item { min-height: 38px; padding: 8px 10px; }\n  /* Child menu menjadi popover di dalam drawer, jadi tidak menambah tinggi sidebar. */\n  .nav-submenu {\n    position: fixed;\n    left: 12px;\n    top: 92px;\n    width: calc(min(86vw, 300px) - 24px);\n    max-height: calc(100vh - 190px);\n    margin: 0;\n    overflow-y: auto;\n    z-index: 3200;\n    box-shadow: 0 18px 44px rgba(9,27,40,.30);\n  }\n  .sidebar-session { padding-top: 9px; gap: 6px; }\n  .sidebar .status-pill { font-size: 11px; }\n}\n\n@media (max-width: 850px) and (max-height: 680px) {\n  .sidebar { padding-top: 9px; padding-bottom: 9px; }\n  .brand { padding-bottom: 7px; }\n  .brand-mark { width: 36px; height: 36px; }\n  .brand-copy span { display: none; }\n  .nav-list { margin-top: 7px; gap: 1px; }\n  .nav-item { min-height: 32px; padding: 5px 9px; font-size: 12px; }\n  .sidebar-session { padding-top: 6px; gap: 4px; }\n  .sidebar .status-pill, .sidebar-logout { min-height: 29px; padding: 5px 8px; }\n  .sidebar-user-pill { padding: 5px 8px; }\n}\n
/* v1.18.6 — sidebar account minimal + flyout child menu selalu terlihat. */
.sidebar-session {
  margin-top: auto;
  padding: 10px 3px 0;
  border-top: 1px solid rgba(255,255,255,.12);
  display: block;
}
.sidebar-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sidebar-account-name {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.92);
  padding: 7px 4px;
}
.sidebar-account-icon {
  color: #63d28a;
  font-size: 8px;
  line-height: 1;
  flex: 0 0 auto;
}
.sidebar-account-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 400;
}
.sidebar-logout {
  flex: 0 0 auto;
  width: auto;
  min-width: 66px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  font-size: 11px;
  line-height: 1;
  font-weight: 400;
  box-shadow: none;
}
.sidebar-logout:hover {
  background: rgba(255,255,255,.15);
  transform: none;
}

/* Flyout diposisikan oleh JS sebagai fixed agar tidak terpotong panel/viewport. */
.nav-submenu {
  position: fixed;
  left: auto;
  top: auto;
  z-index: 10000;
  width: 224px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.nav-submenu::before { display: none; }
.nav-group:hover .nav-submenu { display: none; }
.nav-group.open .nav-submenu { display: grid; }
.nav-subitem,
.nav-subitem *,
.nav-subitem:hover,
.nav-subitem.active,
.nav-subitem.active * {
  font-weight: 400 !important;
}
.nav-subitem {
  min-height: 36px;
  padding: 8px 10px;
  line-height: 1.25;
}
.nav-subitem > span {
  flex: 0 0 18px;
  width: 18px;
}

@media (min-width: 851px) and (max-height: 700px) {
  .sidebar-session { padding-top: 7px; }
  .sidebar-account-name { padding-top: 5px; padding-bottom: 5px; }
  .sidebar-logout { min-height: 28px; padding: 5px 9px; }
}

@media (max-width: 850px) {
  .sidebar-session { padding-top: 8px; }
  .nav-submenu {
    position: fixed;
    width: min(280px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    margin: 0;
    z-index: 10000;
    background: #fff;
    border-color: rgba(220,229,236,.95);
    box-shadow: 0 18px 44px rgba(9,27,40,.30);
  }
  .nav-subitem { color: #29465b; }
}


/* v1.18.7 — status/user/logout vertikal, subjudul wrap penuh, copyright rapat + catatan bebas. */
.brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  align-self: center;
}
.brand-copy strong,
.brand-copy span {
  display: block !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}
.brand-copy strong { line-height: 1.22; }
.brand-copy span { line-height: 1.3; margin-top: 3px; }

.sidebar-session {
  margin-top: auto;
  padding: 9px 0 0;
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid;
  gap: 2px;
  min-width: 0;
}
.sidebar .status-pill,
.sidebar-session-item {
  width: 100%;
  min-height: 32px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.88);
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 400;
  box-shadow: none;
  text-align: left;
}
.sidebar .status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.sidebar .status-pill span {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
}
.sidebar .status-pill.ok,
.sidebar .status-pill.error {
  background: transparent;
  border: 0;
}
.sidebar .status-pill.ok { color: #dff8e6; }
.sidebar .status-pill.error { color: #ffdede; }
.sidebar-session-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-user-row { color: rgba(255,255,255,.94); }
.sidebar-user-row #currentUserName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-session-icon {
  flex: 0 0 16px;
  width: 16px;
  text-align: center;
  color: rgba(255,255,255,.64);
  font-size: 10px;
}
.sidebar-user-row .sidebar-session-icon { color: #63d28a; font-size: 8px; }
.sidebar-logout {
  min-width: 0;
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 400;
  justify-content: flex-start;
}
.sidebar-session-item:hover,
.sidebar-logout:hover {
  background: rgba(255,255,255,.08);
  transform: none;
}

/* Footer copyright dibaca sebagai satu kalimat rapat dan bisa membungkus jika catatan panjang. */
.global-footer,
.copyright-preview {
  display: flex;
  align-items: baseline;
  justify-content: center;
  column-gap: 4px;
  row-gap: 2px;
  flex-wrap: wrap;
}
.copyright-year-label { margin-left: 0 !important; white-space: nowrap; }
.copyright-extra {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.copyright-extra[hidden] { display: none !important; }
.settings-form textarea#copyrightExtra {
  width: 100%;
  min-height: 84px;
  resize: vertical;
}

@media (min-width: 851px) and (max-height: 620px) {
  .brand-copy span { display: block !important; font-size: 9px; line-height: 1.2; }
  .sidebar-session { gap: 0; padding-top: 5px; }
  .sidebar .status-pill, .sidebar-session-item, .sidebar-logout { min-height: 27px; padding-top: 4px; padding-bottom: 4px; font-size: 11px; }
}
@media (max-width: 850px) and (max-height: 680px) {
  .brand-copy span { display: block !important; font-size: 9px; line-height: 1.2; }
  .sidebar-session { gap: 0; padding-top: 5px; }
  .sidebar .status-pill, .sidebar-session-item, .sidebar-logout { min-height: 28px; padding-top: 4px; padding-bottom: 4px; font-size: 11px; }
}

.copyright-tail { min-width: 0; }
.copyright-tail .copyright-extra { margin-left: 0; }

/* v1.18.8 — tampilan uraian default ringkas + tombol detail tunggal. */
.pivot-detail-button {
  min-height: 34px;
  padding: 7px 14px;
  white-space: nowrap;
}
.hierarchy-toolbar .hierarchy-status {
  margin-left: 0;
  margin-right: auto;
  font-weight: 500;
  white-space: normal;
}
@media (max-width: 720px) {
  .pivot-detail-button { width: 100%; }
  .hierarchy-toolbar .hierarchy-status { width: 100%; margin-right: 0; }
}

/* v1.18.8 — filter per header pada Lihat Database. */
.database-table thead .db-title-row th {
  top: 0;
  height: 42px;
  z-index: 12;
}
.database-table thead .db-filter-row th {
  position: sticky;
  top: 42px;
  z-index: 10;
  padding: 6px;
  color: var(--text);
  background: #edf4f8;
  border-bottom: 1px solid #cbdbe6;
  overflow: visible;
}
.database-table thead .db-filter-row th:first-child,
.database-table thead .db-filter-row th:last-child {
  z-index: 13;
  color: #51636f;
  background: #e4eef5;
}
.db-column-filter {
  width: 100%;
  min-width: 105px;
  height: 32px;
  padding: 5px 8px;
  border: 1px solid #c7d7e2;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  outline: none;
}
.db-column-filter:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(43,110,157,.12);
}
.db-filter-caption {
  color: #657782;
  font-size: 10px;
  font-weight: 600;
}
.database-filter-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #f8fbfd;
}
.database-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d7e3eb;
  border-radius: 10px;
  background: #fff;
}
.database-summary-item span {
  color: var(--muted);
  font-size: 12px;
}
.database-summary-item strong {
  color: var(--navy);
  font-size: 15px;
  text-align: right;
  overflow-wrap: anywhere;
}
.database-summary-item.not-applicable strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
@media (max-width: 760px) {
  .database-filter-summary { grid-template-columns: 1fr; padding: 12px; }
  .database-summary-item { align-items: flex-start; flex-direction: column; gap: 5px; }
  .database-summary-item strong { text-align: left; }
}

/* v1.18.10 — toolbar Tabelaris satu baris dan kontrol ringkas. */
.pivot-action-row {
  align-items: center;
  flex: 1 1 720px;
  justify-content: flex-end;
  gap: 7px;
}
.pivot-action-row .pivot-detail-button,
.pivot-action-row .btn,
.pivot-action-row .font-size-control,
.pivot-action-row .compact-display-control {
  flex: 0 0 auto;
  width: auto;
}
.pivot-action-row .compact-display-control {
  min-height: 36px;
  padding: 3px 5px 3px 9px;
  gap: 5px;
}
.pivot-action-row .compact-display-control > span {
  color: #52636f;
  font-size: 11px;
  font-weight: 650;
}
.pivot-action-row .compact-display-control select {
  min-width: 86px;
  height: 28px;
  padding-left: 7px;
  padding-right: 22px;
}
.pivot-action-row .compact-display-control:nth-of-type(2) select {
  min-width: 52px;
}

@media (max-width: 1180px) {
  .pivot-panel .panel-heading { align-items: flex-start; }
  .pivot-action-row { justify-content: flex-start; flex-basis: 100%; }
}

@media (max-width: 720px) {
  .pivot-action-row {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .pivot-action-row .pivot-detail-button,
  .pivot-action-row .btn,
  .pivot-action-row .font-size-control,
  .pivot-action-row .compact-display-control {
    width: 100%;
    min-width: 0;
  }
  .pivot-action-row .compact-display-control { justify-content: space-between; }
  .pivot-action-row .compact-display-control select { min-width: 0; flex: 1; }
  .pivot-action-row .font-size-control { justify-content: center; }
}

@media (max-width: 430px) {
  .pivot-action-row { grid-template-columns: 1fr; }
}


/* v1.18.11 — Tabelaris padat tanpa simbol +/- agar lebih banyak baris terlihat. */
.pivot-panel .panel-heading {
  padding: 10px 14px;
  gap: 10px;
}
.pivot-panel .panel-heading h2 { font-size: 17px; line-height: 1.15; }
.pivot-panel .panel-heading p { margin-top: 2px; font-size: 11px; line-height: 1.15; }
.pivot-panel .panel-heading .pivot-jenis { margin-top: 1px; }
.pivot-table th,
.pivot-table td {
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.15;
}
.pivot-table th { height: 28px; }
.pivot-table tfoot td { height: 28px; }
.tree-label,
.tree-label-fixed {
  align-items: center;
  gap: 0;
  min-height: 16px;
}
.tree-toggle { display: none !important; }
.tree-text { line-height: 1.15; }
.pivot-panel .table-wrap { overscroll-behavior: contain; }

/* Toolbar tetap satu baris padat pada layar kecil; dapat digeser horizontal
   tanpa memakan tinggi layar beberapa baris. */
@media (max-width: 720px) {
  .pivot-panel .panel-heading { padding: 9px 10px; }
  .pivot-action-row {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .pivot-action-row .pivot-detail-button,
  .pivot-action-row .btn,
  .pivot-action-row .font-size-control,
  .pivot-action-row .compact-display-control {
    width: auto;
    min-width: max-content;
  }
  .pivot-table { font-size: min(var(--pivot-font-size, 12px), 12px); }
  .pivot-table th,
  .pivot-table td { padding-top: 2px; padding-bottom: 2px; }
}


/* v1.18.12 — filter menyatu dengan Tabelaris, kartu Capaian, dan scroll trackpad. */
.pivot-panel {
  overflow: visible;
}

.pivot-filter-bar {
  position: relative;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.compact-filter-control {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: 88px;
  color: #43515c;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
}

.compact-filter-control > span {
  padding-left: 2px;
  white-space: nowrap;
}

.compact-filter-control select,
.compact-filter-control input,
.pivot-filter-bar .year-multi-button {
  width: 100%;
  min-height: 30px;
  height: 30px;
  border: 1px solid #cfdbe4;
  border-radius: 7px;
  padding: 4px 24px 4px 8px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-size: 11px;
  line-height: 1;
}

.compact-filter-control input {
  padding-right: 8px;
}

.compact-filter-control select:focus,
.compact-filter-control input:focus,
.pivot-filter-bar .year-multi-button:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(43,110,157,.10);
}

.pivot-filter-bar .year-multi-field {
  min-width: 104px;
  position: relative;
  z-index: 85;
}

.pivot-filter-bar .year-multi-field.open {
  z-index: 10020;
}

.pivot-filter-bar .year-multi-button {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}

.pivot-filter-bar .year-multi-menu {
  left: 0;
  right: auto;
  width: 210px;
  min-width: 210px;
  max-height: 250px;
  z-index: 10030;
}

.compact-month-filter {
  min-width: 164px;
}

.compact-month-filter .month-range-controls {
  grid-template-columns: 1fr auto 1fr;
  gap: 3px;
}

.compact-month-filter .month-range-separator {
  font-size: 10px;
  font-weight: 500;
}

.compact-search-filter {
  min-width: 126px;
  flex: 1 0 126px;
}

.compact-reset-filter {
  flex: 0 0 auto;
  min-height: 30px;
  height: 30px;
  border: 1px solid #cbdce7;
  border-radius: 7px;
  padding: 4px 9px;
  background: #fff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.compact-reset-filter:hover {
  background: var(--blue-soft);
}

.pivot-panel > .panel-heading {
  border-top: 0;
}

/* Biarkan trackpad menggeser halaman secara vertikal dan tabel secara horizontal. */
.pivot-panel .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pivot-panel:fullscreen .table-wrap,
.pivot-panel.is-fullscreen .table-wrap,
.pivot-panel.fullscreen-fallback .table-wrap {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

@media (max-width: 850px) {
  .pivot-filter-bar {
    padding: 7px 8px;
    gap: 5px;
  }
  .compact-filter-control {
    min-width: 96px;
  }
  .compact-month-filter { min-width: 170px; }
  .compact-search-filter { min-width: 130px; flex-basis: 130px; }
  .pivot-filter-bar .year-multi-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 74px;
    width: auto;
    min-width: 0;
    max-height: 48vh;
  }
}

/* Dropdown tahun memakai posisi fixed dari JS agar tidak terpotong bar filter horizontal. */
.pivot-filter-bar .year-multi-menu {
  position: fixed;
  right: auto;
}
@media (max-width: 850px) {
  .pivot-filter-bar .year-multi-menu {
    position: fixed;
    max-height: 48vh;
  }
}


/* v1.18.13 — mode dua tahun tetap sepadat semua tahun dan trackpad lebih responsif. */
.pivot-table.comparison-mode th,
.pivot-table.comparison-mode td {
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.15;
}

/* Badge tren lama 30px memaksa seluruh baris menjadi tinggi pada mode 2 tahun. */
.pivot-table.comparison-mode .trend-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.pivot-table.comparison-mode .trend-indicator.up .trend-arrow {
  border-left-width: 4px;
  border-right-width: 4px;
  border-bottom-width: 7px;
}
.pivot-table.comparison-mode .trend-indicator.down .trend-arrow {
  border-left-width: 4px;
  border-right-width: 4px;
  border-top-width: 7px;
}
.pivot-table.comparison-mode .trend-indicator.flat .trend-arrow {
  width: 8px;
  height: 2px;
}
.pivot-table.comparison-mode .comparison-percent {
  font-size: .94em;
  line-height: 1;
}
.pivot-table.comparison-mode .comparison-trend-cell {
  padding-left: 3px;
  padding-right: 3px;
  line-height: 1;
}

@media (max-width: 720px) {
  .pivot-table.comparison-mode th,
  .pivot-table.comparison-mode td {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}

/* v1.18.14 — toolbar grafik ringkas, multi-select seri, dan modal status proses. */
.chart-toolbar {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 12px;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.chart-toolbar .chart-control,
.chart-toolbar > label {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: 104px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.chart-toolbar .chart-control-data { min-width: 142px; }
.chart-toolbar .chart-percentage-control { min-width: 170px; }
.chart-toolbar .chart-control-palette { min-width: 154px; }
.chart-toolbar .chart-control select,
.chart-toolbar > label select {
  min-width: 0 !important;
  width: 100%;
  min-height: 31px;
  height: 31px;
  padding: 4px 27px 4px 8px;
  border-radius: 7px;
  font-size: 11px;
}
.chart-toolbar label:first-child,
.chart-toolbar label:first-child select,
.chart-toolbar .chart-percentage-control,
.chart-toolbar .chart-percentage-control select {
  min-width: 0;
}
.chart-series-multi {
  position: relative;
  flex: 0 0 auto;
  min-width: 138px;
  color: #43515c;
  font-size: 10px;
}
.chart-series-multi > summary {
  list-style: none;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding: 4px 9px;
  border: 1px solid #cfdbe4;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.chart-series-multi > summary::-webkit-details-marker { display: none; }
.chart-series-multi > summary::after { content: '⌄'; color: #5c6d78; font-size: 12px; }
.chart-series-multi[open] > summary { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,110,157,.11); }
.chart-series-menu {
  position: fixed;
  z-index: 6200;
  width: 190px;
  padding: 7px;
  border: 1px solid #cfdbe4;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16,42,61,.2);
}
.chart-series-menu label {
  min-width: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  min-height: 31px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #314653;
  font-size: 11px !important;
  font-weight: 500 !important;
  cursor: pointer;
}
.chart-series-menu label:hover { background: #eef6fb; }
.chart-series-menu input { margin: 0; accent-color: var(--blue); }
.chart-legend {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: 31px;
  margin-left: auto;
  white-space: nowrap;
}
.chart-legend-item { gap: 5px; font-size: 10px; font-weight: 600; }
.chart-legend-swatch { width: 17px; height: 6px; }

.operation-modal-backdrop { z-index: 7600; }
.operation-modal-card {
  width: min(510px, calc(100vw - 24px));
  overflow: hidden;
}
.operation-modal-body {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 24px;
}
.operation-modal-body h2 { margin: 0 0 7px; color: var(--navy); font-size: 19px; }
.operation-modal-body p { margin: 0 0 8px; color: #40525f; font-size: 13px; line-height: 1.5; }
.operation-modal-body small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.operation-status-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf4fa;
  color: var(--blue);
  font-size: 25px;
  font-weight: 800;
}
.operation-spinner {
  width: 27px;
  height: 27px;
  border: 4px solid #d3e5f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: operation-spin .8s linear infinite;
}
.operation-modal-card.is-success .operation-status-icon { background: #e8f6ef; color: #16835d; }
.operation-modal-card.is-error .operation-status-icon { background: #fdebec; color: #c8323e; }
.operation-modal-card.is-success .operation-status-icon::before { content: '✓'; }
.operation-modal-card.is-error .operation-status-icon::before { content: '!'; }
.operation-modal-card.is-success .operation-spinner,
.operation-modal-card.is-error .operation-spinner { display: none; }
.operation-modal-actions { position: static; min-height: 61px; }
@keyframes operation-spin { to { transform: rotate(360deg); } }

@media (max-width: 850px) {
  .chart-toolbar { align-items: flex-end; flex-wrap: nowrap; }
  .chart-toolbar .chart-control,
  .chart-toolbar > label { flex: 0 0 auto; }
  .chart-legend { flex: 0 0 auto; margin-left: 0; }
}
@media (max-width: 520px) {
  .operation-modal-body { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 20px 16px; }
  .operation-status-icon { width: 40px; height: 40px; }
  .operation-spinner { width: 23px; height: 23px; }
}
.chart-actions .btn {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 11px;
}
.chart-toolbar .chart-control,
.chart-toolbar > label { min-width: 88px; }
.chart-toolbar .chart-control-data { min-width: 132px; }
.chart-toolbar .chart-percentage-control { min-width: 155px; }
.chart-toolbar .chart-control-palette { min-width: 140px; }
.chart-series-multi { min-width: 126px; }


/* v1.18.15 — Lihat Database: freeze hanya No. dan kolom data pertama. */
.database-table th:first-child,
.database-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  min-width: 98px;
  width: 98px;
  max-width: 98px;
  background: #fff;
}
.database-table th:nth-child(2),
.database-table td:nth-child(2) {
  position: sticky;
  left: 98px;
  z-index: 6;
  min-width: 190px;
  max-width: 260px;
  background: #fff;
  box-shadow: 1px 0 0 #cbdbe6;
}
.database-table thead .db-title-row th:first-child,
.database-table thead .db-title-row th:nth-child(2) {
  top: 0;
  z-index: 16;
  color: #fff;
  background: var(--navy);
}
.database-table thead .db-filter-row th:first-child,
.database-table thead .db-filter-row th:nth-child(2) {
  top: 42px;
  z-index: 15;
  color: #51636f;
  background: #e4eef5;
}
.database-table th:last-child {
  right: auto;
}
.database-table td:last-child {
  position: static;
  right: auto;
  background: #fff;
}

/* Pilihan impor BULAN_BUKU kosong hanya tampil untuk Tabel Realisasi. */
.database-import-blank-option {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  align-items: center;
  gap: 8px 14px;
  padding: 13px 14px;
  border: 1px solid #c9dce8;
  border-radius: 10px;
  background: #f6fafc;
}
.database-import-blank-option[hidden] { display: none; }
.database-import-blank-option label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.database-import-blank-option select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #bfd2df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.database-import-blank-option small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.45;
}
@media (max-width: 620px) {
  .database-import-blank-option { grid-template-columns: 1fr; }
  .database-import-blank-option small { grid-column: auto; }
}


/* v1.18.22 — pilihan 3+ tahun tetap terbaca pada filter ringkas. */
.pivot-filter-bar .year-multi-field.has-multiple-years { min-width: 150px; }
.pivot-filter-bar .year-multi-field.has-many-years { min-width: 215px; }
@media (max-width: 850px) {
  .pivot-filter-bar .year-multi-field.has-multiple-years,
  .pivot-filter-bar .year-multi-field.has-many-years { min-width: 205px; }
}


/* v1.18.24 — tautan sidebar dapat dibuka di tab baru. */
a.nav-item,
a.nav-subitem {
  text-decoration: none;
  cursor: pointer;
}

/* Perubahan raw ditampung sampai Admin/OC menerapkan semuanya. */
.database-pending-bar {
  margin: 0 18px 12px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #c9dce8;
  border-radius: 10px;
  background: #f3f8fb;
}
.database-pending-bar.has-pending {
  border-color: #e4be65;
  background: #fff7df;
}
.database-pending-copy { display: grid; gap: 3px; min-width: 0; }
.database-pending-copy strong { color: var(--navy); font-size: 13px; }
.database-pending-copy span { color: #5b6b75; font-size: 11px; line-height: 1.35; }
.database-pending-bar.has-pending .database-pending-copy strong { color: #7a5200; }
.database-pending-bar .btn { flex: 0 0 auto; white-space: nowrap; }

/* Header/filter database tidak bergeser saat mengetik. */
.database-table {
  table-layout: fixed;
  width: max-content;
  min-width: max(1200px, 100%);
}
.database-table th,
.database-table td {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}
.database-table th:first-child,
.database-table td:first-child {
  width: 98px;
  min-width: 98px;
  max-width: 98px;
}
.database-table th:nth-child(2),
.database-table td:nth-child(2) {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}
.database-table th:last-child,
.database-table td:last-child {
  width: 135px;
  min-width: 135px;
  max-width: 135px;
}
.database-table .db-column-filter {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#databaseTableBody.is-loading { opacity: .7; }

@media (max-width: 760px) {
  .database-pending-bar { align-items: stretch; flex-direction: column; }
  .database-pending-bar .btn { width: 100%; }
}


/* v1.18.25: klik Uraian membuka grafik drill-down */
.pivot-drilldown-link {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}
.pivot-drilldown-link:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.pivot-drilldown-link:focus-visible { outline: 2px solid rgba(43,110,157,.35); outline-offset: 2px; border-radius: 3px; }
.drilldown-modal-lock { overflow: hidden; }
.drilldown-chart-modal-card { width: min(1120px, 96vw); overflow: hidden; }
.drilldown-chart-header { align-items: center; }
.drilldown-chart-header-actions { display: flex; align-items: center; gap: 10px; }
.drilldown-chart-header-actions label { display: flex; align-items: center; gap: 7px; color: #52626d; font-size: 12px; font-weight: 600; }
.drilldown-chart-header-actions select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 30px 0 10px; background: #fff; color: var(--navy); font: inherit; }
.drilldown-chart-body { position: relative; padding: 16px 20px 18px; overflow: auto; }
.drilldown-chart-canvas-wrap { width: 100%; min-height: 360px; overflow-x: auto; }
.drilldown-chart-canvas-wrap canvas { display: block; max-width: none; border: 1px solid #e2eaf0; border-radius: 10px; background: #fff; }
.drilldown-chart-status { min-height: 360px; display: grid; place-items: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.drilldown-chart-status[hidden] { display: none; }
.drilldown-chart-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; padding-top: 12px; }
.drilldown-legend-item { display: inline-flex; align-items: center; gap: 6px; color: #41515d; font-size: 12px; }
.drilldown-legend-item i { display: block; width: 18px; height: 4px; border-radius: 999px; }
.drilldown-chart-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
@media (max-width: 720px) {
  .drilldown-chart-backdrop { padding: 8px; }
  .drilldown-chart-modal-card { width: 100%; max-height: calc(100vh - 16px); }
  .drilldown-chart-header { align-items: flex-start; padding: 13px 14px; }
  .drilldown-chart-header-actions { gap: 6px; }
  .drilldown-chart-header-actions label { flex-direction: column; align-items: flex-start; gap: 2px; }
  .drilldown-chart-header-actions select { height: 31px; }
  .drilldown-chart-body { padding: 12px; }
  .drilldown-chart-canvas-wrap { min-height: 340px; }
}


/* v1.18.26 - multi-select Jenis dan tabel per Jenis */
.pivot-filter-bar .jenis-multi-field { min-width: 132px; z-index: 86; }
.pivot-filter-bar .jenis-multi-field.open { z-index: 10025; }
.pivot-filter-bar .jenis-multi-menu { width: 235px; min-width: 235px; z-index: 10035; }
.pivot-table .pivot-jenis-section td {
  background: #d9eaf5;
  color: #173b57;
  font-weight: 750;
  text-align: left !important;
  padding: 5px 8px;
  border-top: 2px solid #9fc0d5;
}
.pivot-table .pivot-jenis-total td {
  background: #173b57;
  color: #fff;
  font-weight: 750;
}
.pivot-table.multi-jenis .pivot-jenis-section:first-child td { border-top: 0; }
@media (max-width: 760px) {
  .pivot-filter-bar .jenis-multi-field { min-width: 145px; }
  .pivot-filter-bar .jenis-multi-menu { max-height: 45vh; }
}

/* v1.18.27 — header Tabelaris bertingkat: Tahun → Realisasi/Target/Outlook. */
.pivot-table.multi-jenis-matrix thead tr:first-child th {
  top: 0;
  height: 27px;
  padding-top: 3px;
  padding-bottom: 3px;
  text-align: center;
  vertical-align: middle;
  z-index: 8;
}
.pivot-table.multi-jenis-matrix thead tr:first-child th:first-child {
  text-align: left;
  z-index: 10;
}
.pivot-table.multi-jenis-matrix thead tr:nth-child(2) th {
  top: 27px;
  height: 25px;
  padding-top: 2px;
  padding-bottom: 2px;
  text-align: center;
  background: #28536f;
  font-size: .92em;
  z-index: 7;
}
.pivot-table.multi-jenis-matrix .pivot-jenis-column.year-group-start {
  border-left: 2px solid rgba(255,255,255,.55);
}
.pivot-table.multi-jenis-matrix tbody td,
.pivot-table.multi-jenis-matrix tfoot td {
  padding-left: 6px;
  padding-right: 6px;
}
.pivot-table.multi-jenis-matrix tbody td:not(:first-child),
.pivot-table.multi-jenis-matrix tfoot td:not(:first-child) {
  min-width: 88px;
}
.pivot-table.multi-jenis-matrix .pivot-year-group-header {
  letter-spacing: .01em;
}
@media (max-width: 720px) {
  .pivot-table.multi-jenis-matrix thead tr:first-child th { top: 0; }
  .pivot-table.multi-jenis-matrix thead tr:nth-child(2) th { top: 27px; }
  .pivot-table.multi-jenis-matrix tbody td:not(:first-child),
  .pivot-table.multi-jenis-matrix tfoot td:not(:first-child) { min-width: 82px; }
}

/* v1.18.28 — kartu ringkasan compact, dua capaian, dan kolom Uraian adaptif. */
.summary-grid.summary-grid-compact {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.summary-grid-compact .summary-card {
  min-height: 92px;
  padding: 11px 13px;
  border-radius: 12px;
}
.summary-grid-compact .summary-card::after {
  width: 68px;
  height: 68px;
  right: -28px;
  bottom: -34px;
}
.summary-grid-compact .summary-label {
  margin-bottom: 4px;
  font-size: 11.5px;
  line-height: 1.25;
}
.summary-grid-compact .summary-card strong {
  font-size: 22px;
  line-height: 1.05;
}
.summary-grid-compact .summary-card small {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.25;
}
.summary-grid-compact .summary-card-achievement strong { color: var(--navy); }

.pivot-table {
  table-layout: fixed;
}
.pivot-table th:first-child,
.pivot-table td:first-child {
  width: var(--pivot-label-width, 280px) !important;
  min-width: var(--pivot-label-width, 280px) !important;
  max-width: var(--pivot-label-width, 280px) !important;
}
.pivot-table .tree-text {
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .summary-grid.summary-grid-compact { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 720px) {
  .summary-grid.summary-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-grid-compact .summary-card { min-height: 86px; padding: 10px 11px; }
  .summary-grid-compact .summary-card strong { font-size: 20px; }
}


/* v1.18.29 — urutan Target/Outlook/Realisasi dan scroll horizontal layar penuh. */
.pivot-panel:fullscreen .table-wrap,
.pivot-panel.is-fullscreen .table-wrap,
.pivot-panel.fullscreen-fallback .table-wrap {
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-width: 100vw;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
}
.pivot-panel:fullscreen .pivot-table,
.pivot-panel.is-fullscreen .pivot-table,
.pivot-panel.fullscreen-fallback .pivot-table {
  max-width: none;
}
.summary-grid-compact .summary-card-achievement {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* v1.18.30 — kartu lebih lega dan persentase per Jenis untuk dua tahun. */
.summary-grid.summary-grid-compact {
  gap: 12px;
  margin-bottom: 14px;
}
.summary-grid-compact .summary-card {
  min-height: 110px;
  padding: 14px 15px;
}
.summary-grid-compact .summary-label {
  min-height: 18px;
  margin-bottom: 7px;
  font-size: 12px;
  line-height: 1.3;
  color: #536878;
}
.summary-grid-compact .summary-card strong {
  font-size: 25px;
  line-height: 1.08;
}
.summary-grid-compact .summary-card small {
  margin-top: 6px;
  font-size: 11px;
}
.summary-grid-compact .summary-card-achievement {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  justify-content: initial;
}
.summary-grid-compact .summary-card-achievement .summary-label {
  align-self: start;
}
.summary-grid-compact .summary-card-achievement strong {
  align-self: center;
  justify-self: center;
  text-align: center;
  font-size: 27px;
  width: 100%;
}

.pivot-table.multi-jenis-matrix .pivot-change-group-header {
  background: #214963;
  border-left: 2px solid rgba(255,255,255,.7);
  white-space: nowrap;
}
.pivot-table.multi-jenis-matrix .pivot-percent-column {
  background: #315f7c;
  white-space: nowrap;
}
.pivot-table.multi-jenis-matrix .pivot-percent-column.year-group-start {
  border-left: 2px solid rgba(255,255,255,.7);
}
.pivot-table.matrix-comparison-mode .comparison-percent {
  text-align: center !important;
  white-space: nowrap;
  font-size: .94em;
}

@media (max-width: 1180px) {
  .summary-grid-compact .summary-card { min-height: 104px; }
}
@media (max-width: 720px) {
  .summary-grid-compact .summary-card { min-height: 98px; padding: 11px 12px; }
  .summary-grid-compact .summary-label { font-size: 11px; }
  .summary-grid-compact .summary-card strong { font-size: 22px; }
  .summary-grid-compact .summary-card-achievement strong { font-size: 24px; }
}


/* v1.18.31 — capaian sejajar kiri dan modal Grafik Realisasi terlihat saat Tabelaris fullscreen. */
.summary-grid-compact .summary-card-achievement {
  display: block;
  text-align: left;
}
.summary-grid-compact .summary-card-achievement .summary-label {
  display: block;
  min-height: 18px;
  margin-bottom: 7px;
  text-align: left;
}
.summary-grid-compact .summary-card-achievement strong {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 25px;
  line-height: 1.08;
  text-align: left;
  align-self: auto;
  justify-self: auto;
}
.drilldown-chart-backdrop {
  z-index: 9500;
}
.pivot-panel:fullscreen > .drilldown-chart-backdrop,
.pivot-panel.is-fullscreen > .drilldown-chart-backdrop,
.pivot-panel.fullscreen-fallback > .drilldown-chart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
}

/* v1.18.32 — satu tahun: kolom capaian Realisasi terhadap Target dan Outlook. */
.pivot-table.single-year-capaian-mode .pivot-capaian-group-header {
  border-left: 2px solid rgba(255,255,255,.7);
}
.pivot-table.single-year-capaian-mode .pivot-capaian-column {
  min-width: 92px;
}
.pivot-table.single-year-capaian-mode .achievement-percent {
  text-align: center !important;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text);
}
.pivot-table.single-year-capaian-mode tfoot .achievement-percent {
  color: #fff;
}


/* v1.18.33 - periode grafik Harian/Bulanan/Tahunan */
.chart-toolbar .chart-control-period { min-width: 104px; }
.chart-toolbar .chart-control-period select { min-width: 104px; }
@media (max-width: 850px) {
  .chart-toolbar .chart-control-period { min-width: 96px; }
}

/* v1.18.34 - periode bulan pada Tabelaris/PNG; label kosong bulan = Semua */


/* v1.18.35 — mode Perbandingan/Langsung dan tooltip titik grafik drill-down. */
.drilldown-chart-canvas-wrap { position: relative; }
.drilldown-chart-tooltip {
  position: absolute;
  z-index: 8;
  display: grid;
  gap: 2px;
  min-width: 145px;
  max-width: 210px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 53, 78, .18);
  border-radius: 9px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 24px rgba(17, 53, 78, .16);
  color: var(--navy);
  font-size: 11px;
  line-height: 1.25;
  pointer-events: none;
}
.drilldown-chart-tooltip[hidden] { display: none; }
.drilldown-chart-tooltip strong { font-size: 12px; }
.drilldown-chart-tooltip span { color: var(--muted); }
.drilldown-chart-tooltip b { color: var(--navy); }
.drilldown-chart-header-actions select { min-width: 108px; }
@media (max-width: 640px) {
  .drilldown-chart-header { display: grid; gap: 8px; }
  .drilldown-chart-header-actions { width: 100%; flex-wrap: wrap; }
  .drilldown-chart-header-actions label { flex: 1 1 120px; }
  .drilldown-chart-header-actions select { width: 100%; min-width: 0; }
}

/* v1.18.37 — Grafik drill-down: warna, Download PNG; toolbar Tabelaris tetap satu baris. */
.drilldown-chart-header {
  gap: 12px;
}
.drilldown-chart-header > div:first-child {
  min-width: 220px;
  flex: 1 1 auto;
}
.drilldown-chart-header-actions {
  flex: 0 1 auto;
  flex-wrap: nowrap !important;
  max-width: 72%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  white-space: nowrap;
}
.drilldown-chart-header-actions label,
.drilldown-chart-header-actions .btn,
.drilldown-chart-header-actions .modal-close {
  flex: 0 0 auto;
}
.drilldown-chart-header-actions select {
  min-width: 112px;
  max-width: 160px;
}
.drilldown-chart-header-actions #drilldownPalette { min-width: 142px; }
.drilldown-download-button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* Seluruh kontrol Tabelaris berada pada satu baris. Pada layar sempit baris
   tetap satu baris dan dapat digeser horizontal, bukan turun ke baris baru. */
.pivot-panel > .panel-heading {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow: visible;
}
.pivot-panel > .panel-heading > div:first-child {
  flex: 0 0 auto;
  min-width: 190px;
}
.pivot-action-row {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-basis: auto !important;
  flex-wrap: nowrap !important;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end !important;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.pivot-action-row > * {
  flex: 0 0 auto !important;
  min-width: max-content !important;
}

@media (max-width: 900px) {
  .pivot-panel > .panel-heading {
    align-items: flex-start !important;
    gap: 8px;
  }
  .pivot-panel > .panel-heading > div:first-child { min-width: 150px; }
  .pivot-action-row { justify-content: flex-start !important; }
  .drilldown-chart-header {
    display: flex !important;
    align-items: flex-start;
  }
  .drilldown-chart-header-actions {
    width: auto;
    max-width: 68%;
    flex-wrap: nowrap !important;
  }
  .drilldown-chart-header-actions label {
    flex-direction: row !important;
    align-items: center !important;
  }
  .drilldown-chart-header-actions select {
    width: auto !important;
    min-width: 105px !important;
  }
}

@media (max-width: 620px) {
  .pivot-panel > .panel-heading > div:first-child { min-width: 132px; }
  .pivot-action-row .btn,
  .pivot-action-row .pivot-detail-button { padding-left: 10px; padding-right: 10px; }
  .drilldown-chart-header { display: block !important; }
  .drilldown-chart-header-actions {
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
  }
}

/* v1.18.39 — mode Growth Aktual/Growth Realisasi pada Grafik PNBP Global. */
.chart-series-menu { width: 220px; max-height: min(310px, calc(100vh - 24px)); overflow-y: auto; }
.chart-series-section-title {
  padding: 4px 7px 3px;
  color: #6a7b87;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.chart-series-divider { height: 1px; margin: 5px 4px; background: #e1e9ef; }
.chart-growth-option input[type="radio"] { accent-color: var(--blue); }
.chart-growth-option input:disabled + span { color: #9aa8b1; }
.chart-series-multi.growth-active > summary {
  border-color: #1b8a65;
  background: #eefaf5;
  color: #116348;
}
.chart-toolbar .chart-growth-last-control { min-width: 128px; }
.chart-toolbar .chart-growth-last-control[hidden],
.chart-toolbar .chart-percentage-control[hidden] { display: none !important; }
.chart-toolbar select:disabled {
  cursor: not-allowed;
  background: #edf2f5;
  color: #51636f;
  opacity: .88;
}
.chart-legend-line {
  display: inline-block;
  width: 19px;
  height: 3px;
  border-radius: 999px;
}
.chart-series-menu .chart-growth-option[hidden],
.chart-series-menu .chart-growth-only[hidden] { display: none !important; }


/* v1.18.40 — legenda toolbar disembunyikan dan warna garis growth dapat dipilih. */
#chartLegend { display: none !important; }
.chart-toolbar .chart-growth-line-control { min-width: 124px; }
.chart-toolbar .chart-growth-line-control[hidden] { display: none !important; }

/* v1.18.41 — Detail Bulanan satu tahun + kontrol tahun/angka Grafik Realisasi. */
.monthly-detail-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #9dc8e6;
  border-radius: 8px;
  background: #eaf5fc;
  color: #17689a;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.monthly-detail-toggle:hover { background: #d9eefb; }
.monthly-detail-toggle.active {
  border-color: #176da3;
  background: #247eaf;
  color: #fff;
}
.monthly-detail-toggle[hidden] { display: none !important; }

.pivot-table.monthly-detail-mode thead tr:first-child th { top: 0; }
.pivot-table.monthly-detail-mode thead tr:nth-child(2) th { top: 27px; }
.pivot-table.monthly-detail-mode .pivot-month-header-row th,
.pivot-table.monthly-detail-mode .pivot-month-total-header {
  text-align: center;
}
.pivot-table.monthly-detail-mode tbody td:not(:first-child),
.pivot-table.monthly-detail-mode tfoot td:not(:first-child) {
  min-width: 68px;
}
.pivot-table.monthly-detail-mode th:last-child,
.pivot-table.monthly-detail-mode td:last-child {
  border-left: 2px solid #c8d8e3;
}

.drilldown-year-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #52626d;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.drilldown-year-selector { position: relative; flex: 0 0 auto; }
.drilldown-year-selector > summary {
  list-style: none;
  min-width: 112px;
  max-width: 170px;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.drilldown-year-selector > summary::-webkit-details-marker { display: none; }
.drilldown-year-selector > summary::after {
  content: '⌄';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-53%);
  color: #5e7483;
}
.drilldown-year-menu {
  z-index: 12050;
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid #cfdce5;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(22,54,75,.18);
}
.drilldown-year-selector:not([open]) .drilldown-year-menu { display: none; }
.drilldown-year-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #2f4758;
  font-size: 12px;
  cursor: pointer;
}
.drilldown-year-option:hover { background: #eef6fb; }
.drilldown-year-option input { accent-color: #1c79ad; }

@media (max-width: 760px) {
  .monthly-detail-toggle { min-height: 28px; padding: 4px 8px; }
  .drilldown-year-control { gap: 4px; }
  .drilldown-year-selector > summary { height: 31px; min-width: 102px; }
}


/* v1.18.42 — header Detail Bulanan tidak menumpuk saat scroll horizontal. */
.pivot-table.monthly-detail-mode thead .pivot-month-header-row th:first-child {
  left: auto !important;
  z-index: 7;
}
.pivot-table.monthly-detail-mode thead .pivot-month-header-row th {
  position: sticky;
}
.pivot-table.monthly-detail-mode thead .monthly-detail-year-row .pivot-uraian-header {
  left: 0;
  z-index: 11;
}

/* Mode Perbandingan mengunci Periode Bulanan secara visual. */
#drilldownGranularity:disabled {
  background: #f1f5f8;
  color: #596a75;
  cursor: not-allowed;
  opacity: .9;
}


/* v1.18.43 — header Detail Bulanan center dan konfirmasi Tahun grafik. */
.pivot-table.monthly-detail-mode thead .monthly-detail-year-row .pivot-year-group-header {
  text-align: center !important;
}
.drilldown-year-menu-actions {
  position: sticky;
  bottom: -7px;
  display: flex;
  justify-content: flex-end;
  margin: 5px -7px -7px;
  padding: 8px;
  border-top: 1px solid #dbe5ec;
  background: #fff;
}
.drilldown-year-ok {
  min-width: 62px;
  height: 30px;
  padding: 4px 14px;
  border-radius: 7px;
}

/* v1.18.44 — filter Tahun pakai OK + role dinamis */
.role-hidden { display: none !important; }
.year-multi-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
}
.year-multi-clear { width: auto; }
.year-multi-ok {
  border: 0;
  border-radius: 7px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.year-multi-ok:hover { filter: brightness(.95); }

.role-modal-card { width: min(680px, calc(100vw - 28px)); }
.role-basic-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); }
.role-permission-field { display: grid; gap: 7px; margin-top: 14px; }
.role-permission-field .field-label { font-size: 12px; font-weight: 650; color: var(--text); }
.role-permission-selector { position: relative; }
.role-permission-selector > summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  min-height: 42px;
  padding: 10px 38px 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  position: relative;
}
.role-permission-selector > summary::-webkit-details-marker { display: none; }
.role-permission-selector > summary::after {
  content: '⌄';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.role-permission-selector[open] > summary {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,110,157,.1);
}
.role-permission-menu {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16,42,61,.15);
  padding: 8px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  display: grid;
  gap: 2px;
}
.role-permission-option,
.role-permission-group-title {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.role-permission-option:hover,
.role-permission-group-title:hover { background: #f4f8fb; }
.role-permission-option.child { padding-left: 28px; }
.role-permission-option.admin-fixed { color: var(--muted); }
.role-permission-option small { font-weight: 400; color: var(--muted); }
.role-permission-group { border-top: 1px solid #edf2f5; border-bottom: 1px solid #edf2f5; padding: 3px 0; }
.role-permission-group-title { font-weight: 650; }
.role-permission-option input,
.role-permission-group-title input { width: 16px; height: 16px; margin: 0; }
.role-permission-actions { display: flex; justify-content: flex-end; padding: 8px 4px 2px; }
.role-permission-summary-cell { max-width: 520px; white-space: normal; line-height: 1.45; }
.role-table td:nth-child(2) { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

@media (max-width: 680px) {
  .role-basic-grid { grid-template-columns: 1fr; }
  .role-modal-card { width: calc(100vw - 16px); }
}


/* v1.18.45 — OK Tahun tetap terlihat + filter periode nonaktif saat Detail Bulanan. */
.pivot-filter-bar .year-multi-actions {
  position: sticky;
  top: -7px;
  z-index: 8;
  margin: -7px -7px 5px;
  padding: 7px 7px 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 3px 8px rgba(16,42,61,.06);
}
.pivot-filter-bar .monthly-filter-disabled {
  opacity: .58;
}
.pivot-filter-bar .monthly-filter-disabled select,
.pivot-filter-bar select:disabled {
  cursor: not-allowed;
  background: #eef3f6;
  color: #70818d;
  border-color: #d7e1e7;
  box-shadow: none;
}


/* v1.18.47 — restore status dan hapus file backup dari aplikasi. */
.backup-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.backup-delete-modal-card { width: min(520px, 94vw); }
.backup-delete-confirm-body { padding: 20px; color: #40525f; font-size: 13px; line-height: 1.5; }
.backup-delete-confirm-body p { margin: 0 0 8px; }
.backup-delete-confirm-body strong { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7fafc; color: var(--navy); overflow-wrap: anywhere; }

/* v1.18.48 — retensi dataset + seri grafik sebelum login. */
.dataset-retention-bar {
  margin: 0 18px 16px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  border: 1px solid #c9dce8;
  border-radius: 11px;
  background: #f7fbfe;
}
.dataset-retention-copy { display: grid; gap: 3px; min-width: 0; }
.dataset-retention-copy strong { color: var(--navy); font-size: 13px; }
.dataset-retention-copy span { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.dataset-retention-control { display: grid; grid-template-columns: 150px auto; gap: 8px; align-items: center; }
.dataset-retention-control input {
  width: 150px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #bfd2df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.dataset-retention-control .btn { min-width: 58px; min-height: 38px; }
.dataset-retention-bar > small { grid-column: 1 / -1; color: #607482; font-size: 10.5px; line-height: 1.4; }

.prelogin-chart-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}
.prelogin-chart-controls > label,
.prelogin-series-control { min-width: 0; }
.prelogin-palette-control { grid-column: span 2; }
.prelogin-series-control { display: grid; gap: 7px; }
.prelogin-series-control .field-label { font-size: 12px; font-weight: 750; color: #43515c; }
.prelogin-series-selector { position: relative; min-width: 0; }
.prelogin-series-selector > summary {
  list-style: none;
  position: relative;
  min-height: 40px;
  padding: 9px 34px 9px 11px;
  border: 1px solid #cfdbe4;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 600;
}
.prelogin-series-selector > summary::-webkit-details-marker { display: none; }
.prelogin-series-selector > summary::after {
  content: '⌄';
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-55%);
  color: var(--muted);
  font-size: 16px;
}
.prelogin-series-selector[open] > summary {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,110,157,.11);
}
.prelogin-series-menu {
  position: absolute;
  z-index: 120;
  left: 0;
  top: calc(100% + 5px);
  width: max(220px, 100%);
  padding: 8px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(16,42,61,.16);
}
.prelogin-series-menu label {
  display: grid !important;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px !important;
  padding: 8px 7px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 650 !important;
  color: var(--text) !important;
}
.prelogin-series-menu label:hover { background: #f5f9fc; }
.prelogin-series-menu input {
  width: 16px !important;
  min-height: 16px !important;
  height: 16px;
  margin: 0;
  padding: 0 !important;
  box-shadow: none !important;
}
.prelogin-series-ok { justify-self: end; min-width: 64px; margin-top: 4px; }

@media (max-width: 980px) {
  .prelogin-chart-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prelogin-palette-control { grid-column: span 1; }
}
@media (max-width: 680px) {
  .dataset-retention-bar { grid-template-columns: 1fr; margin: 0 12px 14px; }
  .dataset-retention-control { grid-template-columns: minmax(0, 1fr) auto; }
  .dataset-retention-control input { width: 100%; }
  .dataset-retention-bar > small { grid-column: auto; }
  .prelogin-chart-controls { grid-template-columns: 1fr; }
  .prelogin-series-menu { position: fixed; left: 14px; right: 14px; top: auto; width: auto; }
}
@media (max-width: 680px) {
  .prelogin-series-menu { position: absolute; left: 0; right: auto; top: calc(100% + 5px); width: 100%; }
}


/* v1.18.49 — kunci periode grafik multi-tahun + Jenis pada Detail Bulanan. */
.pivot-filter-bar .monthly-filter-disabled .year-multi-button,
.pivot-filter-bar .year-multi-button:disabled {
  cursor: not-allowed;
  background: #eef3f6;
  color: #70818d;
  border-color: #d7e1e7;
  box-shadow: none;
}
.chart-control.chart-period-locked {
  opacity: .62;
}
.chart-control.chart-period-locked select:disabled {
  cursor: not-allowed;
  background: #eef3f6;
  color: #70818d;
  border-color: #d7e1e7;
  box-shadow: none;
}


/* v1.18.51 - analisis otomatis grafik uraian Tabelaris */
.drilldown-chart-footer {
  display: block;
  width: 100%;
  margin-top: 10px;
}
.drilldown-chart-analysis {
  min-width: 0;
  border: 1px solid #d9e5ed;
  border-radius: 10px;
  background: #f8fbfd;
  padding: 9px 11px;
  color: #304653;
  box-shadow: inset 3px 0 0 rgba(43,110,157,.22);
}
.drilldown-chart-analysis-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.drilldown-chart-analysis-heading strong {
  color: var(--navy);
  font-size: 11px;
  letter-spacing: .01em;
}
.drilldown-chart-analysis-text {
  font-size: 11px;
  line-height: 1.45;
  color: #52626d;
}
.drilldown-analysis-line + .drilldown-analysis-line { margin-top: 3px; }
.drilldown-analysis-up { color: #167544; font-weight: 750; }
.drilldown-analysis-down { color: #b23a32; font-weight: 750; }
.drilldown-analysis-flat { color: #566773; font-weight: 750; }
/* v1.18.53 - proyeksi musiman + area analisis full-width */
.drilldown-chart-analysis { width: 100%; box-sizing: border-box; }

/* v1.18.52 - toggle dan metode proyeksi pada grafik uraian Tabelaris */
.drilldown-projection-control {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #52626d;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.drilldown-projection-toggle {
  min-height: 34px;
  border: 1px solid #a9bfcd;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: #1d5f89;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.drilldown-projection-toggle:hover:not(:disabled),
.drilldown-projection-toggle[aria-pressed="true"] {
  border-color: #2b6e9d;
  background: #edf6fb;
}
.drilldown-projection-toggle:disabled {
  cursor: not-allowed;
  opacity: .55;
  background: #eef3f6;
  color: #70818d;
}
#drilldownProjectionMethodWrap select { min-width: 190px; max-width: 220px; }
.drilldown-legend-projection i {
  height: 0 !important;
  background: transparent !important;
  border-top: 3px dotted currentColor;
  border-radius: 0 !important;
}
.drilldown-analysis-projection {
  margin-top: 5px !important;
  padding-top: 4px;
  border-top: 1px dashed #d8e4eb;
}
.drilldown-analysis-projection + .drilldown-analysis-projection {
  margin-top: 3px !important;
  padding-top: 0;
  border-top: 0;
}
@media (max-width: 900px) {
  .drilldown-projection-control { flex-direction: row; }
}


/* v1.18.56 - tooltip info metode proyeksi membuka ke kiri */
.drilldown-chart-footer,
.drilldown-chart-analysis,
.drilldown-chart-analysis-text {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.drilldown-chart-analysis-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.drilldown-analysis-summary {
  margin: 0;
}
.drilldown-analysis-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.drilldown-analysis-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #9cb4c3;
  border-radius: 50%;
  background: #fff;
  color: #1d5f89;
  font-size: 11px;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  cursor: help;
}
.drilldown-analysis-info em {
  font-style: italic;
  transform: translateY(-.2px);
}
.drilldown-analysis-info:hover,
.drilldown-analysis-info:focus-visible {
  outline: none;
  border-color: #2b6e9d;
  background: #edf6fb;
}
.drilldown-analysis-info-tooltip {
  position: absolute;
  z-index: 70;
  left: auto;
  right: calc(100% + 9px);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  display: none;
  width: min(430px, calc(100vw - 52px));
  padding: 10px 12px;
  border: 1px solid #cadbe5;
  border-radius: 9px;
  background: #fff;
  color: #425661;
  box-shadow: 0 10px 28px rgba(30, 58, 77, .18);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
  text-align: left;
}
.drilldown-analysis-info-tooltip > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 11px;
}
.drilldown-analysis-info-tooltip > span {
  display: block;
  margin-top: 4px;
}
.drilldown-analysis-info-wrap:hover .drilldown-analysis-info-tooltip,
.drilldown-analysis-info-wrap:focus-within .drilldown-analysis-info-tooltip {
  display: block;
}
/* Panah kecil mengarah ke tombol info. */
.drilldown-analysis-info-tooltip::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 9px;
  height: 9px;
  background: #fff;
  border-top: 1px solid #cadbe5;
  border-right: 1px solid #cadbe5;
  transform: translate(-5px, -50%) rotate(45deg);
}
@media (max-width: 700px) {
  .drilldown-analysis-info-tooltip {
    right: calc(100% + 7px);
    width: min(330px, calc(100vw - 56px));
  }
}


/* v1.18.57 - Proyeksi Realistis pada sisi kanan Tabelaris */
/* v1.18.69 - status aktif Proyeksi Realistis/Metode memakai hijau muda. */
.realistic-projection-toggle.active,
.projection-method-column-toggle.active {
  background: #dff4e6 !important;
  color: #17633a !important;
  border-color: #8fc9a5 !important;
  box-shadow: inset 0 0 0 1px rgba(57, 137, 88, .08);
}
.realistic-projection-toggle.active:hover,
.projection-method-column-toggle.active:hover {
  background: #cfeeda !important;
}
.realistic-projection-method { min-width: 190px; }
.realistic-projection-method select { min-width: 185px; }
.pivot-table .pivot-projection-group-header {
  background: #214d68;
  color: #fff;
  border-left: 2px solid rgba(255,255,255,.7);
}
.pivot-table .pivot-projection-column {
  background: #2b5d78;
  color: #fff;
  white-space: nowrap;
}
.pivot-table .projection-group-start,
.pivot-table td.realistic-projection-value {
  border-left: 2px solid #9fb5c3;
}
.pivot-table td.realistic-projection-value,
.pivot-table td.realistic-projection-remainder {
  background: #f4f8fb;
  font-weight: 700;
}
.pivot-table td.realistic-projection-method-cell {
  background: #f8fafc;
  color: #405766;
  font-size: .9em;
  text-align: center;
  white-space: nowrap;
}
.pivot-table tfoot td.realistic-projection-value,
.pivot-table tfoot td.realistic-projection-remainder,
.pivot-table tfoot td.realistic-projection-method-cell {
  background: inherit;
  color: inherit;
}
@media (max-width: 900px) {
  .realistic-projection-method { min-width: 168px; }
  .realistic-projection-method select { min-width: 162px; }
}


/* v1.18.58 - Metode proyeksi per uraian leaf */
.pivot-table td.realistic-projection-method-cell {
  min-width: 176px;
}
.realistic-projection-row-method {
  width: 100%;
  min-width: 166px;
  max-width: 210px;
  padding: 5px 24px 5px 7px;
  border: 1px solid #b7c8d3;
  border-radius: 6px;
  background: #fff;
  color: #294759;
  font: inherit;
  font-size: .92em;
  cursor: pointer;
}
.realistic-projection-row-method:focus {
  outline: 2px solid rgba(27, 111, 166, .22);
  border-color: #4785aa;
}
.pivot-table td.realistic-projection-parent-method {
  color: #6b7e89;
  font-style: italic;
  font-weight: 600;
}


/* v1.18.59 - Total Proyeksi Realistis sticky + capaian Target/Outlook */
.pivot-table tfoot td.realistic-projection-value,
.pivot-table tfoot td.realistic-projection-remainder,
.pivot-table tfoot td.realistic-projection-method-cell {
  position: sticky;
  bottom: 0;
  z-index: 8;
  background: var(--navy) !important;
  color: #fff !important;
  font-weight: 800;
}
.pivot-table tfoot td.realistic-projection-value { border-left: 2px solid rgba(255,255,255,.68); }
.pivot-table tfoot td.realistic-projection-method-cell.realistic-projection-total-achievement {
  min-width: 210px;
  white-space: normal;
  text-align: center;
  font-style: normal;
  line-height: 1.35;
  font-size: .86em;
}
.pivot-table tfoot td.realistic-projection-total-achievement > div + div { margin-top: 2px; }

/* v1.18.61 - Nilai proyeksi pada Detail Bulanan */
.monthly-projection-value-control {
  flex: 0 0 auto;
  min-width: 138px;
}
.monthly-projection-value-control > span {
  white-space: nowrap;
}
.monthly-projection-value-control select {
  min-width: 72px;
  font-weight: 700;
}
.monthly-projection-value-control[hidden] { display: none !important; }

.pivot-table.monthly-detail-mode td.monthly-projection-cell {
  background: #fff0eb !important;
  color: #c84d32 !important;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(231, 115, 79, .08);
}
.pivot-table.monthly-detail-mode tbody tr:hover td.monthly-projection-cell {
  background: #ffe6de !important;
}
.pivot-table.monthly-detail-mode td.monthly-projection-total {
  color: #c84d32;
  font-weight: 800;
  background: #fff7f3;
}
.pivot-table.monthly-detail-mode tfoot td.monthly-projection-cell,
.pivot-table.monthly-detail-mode tfoot td.monthly-projection-total {
  background: #8f3d2e !important;
  color: #fff !important;
}
@media (max-width: 1100px) {
  .monthly-projection-value-control { min-width: 120px; }
  .monthly-projection-value-control > span { font-size: 9px; }
}


/* v1.18.62 - Proyeksi Realistis tetap terlihat pada Detail Bulanan */
.pivot-table.monthly-detail-mode.monthly-projection-side-active .pivot-projection-group-header {
  border-left: 2px solid rgba(255,255,255,.7);
}
.pivot-table.monthly-detail-mode.monthly-projection-side-active td.realistic-projection-value {
  border-left: 2px solid #9fb5c3;
}


/* v1.18.63 - kolom Total Realistis di Detail Bulanan disembunyikan saat panel proyeksi aktif; nama kolom pertama panel diperjelas menjadi Total Proyeksi Realistis. */
\n\n/* v1.18.69 - grup Proyeksi Realistis dikunci di sisi kanan saat scroll horizontal. */
.pivot-table.projection-side-sticky {
  --projection-total-width: 112px;
  --projection-remainder-width: 112px;
  --projection-method-width: 0px;
}

/* Header grup paling atas ikut tetap di sisi kanan sebagai satu blok. */
.pivot-table.projection-side-sticky thead .pivot-projection-group-header {
  position: sticky;
  right: 0;
  z-index: 15;
  background: #214d68 !important;
  box-shadow: -2px 0 0 #9fb5c3;
}

/* Kolom paling kanan: Metode Proyeksi (jika ditampilkan). */
.pivot-table.projection-side-sticky.projection-method-visible thead .pivot-projection-method-header,
.pivot-table.projection-side-sticky.projection-method-visible tbody td.realistic-projection-method-cell,
.pivot-table.projection-side-sticky.projection-method-visible tfoot td.realistic-projection-method-cell {
  position: sticky;
  right: 0;
  z-index: 11;
}
.pivot-table.projection-side-sticky.projection-method-visible thead .pivot-projection-method-header {
  z-index: 16;
  background: #2b5d78 !important;
}
.pivot-table.projection-side-sticky.projection-method-visible tbody td.realistic-projection-method-cell {
  background: #f8fafc !important;
}

/* Sisa Proyeksi berada tepat di kiri Metode; bila Metode hidden maka menempel ke kanan. */
.pivot-table.projection-side-sticky thead .pivot-projection-remainder-header,
.pivot-table.projection-side-sticky tbody td.realistic-projection-remainder,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-remainder {
  position: sticky;
  right: var(--projection-method-width);
  z-index: 10;
}
.pivot-table.projection-side-sticky thead .pivot-projection-remainder-header {
  z-index: 15;
  background: #2b5d78 !important;
}
.pivot-table.projection-side-sticky tbody td.realistic-projection-remainder {
  background: #f4f8fb !important;
}

/* Total Proyeksi Realistis menjadi sisi kiri dari blok sticky. */
.pivot-table.projection-side-sticky thead .pivot-projection-total-header,
.pivot-table.projection-side-sticky tbody td.realistic-projection-value,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-value {
  position: sticky;
  right: calc(var(--projection-remainder-width) + var(--projection-method-width));
  z-index: 10;
  box-shadow: -2px 0 0 #9fb5c3;
}
.pivot-table.projection-side-sticky thead .pivot-projection-total-header {
  z-index: 15;
  background: #2b5d78 !important;
}
.pivot-table.projection-side-sticky tbody td.realistic-projection-value {
  background: #f4f8fb !important;
}

/* Footer tetap sticky bawah sekaligus sticky kanan. */
.pivot-table.projection-side-sticky tfoot td.realistic-projection-value,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-remainder,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-method-cell {
  z-index: 18;
  background: var(--navy) !important;
  color: #fff !important;
}

/* v1.18.70 - header Proyeksi Realistis sticky vertikal + horizontal.
   Semua mode dengan panel proyeksi memakai dua baris header. Baris kedua
   dikunci tepat di bawah baris pertama agar tidak ikut bergerak saat scroll Y. */
.pivot-table.projection-side-sticky thead tr:first-child th {
  position: sticky;
  top: 0;
}
.pivot-table.projection-side-sticky thead tr:nth-child(2) th {
  position: sticky;
  top: 27px;
}

/* Mode sederhana (satu jenis) sebelumnya belum punya tinggi header bertingkat
   yang eksplisit. Samakan dengan mode matrix/detail-bulanan. */
.pivot-table.projection-side-sticky thead .pivot-projection-simple-header th {
  height: 27px;
  padding-top: 3px;
  padding-bottom: 3px;
  vertical-align: middle;
}
.pivot-table.projection-side-sticky thead .pivot-projection-simple-header + tr th {
  height: 25px;
  padding-top: 2px;
  padding-bottom: 2px;
  vertical-align: middle;
}

/* Grup proyeksi harus menempel pada dua sumbu sekaligus. */
.pivot-table.projection-side-sticky thead .pivot-projection-group-header {
  top: 0 !important;
  right: 0;
  z-index: 30 !important;
  background: #214d68 !important;
}
.pivot-table.projection-side-sticky thead .pivot-projection-total-header,
.pivot-table.projection-side-sticky thead .pivot-projection-remainder-header,
.pivot-table.projection-side-sticky thead .pivot-projection-method-header {
  top: 27px !important;
  z-index: 29 !important;
  background: #2b5d78 !important;
}

/* Pertahankan kolom Uraian di lapisan teratas pada perpotongan sticky X/Y. */
.pivot-table.projection-side-sticky thead .pivot-uraian-header {
  top: 0 !important;
  z-index: 31 !important;
}


/* v1.18.71 - Proyeksi Realistis hanya sticky vertikal; scroll horizontal mengikuti tabel. */
/* Status aktif dibuat lebih terang agar langsung terlihat. */
.realistic-projection-toggle.active,
.projection-method-column-toggle.active {
  background: #86efac !important;
  color: #064e3b !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .22), 0 0 12px rgba(34, 197, 94, .20) !important;
  font-weight: 800;
}
.realistic-projection-toggle.active:hover,
.projection-method-column-toggle.active:hover {
  background: #6ee7a0 !important;
  border-color: #16a34a !important;
}

/* Batalkan freeze horizontal v1.18.69, tetapi pertahankan sticky vertikal header. */
.pivot-table.projection-side-sticky thead .pivot-projection-group-header {
  right: auto !important;
  box-shadow: none !important;
}
.pivot-table.projection-side-sticky thead .pivot-projection-total-header,
.pivot-table.projection-side-sticky thead .pivot-projection-remainder-header,
.pivot-table.projection-side-sticky thead .pivot-projection-method-header {
  right: auto !important;
}
.pivot-table.projection-side-sticky tbody td.realistic-projection-value,
.pivot-table.projection-side-sticky tbody td.realistic-projection-remainder,
.pivot-table.projection-side-sticky tbody td.realistic-projection-method-cell {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
}
.pivot-table.projection-side-sticky tfoot td.realistic-projection-value,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-remainder,
.pivot-table.projection-side-sticky tfoot td.realistic-projection-method-cell {
  right: auto !important;
}

/* v1.18.72 - baris Tabelaris tetap padat meskipun kolom Metode Proyeksi ditampilkan. */
/* Dropdown metode sebelumnya mempunyai padding vertikal 5px sehingga tinggi seluruh
   baris mengikuti tinggi select. Buat kontrol setinggi baris tabel, bukan sebaliknya. */
.pivot-table td.realistic-projection-method-cell {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  vertical-align: middle;
}
.realistic-projection-row-method {
  height: 21px;
  min-height: 21px;
  padding: 0 22px 0 6px;
  border-radius: 4px;
  line-height: 19px;
  font-size: 10.5px;
}

/* Saat Metode Proyeksi terlihat, seluruh body tetap memakai ritme baris kompak
   yang sama seperti mode tanpa metode. */
.pivot-table.projection-method-visible tbody td {
  height: 23px;
  padding-top: 1px !important;
  padding-bottom: 1px !important;
  line-height: 1.05;
  vertical-align: middle;
}
.pivot-table.projection-method-visible .tree-label,
.pivot-table.projection-method-visible .tree-label-fixed {
  min-height: 14px;
}
.pivot-table.projection-method-visible .tree-text {
  line-height: 1.05;
}

/* Parent dan sel angka proyeksi tidak menambah tinggi sendiri. */
.pivot-table.projection-method-visible td.realistic-projection-value,
.pivot-table.projection-method-visible td.realistic-projection-remainder,
.pivot-table.projection-method-visible td.realistic-projection-parent-method {
  padding-top: 1px !important;
  padding-bottom: 1px !important;
}

/* v1.18.74 - Model Khusus Batubara, editor mini-Excel khusus Administrator. */
.special-model-panel { min-height: calc(100vh - 150px); }
.special-model-security-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.45;
}
.special-model-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.special-model-summary-card {
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}
.special-model-summary-card span { font-size: 11px; color: #64748b; }
.special-model-summary-card strong { font-size: 15px; color: #17212b; }
.special-model-summary-card.total { background: #f0fdf4; border-color: #86efac; }
.special-model-summary-card.total strong { color: #166534; }
.special-model-main-tabs,
.special-model-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.special-model-main-tabs { margin-bottom: 10px; }
.special-model-main-tab,
.special-model-subtab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.special-model-main-tab.active,
.special-model-subtab.active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1d4ed8;
}
.special-model-workbench {
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.special-model-workbench-head {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.special-model-workbench-head h3 { margin: 0 0 2px; }
.special-model-workbench-head p { margin: 0; font-size: 11px; color: #64748b; }
.special-model-upload-hint {
  padding: 8px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fffbeb;
  color: #7c5b08;
  font-size: 11px;
}
.special-model-subtabs { padding: 10px 14px 0; }
.special-model-sheet-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 220px) minmax(150px, 1fr) minmax(90px, 120px);
  gap: 10px;
  align-items: end;
  padding: 10px 14px;
}
.special-model-sheet-toolbar > div,
.special-model-output-control { display: grid; gap: 4px; }
.special-model-sheet-toolbar span,
.special-model-output-control span { font-size: 10px; color: #64748b; }
.special-model-sheet-toolbar strong { font-size: 12px; color: #17212b; }
.special-model-output-control input,
.special-model-formula-bar input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  background: #fff;
}
.special-model-formula-bar {
  display: grid;
  grid-template-columns: 32px minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid #eef2f7;
  border-bottom: 1px solid #dbe3ec;
  background: #f8fafc;
}
.special-model-fx {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 6px;
  background: #e2e8f0;
  font-weight: 800;
  font-style: italic;
  color: #334155;
}
.special-model-grid-wrap {
  overflow: auto;
  max-height: 56vh;
  min-height: 280px;
  background: #fff;
}
.special-model-grid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  table-layout: fixed;
  font-size: 11px;
}
.special-model-grid th,
.special-model-grid td {
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0;
  height: 25px;
  min-width: 96px;
  background: #fff;
}
.special-model-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  min-width: 96px;
  background: #f1f5f9;
  text-align: center;
  font-weight: 700;
  color: #475569;
}
.special-model-grid .model-row-number {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  background: #f1f5f9;
  text-align: center;
  color: #64748b;
  font-weight: 700;
}
.special-model-grid thead .model-row-number { z-index: 4; }
.special-model-grid input.model-cell-input {
  display: block;
  width: 100%;
  height: 24px;
  border: 0;
  outline: 0;
  padding: 2px 5px;
  background: transparent;
  font: inherit;
  color: #17212b;
}
.special-model-grid input.model-cell-input:focus {
  box-shadow: inset 0 0 0 2px #2563eb;
  background: #eff6ff;
}
.special-model-grid input.model-cell-input.formula-cell { color: #7c3aed; }
.special-model-grid td.output-cell { background: #ecfdf5; }
.special-model-grid td.output-cell input { font-weight: 800; color: #166534; }
.special-model-formula-note {
  margin: 0;
  padding: 8px 14px 12px;
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.4;
}
@media (max-width: 1000px) {
  .special-model-summary { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .special-model-sheet-toolbar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .special-model-workbench-head { align-items: flex-start; flex-direction: column; }
}

/* v1.18.75 - Asumsi Batubara + editor range multi-cell. */
.special-model-summary-batubara {
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  align-items: stretch;
}
.special-model-summary-card.assumption {
  cursor: text;
}
.special-model-summary-card.assumption input {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
  background: #fff;
  color: #17212b;
}
.special-model-summary-card.assumption input:focus {
  outline: 0;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,.16);
}
.special-model-summary-card.assumption small {
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
}
.special-model-summary-card.total .btn {
  justify-self: start;
  margin-top: 2px;
}
.special-model-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px 14px;
  border-bottom: 1px solid #dbe3ec;
  background: #f8fafc;
}
.special-model-selection-info {
  min-width: 110px;
  font-size: 11px;
  color: #475569;
}
.special-model-selection-info strong { color: #17212b; }
.special-model-selection-hint {
  margin-left: auto;
  font-size: 10px;
  color: #64748b;
}
.special-model-grid td.model-cell-selected {
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px #60a5fa;
}
.special-model-grid td.model-cell-selected input.model-cell-input {
  background: rgba(219,234,254,.68);
}
.special-model-grid td.model-cell-anchor {
  box-shadow: inset 0 0 0 2px #2563eb;
}
.special-model-grid tr.model-row-selected > .model-row-number {
  background: #dbeafe;
  color: #1d4ed8;
}
@media (max-width: 1350px) {
  .special-model-summary-batubara { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .special-model-summary-batubara { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .special-model-selection-hint { width: 100%; margin-left: 0; }
}

/* v1.18.76 - Output Model Batubara dipisah menjadi Royalti dan PHT. */
.special-model-summary-batubara {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
}
.special-model-summary-card.pht {
  background: #eff6ff;
  border-color: #93c5fd;
}
.special-model-summary-card.pht strong { color: #1d4ed8; }
.special-model-summary-card.action-card {
  align-content: center;
  background: #f8fafc;
}
.special-model-summary-card.action-card .btn {
  justify-self: start;
  margin-top: 2px;
}
.special-model-sheet-toolbar-dual-output {
  grid-template-columns: minmax(120px, .75fr) minmax(390px, 2.5fr) minmax(90px, .65fr);
  align-items: start;
}
.special-model-output-pair {
  display: grid !important;
  gap: 7px !important;
}
.special-model-output-row {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(160px, 1fr);
  gap: 10px;
  align-items: end;
}
.special-model-output-value {
  display: grid;
  gap: 4px;
  min-height: 48px;
  align-content: end;
  padding: 4px 9px 6px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #f8fafc;
}
.special-model-output-value strong {
  font-size: 13px;
  color: #17212b;
}
.special-model-grid td.royalty-output-cell {
  background: #ecfdf5;
}
.special-model-grid td.royalty-output-cell input { color: #166534; }
.special-model-grid td.pht-output-cell {
  background: #eff6ff;
}
.special-model-grid td.pht-output-cell input { color: #1d4ed8; }
@media (max-width: 1200px) {
  .special-model-summary-batubara { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .special-model-sheet-toolbar-dual-output { grid-template-columns: 1fr; }
  .special-model-output-row { grid-template-columns: minmax(160px, 220px) minmax(150px, 1fr); }
}
@media (max-width: 760px) {
  .special-model-summary-batubara { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .special-model-output-row { grid-template-columns: 1fr; }
}

/* v1.18.77 - tab jenis Model Khusus dan editor Proyeksi Manual. */
.special-model-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 4px;
}
.special-model-type-tab {
  border: 1px solid #bfd3e3;
  background: #f7fbfe;
  color: #173b57;
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 700;
  cursor: pointer;
}
.special-model-type-tab:hover { background: #edf7fd; }
.special-model-type-tab.active {
  background: #dff7e7;
  border-color: #55c878;
  color: #0c5d2a;
  box-shadow: 0 0 0 2px rgba(85, 200, 120, .14);
}
.special-model-coming-soon {
  margin: 14px 16px 18px;
  padding: 20px;
  border: 1px dashed #b8cbd9;
  border-radius: 12px;
  background: #f9fbfd;
  color: #4b6475;
}
.special-model-coming-soon strong {
  display: block;
  margin-bottom: 6px;
  color: #173b57;
  font-size: 17px;
}

.manual-projection-backdrop {
  z-index: 1300;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.manual-projection-card {
  width: min(720px, calc(100vw - 28px));
  max-height: min(82vh, 760px);
  overflow: auto;
  padding: 0;
}
.manual-projection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px 12px;
  border-bottom: 1px solid #d9e4ec;
}
.manual-projection-head h3 { margin: 0 0 4px; }
.manual-projection-head p { margin: 0; color: #60717d; font-size: 13px; }
.manual-projection-note {
  margin: 12px 18px 4px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #eef7ff;
  border: 1px solid #c9e2f7;
  color: #24506d;
  font-size: 12px;
}
.manual-projection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}
.manual-projection-month {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #d7e2e9;
  border-radius: 9px;
  background: #fff;
}
.manual-projection-month span { font-weight: 700; color: #29485f; }
.manual-projection-month input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #b9ccd9;
  border-radius: 7px;
  text-align: right;
}
.manual-projection-month input:focus {
  border-color: #4ca971;
  box-shadow: 0 0 0 2px rgba(76, 169, 113, .14);
  outline: 0;
}
.manual-projection-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid #d9e4ec;
}
#manualProjectionSaveStatus { color: #2d6b45; font-size: 12px; font-weight: 700; }
.realistic-projection-method-manual-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.realistic-projection-method-manual-wrap select { min-width: 0; flex: 1 1 auto; }
.realistic-projection-manual-edit {
  flex: 0 0 auto;
  border: 1px solid #62b77d;
  background: #e6f8ec;
  color: #145c2d;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.realistic-projection-manual-edit:hover { background: #c9f0d6; }
@media (max-width: 620px) {
  .manual-projection-grid { grid-template-columns: 1fr; }
  .manual-projection-month { grid-template-columns: 95px minmax(0, 1fr); }
}

/* v1.18.78 - pengaturan aktif/nonaktif dan nilai kurs per Model Khusus. */
.special-model-config-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid #cbd9e8;
  border-radius: 10px;
  background: #f8fbff;
}
.special-model-config-field {
  display: grid;
  gap: 5px;
  min-width: 150px;
  font-size: 12px;
  color: #415b73;
}
.special-model-config-field.exchange-rate { min-width: 220px; }
.special-model-config-field select,
.special-model-config-field input {
  height: 36px;
  border: 1px solid #bfd0df;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  color: #0d2740;
}
.special-model-config-bar.model-enabled {
  border-color: #83d89e;
  background: #effcf3;
}
.special-model-config-status {
  min-height: 18px;
  padding-bottom: 7px;
  font-size: 12px;
  color: #4f667a;
}
@media (max-width: 720px) {
  .special-model-config-field,
  .special-model-config-field.exchange-rate { min-width: 100%; }
  .special-model-config-bar .btn { width: 100%; }
}

/* v1.18.79 - Model Khusus generik: konfigurasi uraian, asumsi/output dinamis, mini-Excel berformat. */
.generic-special-model-panel { overflow: visible; }
.special-model-section-card {
  margin: 12px 0;
  border: 1px solid #d7e2ea;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.special-model-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #e0e8ef;
  background: #f8fbfd;
}
.special-model-section-head h3 { margin: 0 0 3px; font-size: 15px; }
.special-model-section-head p { margin: 0; color: #63788a; font-size: 11px; }
.special-model-total-switch {
  display: grid;
  gap: 4px;
  min-width: 235px;
  font-size: 12px;
  color: #415b73;
}
.special-model-total-switch select {
  height: 36px;
  border: 1px solid #bfd0df;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}
.special-model-total-switch small { color: #6b7f90; }
.special-model-uraian-box { border-top: 1px solid #e4ebf1; }
.special-model-uraian-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 14px;
  background: #fbfdff;
}
.special-model-uraian-toolbar strong { margin-right: 4px; }
.special-model-uraian-toolbar input {
  width: min(360px, 100%);
  min-width: 190px;
  height: 34px;
  border: 1px solid #c6d5e1;
  border-radius: 8px;
  padding: 0 10px;
}
.special-model-uraian-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  max-height: 250px;
  overflow: auto;
  padding: 10px 14px 12px;
}
.special-model-uraian-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #e2e9ef;
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
  line-height: 1.35;
}
.special-model-uraian-item input { margin-top: 2px; }
.special-model-uraian-item span { min-width: 0; overflow-wrap: anywhere; }
.special-model-admin-table-wrap { border: 0; margin: 0; }
.special-model-admin-table { min-width: 760px; }
.special-model-admin-table th,
.special-model-admin-table td { padding: 7px 9px; vertical-align: middle; }
.special-model-admin-table input[type="text"],
.special-model-admin-table input[type="number"],
.special-model-admin-table select {
  width: 100%;
  min-width: 100px;
  height: 32px;
  border: 1px solid #c6d5e1;
  border-radius: 7px;
  padding: 0 8px;
  font: inherit;
}
.special-model-admin-table .model-output-nominal { font-weight: 800; color: #173b57; white-space: nowrap; }
.special-model-section-actions { display: flex; justify-content: flex-end; padding: 9px 14px 12px; border-top: 1px solid #e4ebf1; }
.generic-model-toolbar-top { grid-template-columns: 1fr 150px 180px; }
.generic-format-toolbar { gap: 8px; }
.model-color-control,
.model-column-width-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #435b6d;
}
.model-color-control input[type="color"] {
  width: 34px;
  height: 28px;
  padding: 1px;
  border: 1px solid #c3d1dc;
  border-radius: 5px;
  background: #fff;
}
.model-column-width-control input {
  width: 72px;
  height: 29px;
  border: 1px solid #c3d1dc;
  border-radius: 6px;
  padding: 0 6px;
}
.model-format-toggle.active { background: #dbeafe; border-color: #60a5fa; color: #1d4ed8; }
.generic-model-grid th.model-column-header { position: sticky; top: 0; user-select: none; }
.generic-model-grid .model-column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.generic-model-grid td.model-cell-selected { outline: 1px solid #60a5fa; outline-offset: -1px; }
.generic-model-grid td.model-cell-anchor { outline: 2px solid #2563eb; outline-offset: -2px; }
.generic-model-grid input.model-cell-input { font-weight: inherit; color: inherit; }
.special-model-projection-assumption-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d7e2e9;
  border-radius: 9px;
}
.special-model-projection-assumption-row label { font-weight: 700; color: #29485f; }
.special-model-projection-assumption-row input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #b9ccd9;
  border-radius: 7px;
  text-align: right;
}
.realistic-projection-special-model-edit {
  flex: 0 0 auto;
  border: 1px solid #55a974;
  background: #e5f7eb;
  color: #145c2d;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.realistic-projection-special-model-edit:hover { background: #c8efd4; }
@media (max-width: 900px) {
  .special-model-uraian-list { grid-template-columns: 1fr; }
  .generic-model-toolbar-top { grid-template-columns: 1fr; }
}

/* v1.18.80 — Model Khusus: tata letak simetris, modal proyeksi aman di fullscreen,
   dan kontrol jumlah baris mini-Excel. */
.special-model-config-bar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: end;
  gap: 12px 14px;
}
.special-model-config-field,
.special-model-total-switch {
  width: 100%;
  min-width: 0 !important;
  align-self: stretch;
}
.special-model-config-field select,
.special-model-total-switch select {
  width: 100%;
  height: 36px;
}
.special-model-config-status {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 0;
}
.model-row-count-control,
.model-decimal-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #435b6d;
}
.model-row-count-control input,
.model-decimal-control select {
  width: 78px;
  height: 29px;
  border: 1px solid #c3d1dc;
  border-radius: 6px;
  padding: 0 6px;
}
/* Modal yang dipindahkan ke dalam pivot fullscreen harus selalu berada di atas tabel. */
.pivot-panel:fullscreen > .manual-projection-backdrop,
.pivot-panel.is-fullscreen > .manual-projection-backdrop,
.pivot-panel.fullscreen-fallback > .manual-projection-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9000 !important;
}
@media (max-width: 720px) {
  .special-model-config-bar { grid-template-columns: 1fr; }
  .special-model-config-status { grid-column: 1; }
}

/* v1.18.81 — modal metode proyeksi selalu di atas grafik drilldown + pengaturan model 3 kolom. */
.manual-projection-backdrop {
  z-index: 11000 !important;
}
.pivot-panel:fullscreen > .manual-projection-backdrop,
.pivot-panel.is-fullscreen > .manual-projection-backdrop,
.pivot-panel.fullscreen-fallback > .manual-projection-backdrop {
  z-index: 11000 !important;
}
.special-model-config-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  align-items: start;
  gap: 12px;
}
.special-model-config-field {
  width: 100%;
  min-width: 0 !important;
}
.special-model-config-field small {
  min-height: 14px;
  color: #667b8d;
  font-size: 10px;
  line-height: 1.25;
}
.special-model-projection-distribution {
  padding: 14px 18px 4px;
}
.special-model-projection-distribution label {
  display: grid;
  gap: 6px;
  color: #40596c;
  font-size: 12px;
  font-weight: 700;
}
.special-model-projection-distribution select {
  width: 100%;
  height: 38px;
  border: 1px solid #bfd0df;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: #0d2740;
  font: inherit;
}
.drilldown-projection-method-group {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
}
.drilldown-projection-method-group[hidden] { display: none !important; }
.drilldown-projection-method-group > label {
  margin: 0;
}
#drilldownProjectionMethodEdit {
  height: 34px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .special-model-config-bar { grid-template-columns: 1fr; }
}

/* v1.18.82 - Model Tunggal/Gabungan */
.special-model-tabs-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}.special-model-tabs-toolbar .special-model-type-tabs{flex:1;min-width:0}.special-model-management-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.special-model-combined-info{background:#f8fbff}.special-model-combined-components{display:flex;flex-wrap:wrap;gap:8px}.special-model-combined-chip{display:inline-flex;align-items:center;padding:7px 10px;border:1px solid #c9dced;border-radius:999px;background:#fff;font-weight:700;color:#204866}.special-model-create-card{width:min(680px,calc(100vw - 32px));max-height:min(86vh,760px);overflow:auto}.special-model-create-form{padding:18px}.special-model-create-components{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px;border:1px solid #d7e2eb;border-radius:10px;background:#f8fbfd;max-height:280px;overflow:auto}.special-model-create-components label{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#fff;border:1px solid #e1e9ef;border-radius:8px;font-weight:700}.special-model-admin-table input#specialModelTotalFormulaName{width:100%;min-width:150px}.special-model-combined-formula{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.special-model-admin-table th:nth-child(1){min-width:190px}.special-model-admin-table th:nth-child(2){min-width:170px}.special-model-admin-table th:nth-child(3){min-width:220px}.special-model-admin-table th:nth-child(4){min-width:130px}.special-model-admin-table th:nth-child(5){width:90px}@media(max-width:760px){.special-model-create-components{grid-template-columns:1fr}.special-model-management-actions{width:100%}.special-model-management-actions .btn{flex:1 1 140px}}

/* v1.18.82 — Model Tunggal/Gabungan dan Nama Rumus antarmodel. */
.special-model-output-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.special-model-config-bar.combined-model{grid-template-columns:repeat(5,minmax(175px,1fr))}
.special-model-combined-info .settings-note{margin:8px 14px 14px}
@media(max-width:1100px){.special-model-config-bar.combined-model{grid-template-columns:repeat(2,minmax(220px,1fr))}}
@media(max-width:720px){.special-model-config-bar.combined-model{grid-template-columns:1fr}.special-model-output-actions{width:100%;justify-content:stretch}.special-model-output-actions .btn{flex:1}}


/* v1.18.86 - perapihan tombol Atur, grid Proyeksi Realistis, dan warna parent. */
/* Tombol konfigurasi Manual/Model selalu berada di ujung kanan sel metode. */
.realistic-projection-method-manual-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  width: 100%;
}
.realistic-projection-method-manual-wrap > .realistic-projection-row-method {
  width: 100%;
  min-width: 0;
  max-width: none;
}
.realistic-projection-method-manual-wrap > .realistic-projection-manual-edit,
.realistic-projection-method-manual-wrap > .realistic-projection-special-model-edit {
  justify-self: end;
  margin-left: 0;
  white-space: nowrap;
}

/* Tidak menambah border kiri baru: border kanan kolom sebelumnya sudah menjadi
   garis pemisah 1px yang sama dengan seluruh grid tabel. */
.pivot-table .pivot-projection-group-header,
.pivot-table .projection-group-start,
.pivot-table td.realistic-projection-value,
.pivot-table.monthly-detail-mode.monthly-projection-side-active .pivot-projection-group-header,
.pivot-table.monthly-detail-mode.monthly-projection-side-active td.realistic-projection-value,
.pivot-table tfoot td.realistic-projection-value {
  border-left: 0 !important;
  box-shadow: none !important;
}

/* Warna baris parent level utama diteruskan sampai seluruh blok Proyeksi Realistis. */
.pivot-table tbody tr.level-0 td.realistic-projection-value,
.pivot-table tbody tr.level-0 td.realistic-projection-remainder,
.pivot-table tbody tr.level-0 td.realistic-projection-method-cell {
  background: #eaf3f9 !important;
}
.pivot-table tbody tr.level-0:hover td.realistic-projection-value,
.pivot-table tbody tr.level-0:hover td.realistic-projection-remainder,
.pivot-table tbody tr.level-0:hover td.realistic-projection-method-cell {
  background: #dcecf6 !important;
}


/* v1.18.91 — pengaturan urutan/nama tampilan asumsi Model Gabungan. */
.special-model-projection-layout-box{margin-top:12px;padding:12px;border:1px solid #c9dced;border-radius:10px;background:#f8fbfe}
.special-model-projection-layout-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.special-model-projection-layout-head p{margin:4px 0 0;color:#5d7286;font-size:12px;line-height:1.45;max-width:760px}
.special-model-projection-layout-list{display:grid;gap:7px}
.special-model-projection-layout-row{display:grid;grid-template-columns:42px minmax(220px,1fr) minmax(180px,1fr);gap:8px;align-items:center;padding:7px 9px;border:1px solid #d7e4ef;border-radius:8px;background:#fff}
.special-model-projection-layout-row.is-selected{border-color:#7bc99a;background:#f1fff6}
.special-model-projection-layout-check{display:flex;align-items:center;justify-content:center;gap:5px;font-weight:700}
.special-model-projection-layout-source{min-width:0;font-size:13px}
.special-model-projection-layout-source small{display:block;color:#6b7e90;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.special-model-projection-layout-alias input{width:100%;min-width:0}
.special-model-projection-layout-empty{padding:10px;color:#687d8e;border:1px dashed #c7d7e4;border-radius:8px;background:#fff}
@media(max-width:760px){.special-model-projection-layout-row{grid-template-columns:42px 1fr}.special-model-projection-layout-alias{grid-column:1/-1}.special-model-projection-layout-head{flex-direction:column}}
