:root {
  --navy: #082c63;
  --navy-deep: #031b3f;
  --ink: #10233f;
  --muted: #667085;
  --line: #263d5d;
  --header-height: 50px;
  --scrollbar-clearance: 26px;
  --matrix-head-height: clamp(86px, 11vh, 108px);
  --matrix-score-height: clamp(40px, 5vh, 52px);
  /* 21 baris indikator IDEAL harus muat persis di 1 layar (halaman 1). */
  --matrix-rows: 21;
  --matrix-row-height: clamp(24px, calc((100vh - var(--header-height) - var(--matrix-head-height) - var(--matrix-score-height) - var(--scrollbar-clearance)) / var(--matrix-rows)), 64px);
  --sticky-dimension: 76px;
  --sticky-indicator: 144px;
  --bank-column: 130px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  overflow: hidden;
  background: #eef2f7;
  color: var(--ink);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button { font: inherit; }

.report-header {
  position: relative;
  width: 100%;
  height: var(--header-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid #d7dee8;
  color: var(--ink);
}
.report-header-nav {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.color-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #98a2b3;
  background: #f9fafb;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.color-toggle:hover,
.color-toggle:focus-visible {
  background: #f2f4f7;
  border-color: #d0d5dd;
  outline: none;
}
.color-toggle[aria-checked="true"] {
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 30%, #48dbfb 65%, #1dd1a1 100%);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.color-toggle[aria-checked="true"]:hover,
.color-toggle[aria-checked="true"]:focus-visible {
  opacity: .92;
}
.color-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.watch-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.watch-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #98a2b3;
  background: #f9fafb;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.watch-toggle:hover,
.watch-toggle:focus-visible {
  background: #f2f4f7;
  border-color: #d0d5dd;
  outline: none;
}
.watch-toggle[aria-expanded="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}
.watch-toggle.is-active {
  color: #fff;
  background: #16844b;
  border-color: #16844b;
}
.watch-toggle.is-active:hover,
.watch-toggle.is-active:focus-visible {
  background: #116b3b;
}
.watch-toggle svg {
  display: block;
  width: 18px;
  height: 18px;
}

.watch-field { position: relative; display: flex; align-items: center; gap: 6px; }
.watch-field[hidden] { display: none; }
.watch-input-wrap { position: relative; display: flex; align-items: center; }
.watch-input { width: 180px; padding: 6px 28px 6px 9px; border: 1px solid #cbd6e4; border-radius: 6px; font-size: 12px; }
.watch-input:focus { outline: 2px solid rgba(8,44,99,.25); border-color: var(--navy); }
.watch-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; display: grid; place-items: center; padding: 0; color: #fff; background: #d21f32; border: 0; border-radius: 4px; font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; }
.watch-clear:hover,
.watch-clear:focus-visible { background: #b51b2a; outline: none; }
.watch-suggestions { position: absolute; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; max-height: 220px; overflow: auto; list-style: none; background: #fff; border: 1px solid #cbd6e4; border-radius: 6px; box-shadow: 0 10px 25px rgba(3,27,63,.14); z-index: 500; }
.watch-suggestions[hidden] { display: none; }
.watch-suggestions li { padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; color: #344054; }
.watch-suggestions li:hover,
.watch-suggestions li[aria-selected="true"] { background: #edf3fa; }
.watch-suggestions li strong { color: var(--navy-deep); }
.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Multi-select dropdown */
.ms { position: relative; }
.ms-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(3,27,63,.05);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ms-btn:hover { border-color: #b9c6d8; }
.ms-btn:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(8,44,99,.15); }
.ms-btn-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ms-btn-value { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--navy-deep); }
.ms-chevron { flex: none; color: #98a2b3; transition: transform .15s ease; }
.ms.is-open .ms-chevron { transform: rotate(180deg); }
.ms.is-active .ms-btn { border-color: var(--navy); background: #f5f8fd; box-shadow: inset 0 0 0 1px var(--navy); }
.ms.is-active .ms-btn-value { color: var(--navy); }
.ms-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 520;
  width: 264px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(3,27,63,.18), 0 4px 12px rgba(3,27,63,.08);
}
.ms-search {
  width: 100%;
  margin-bottom: 6px;
  padding: 7px 9px;
  border: 1px solid #d7dee8;
  border-radius: 7px;
  font-size: 12px;
}
.ms-search:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(8,44,99,.12); }
.ms-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 2px;
}
.ms-actions button {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ms-actions button:hover { background: #edf3fa; }
.ms-hint { color: #98a2b3; font-size: 10px; margin-left: auto; }
.ms-x {
  flex: none;
  width: 24px;
  height: 24px;
  margin-left: 8px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #5c6c86;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.ms-x:hover,
.ms-x:focus-visible { background: #d21f32; color: #fff; outline: none; }
.ms-list {
  margin: 0;
  padding: 0;
  max-height: 264px;
  overflow: auto;
  list-style: none;
  overscroll-behavior: contain;
}
.ms-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12px;
  color: #344054;
  cursor: pointer;
}
.ms-list label:hover { background: #edf3fa; }
.ms-list input[type="checkbox"] { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--navy); cursor: pointer; }
.ms-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-opt-count { flex: none; padding: 1px 7px; background: #eef2f7; border-radius: 999px; color: #667085; font-size: 10.5px; font-style: normal; font-weight: 700; }
.ms-list li:has(input:checked) label { background: #eaf1fb; }
.ms-list li:has(input:checked) .ms-opt-label { color: var(--navy-deep); font-weight: 700; }

/* Segmented control kepemilikan */
.seg {
  display: inline-flex;
  height: 34px;
  padding: 3px;
  background: #eef2f7;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  gap: 2px;
}
.seg-btn {
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.seg-btn:hover { color: var(--navy-deep); }
.seg-btn.is-active { background: #fff; color: var(--navy-deep); box-shadow: 0 1px 3px rgba(3,27,63,.15); }

.filter-count {
  padding: 4px 9px;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.matrix-empty { padding: 48px 24px; color: var(--muted); text-align: center; font-size: 14px; }

.report-period {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--navy-deep);
  white-space: nowrap;
}
.report-period span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.report-period strong { color: var(--navy-deep); font-size: 13px; font-weight: 800; }

.score-tooltip {
  position: fixed;
  z-index: 700;
  box-sizing: border-box;
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px;
  background: #0f1f3a;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(3,27,63,.35);
  font-size: 11px;
  line-height: 1.45;
}
.score-tooltip[hidden] { display: none; }
.score-tooltip h4 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 0 0 9px; background: #0f1f3a; color: #ffd166; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.score-tooltip ul { margin: 0; padding: 0; list-style: none; }
.score-tooltip li { padding: 4px 0; display: flex; align-items: flex-start; gap: 7px; border-top: 1px solid rgba(255,255,255,.10); }
.score-tooltip li:first-child { border-top: 0; }
.score-tooltip li.is-active { margin: 0 -7px; padding: 5px 7px; background: rgba(255,209,102,.16); border-radius: 5px; box-shadow: inset 3px 0 #ffd166; }
.score-tooltip li .tt-icon { flex: none; width: 18px; text-align: center; }
.score-tooltip li .tt-range { flex: 1; color: #e2e8f0; }
.score-tooltip li .tt-label { flex: none; color: #94a3b8; font-size: 10px; }
.score-tooltip li.is-active .tt-range,
.score-tooltip li.is-active .tt-label { color: #fff; font-weight: 750; }

.report-main { width: 100%; height: calc(100vh - var(--header-height)); }
.report-main > section { width: 100%; height: 100%; }
.matrix-shell {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #fff;
  scrollbar-color: #8fa1b8 #eef2f7;
}

.ideal-matrix {
  width: max-content;
  min-width: 100%;
  height: calc(100% - var(--scrollbar-clearance));
  /* Ruang snap halaman 2 dihitung dinamis oleh fitBankColumns (marginBottom). */
  margin-bottom: 56px;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
  font-size: 11px;
}
.ideal-matrix th,
.ideal-matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ideal-matrix thead th { position: sticky; top: 0; z-index: 40; }

.framework-head {
  left: 0;
  z-index: 70 !important;
  width: calc(var(--sticky-dimension) + var(--sticky-indicator));
  min-width: calc(var(--sticky-dimension) + var(--sticky-indicator));
  height: var(--matrix-head-height);
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.72) 34%, rgba(255,255,255,0) 58%),
    linear-gradient(145deg, #fff 0%, #f6f9fc 55%, #e8eef6 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    inset -1px 0 0 rgba(8,44,99,.12),
    inset 0 -3px 0 var(--navy),
    0 6px 13px rgba(3,27,63,.16);
  isolation: isolate;
}
.bank-logo-trigger,
.metric-trigger,
.indicator-cell button,
.score-cell button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.framework-logo { position: relative; z-index: 1; width: 100%; height: 100%; padding: 4px 6px 8px; display: grid; place-items: center; }
.framework-logo img { display: block; width: 100%; max-width: 182px; max-height: 64px; object-fit: contain; filter: contrast(1.15) saturate(1.2) drop-shadow(0 2px 3px rgba(3,27,63,.12)); }

.bank-head {
  width: var(--bank-column);
  min-width: var(--bank-column);
  height: var(--matrix-head-height);
  padding: 0;
  border-bottom: 3px solid var(--navy-deep) !important;
  background: #fff;
  color: var(--ink);
  text-align: center;
  vertical-align: top;
}
.rank-label { height: 20px; padding: 3px; color: #fff; background: var(--navy-deep); font-size: clamp(9px, 1.05vh, 11px); font-weight: 700; }
.bank-logo-trigger { width: 100%; height: calc(var(--matrix-head-height) - 42px); padding: 3px 5px; display: grid; place-items: center; }
.bank-logo-trigger img { display: block; max-width: 116px; max-height: min(58px, calc(var(--matrix-head-height) - 46px)); object-fit: contain; }
.bank-logo-trigger:hover,
.bank-logo-trigger:focus-visible { background: #edf3fa; outline: none; }
.asset-line { height: 22px; display: grid; grid-template-columns: 1fr 53px; border-top: 1px solid #6f819b; }
.asset-line b,
.asset-line em { padding: 2px; font-size: clamp(10.5px, 1.2vh, 13px); font-style: normal; }
.asset-line em { border-left: 1px solid #6f819b; }

.dimension-cell {
  position: sticky;
  left: 0;
  z-index: 32;
  width: var(--sticky-dimension);
  min-width: var(--sticky-dimension);
  padding: 5px 3px;
  color: #fff;
  background: var(--navy);
  text-align: center;
  vertical-align: middle;
  background-clip: border-box;
  backface-visibility: hidden;
  transform: translateZ(0);
  cursor: pointer;
  user-select: none;
  transition: background .15s ease;
}
.dimension-cell:hover,
.dimension-cell:focus-visible {
  background: var(--navy-deep);
  outline: none;
}
.dimension-cell span { display: block; color: #ffb000; font-size: clamp(23px, 2.6vh, 28px); font-weight: 900; line-height: 1; }
.dimension-cell b { display: block; margin: 4px 0 2px; font-size: clamp(9.5px, 1.1vh, 12px); line-height: 1.12; }
.dimension-cell small { color: #d5dfed; font-size: clamp(8px, .9vh, 10px); }

.indicator-cell {
  position: sticky;
  left: var(--sticky-dimension);
  z-index: 31;
  width: var(--sticky-indicator);
  min-width: var(--sticky-indicator);
  height: var(--matrix-row-height);
  padding: 0;
  background: #9ca3ad;
  color: #fff;
  text-align: left;
  font-weight: 500;
  background-clip: border-box;
  backface-visibility: hidden;
  transform: translateZ(0);
  box-shadow: 1px 0 0 var(--line);
}
.indicator-cell button { width: 100%; height: 100%; padding: 4px 8px; color: #fff; text-align: left; font-size: clamp(10px, 1.25vh, 14px); line-height: 1.15; }
.indicator-cell button:hover,
.indicator-cell button:focus-visible { background: #7f8996; outline: none; }

.metric-cell { width: var(--bank-column); min-width: var(--bank-column); height: var(--matrix-row-height); padding: 0; color: #111827; text-align: center; }
.metric-trigger { position: relative; width: 100%; height: 100%; padding: 4px 25px 4px 5px; color: inherit; }
.metric-trigger b { font-size: clamp(12.5px, 1.55vh, 17px); font-weight: 800; }
.metric-trigger:hover,
.metric-trigger:focus-visible { box-shadow: inset 0 0 0 2px rgba(3,27,63,.55); outline: none; }
.metric-icon { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); font-size: clamp(14px, 1.7vh, 19px); line-height: 1; }
.metric-icon.is-skull { padding: 1px 3px; background: #111; }
body.colors-off .metric-icon.is-warning { color: #d97706; }

.metric-row.dimension-start > th,
.metric-row.dimension-start > td { border-top: 3px solid var(--navy-deep); }
.ideal-matrix tbody .metric-row:first-child > th,
.ideal-matrix tbody .metric-row:first-child > td { border-top: 0; }

.footer-label {
  position: sticky;
  left: 0;
  z-index: 50 !important;
  height: var(--matrix-score-height);
  padding: 7px 10px;
  color: #fff;
  background: var(--navy-deep);
  text-align: right;
  font-size: 11px;
}
.score-cell { height: var(--matrix-score-height); padding: 0; background: #8f969f; text-align: center; }
.score-cell button { width: 100%; height: 100%; color: #fff; font-size: clamp(20px, 2.5vh, 26px); font-weight: 900; }
.score-cell button:hover,
.score-cell button:focus-visible { background: #6d7682; outline: none; }

.score-cell.bank-col.col-theme-good button { color: #14532d !important; }
.score-cell.bank-col.col-theme-bad button { color: #b45309 !important; }
.score-cell.bank-col.col-theme-ugly button { color: #991b1b !important; }

/* Tombol tutup di semua pop up. */
.popover-close {
  position: sticky;
  top: 8px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 8px 8px -34px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #0f1f3a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(3,27,63,.25);
}
.popover-close:hover,
.popover-close:focus-visible { background: #d21f32; outline: none; }
.popover-close.tooltip-close { background: rgba(255,255,255,.16); margin-bottom: -30px; }
.popover-close.tooltip-close:hover,
.popover-close.tooltip-close:focus-visible { background: #d21f32; }

/* Sel info tambahan bisa diklik seperti sel IDEAL. */
.supp-trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.supp-trigger:hover,
.supp-trigger:focus-visible { box-shadow: inset 0 0 0 2px rgba(3,27,63,.55); outline: none; }

/* Blok pelengkap & monitoring CKPN: display-only di bawah composite score. */
.dimension-cell.supplement-dim { background: #475569; cursor: default; }
.dimension-cell.supplement-dim:hover,
.dimension-cell.supplement-dim:focus-visible { background: #475569; }
.dimension-cell.supplement-dim b { margin: 0 0 3px; font-size: clamp(9.5px, 1.1vh, 12px); line-height: 1.15; }
.dimension-cell.supplement-dim small { color: #cbd5e1; }
.supplement-row.dimension-start > th,
.supplement-row.dimension-start > td { border-top: 3px solid #334155; }
.indicator-cell.supplement-ind { padding: 0; }
/* Dua baris konten (persen + nominal) butuh napas lebih dari baris IDEAL. */
.supplement-row .metric-cell,
.indicator-cell.supplement-ind { height: clamp(36px, calc(var(--matrix-row-height) * 1.5), 84px); }
.supplement-value { width: 100%; height: 100%; padding: 2px 4px; display: grid; place-items: center; align-content: center; row-gap: 1px; }
.supplement-value b { font-size: clamp(12px, 1.5vh, 16px); font-weight: 800; line-height: 1.1; }
.supplement-value small { font-size: clamp(9px, 1.05vh, 11px); line-height: 1; opacity: .78; }

body.colors-off .metric-row:not(.row-color-inverted) .metric-cell,
body:not(.colors-off) .metric-row.row-color-inverted .metric-cell { background: #fff !important; color: #111827 !important; }
body.colors-off .metric-row.row-color-inverted .metric-cell { background: var(--analysis-bg) !important; color: var(--analysis-ink) !important; }

.detail-popover {
  position: fixed;
  z-index: 600;
  width: min(400px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  overflow: auto;
  padding: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafd 100%);
  border: 1px solid #cbd6e4;
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(3,27,63,.28), 0 10px 30px rgba(3,27,63,.14), 0 3px 8px rgba(3,27,63,.10);
}
.detail-popover.is-bank { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.detail-popover.is-indicator { width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.detail-popover.is-dimension { width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.detail-popover.is-metric { width: min(390px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: #fff; border-color: #d8e0ea; border-radius: 10px; box-shadow: 0 14px 36px rgba(3,27,63,.16), 0 2px 8px rgba(3,27,63,.08); }
.detail-popover.is-metric::before { height: 2px; background: #cbd5e1; }
.detail-popover::before { content: ""; position: sticky; top: 0; z-index: 2; display: block; height: 4px; background: var(--navy); }
.popover-body { padding: 18px 20px 20px; }
.popover-kicker { margin: 0 0 5px; color: #d21f32; font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.detail-popover h2 { margin: 0; color: var(--navy-deep); font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
.popover-address { margin: 8px 0 0; padding-top: 8px; color: #5d6b7d; border-top: 1px solid #e5eaf0; font-size: 11px; }
.popover-bank { text-align: left; }
.popover-bank-intro {
  margin-bottom: 18px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border: 1px solid #e2e8f1;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 32px rgba(3,27,63,.12), 0 4px 10px rgba(3,27,63,.06);
}
.theme-good .popover-bank-intro { background: linear-gradient(180deg, #f6fef9 0%, #e8f5ee 100%); border-color: #b7e1cd; }
.theme-bad .popover-bank-intro { background: linear-gradient(180deg, #fffefb 0%, #fff8e7 100%); border-color: #fae1a3; }
.theme-ugly .popover-bank-intro { background: linear-gradient(180deg, #fffafa 0%, #fdecec 100%); border-color: #f4bfbf; }
.popover-bank-logo { width: 200px; height: 140px; display: grid; place-items: center; justify-self: center; }
.popover-bank-logo img { display: block; max-width: 190px; max-height: 130px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(3,27,63,.14)); }
.popover-bank-identity { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.popover-bank h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.popover-bank .popover-address { margin: 6px 0 0; color: #4a5568; font-size: 12.5px; line-height: 1.45; }
.popover-bank-meta { display: flex; align-items: center; gap: 6px; }
.popover-bank-meta span { padding: 5px 8px; background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.08); border-radius: 6px; text-align: center; }
.popover-bank-meta small { display: block; margin-bottom: 1px; color: #64748b; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.popover-bank-meta strong { display: block; color: var(--navy-deep); font-size: 11.5px; }

.gbu-grid { display: flex; align-items: stretch; text-align: left; background: #fff; border: 1px solid #dbe3ed; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 28px rgba(3,27,63,.10), 0 3px 6px rgba(3,27,63,.05); }
.gbu-column { min-width: 0; flex: var(--group-share) 1 0; padding: 14px; }
.gbu-column + .gbu-column { border-left: 1px solid #dbe3ed; }
.gbu-column h3 { margin: 0 0 12px; padding-bottom: 8px; text-align: center; font-size: 15px; letter-spacing: .02em; border-bottom: 2px solid currentColor; }
.gbu-good { background: #f6fef9; }
.gbu-good h3 { color: #166534; border-color: #86efac; }
.gbu-bad { background: #fffbf5; }
.gbu-bad h3 { color: #92400e; border-color: #fdba74; }
.gbu-ugly { background: #fff6f6; }
.gbu-ugly h3 { color: #991b1b; border-color: #fca5a5; }
.gbu-column ul { margin: 0; padding: 0; list-style: none; }
.gbu-column.is-dense ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.gbu-column li { min-width: 0; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); }
.gbu-column li:first-child { border-top: 0; }
.gbu-item-main { display: grid; grid-template-columns: 23px minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.gbu-item-icon { display: grid; place-items: center; font-size: 16px; line-height: 1; }
.gbu-bad .gbu-item-icon { color: #e8590c; }
.gbu-item-icon.is-skull { padding: 2px; color: #fff; background: #111; border-radius: 2px; }
.gbu-column li b { overflow: hidden; color: #334155; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.gbu-column li strong { flex: none; color: var(--navy-deep); font-size: 12px; }
.gbu-column li small { margin: 4px 0 0 30px; display: block; color: #64748b; font-size: 10.5px; line-height: 1.35; }
.gbu-column .gbu-empty { display: grid; place-items: center; min-height: 90px; color: #94a3b8; font-size: 12px; text-align: center; }

.popover-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.popover-indicator { padding: 18px 20px 20px; }
.popover-indicator .popover-kicker { margin-bottom: 6px; font-size: 9px; }
.popover-indicator h2 { font-size: 19px; }
.weight-badge { flex: none; padding: 6px 9px; color: #fff; background: var(--navy); border-radius: 5px; font-size: 10px; font-weight: 750; }
.indicator-story { margin: 12px 0 0; color: #344054; font-size: 13px; line-height: 1.55; }
.indicator-weight-reason { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid #e3e9f0; color: #667085; font-size: 11.5px; line-height: 1.5; }
.indicator-weight-reason strong { color: var(--navy); }

.popover-dimension { padding: 16px 18px 18px; }
.popover-dimension .popover-kicker { margin-bottom: 6px; font-size: 9px; }
.popover-dimension h2 { font-size: 19px; }
.popover-dimension .weight-badge { padding: 5px 8px; font-size: 10px; }
.dimension-description { margin: 10px 0 0; color: #344054; font-size: 12px; line-height: 1.5; }
.dimension-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.dim-tag { padding: 5px 8px; display: inline-flex; align-items: baseline; gap: 5px; background: #f2f6fb; border: 1px solid #dce4ee; border-radius: 5px; color: #344054; font-size: 11px; }
.dim-tag b { font-weight: 600; }
.dim-tag small { color: var(--navy); font-weight: 700; font-size: 10px; }

.popover-metric { padding: 18px 20px 20px; text-align: center; }
.popover-metric .popover-kicker { margin-bottom: 4px; color: #7b8798; font-size: 8px; font-weight: 750; letter-spacing: .08em; }
.popover-metric h2 { color: #172b4d; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.metric-detail-value { margin: 13px 0 0; padding: 12px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #f8fafc; border: 1px solid #e1e7ef; border-radius: 8px; }
.metric-detail-value strong { color: #10233f; font-size: 30px; font-weight: 750; line-height: 1; letter-spacing: -.02em; }
.metric-detail-value span { font-size: 21px; }
.nominal-callout { margin-top: 12px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: #fbfcfe; border: 1px solid #e3e8ef; border-radius: 7px; }
.nominal-callout span,
.nominal-callout strong { display: block; }
.nominal-callout span { color: var(--muted); font-size: 10px; }
.nominal-callout strong { color: var(--navy); font-size: 15px; text-align: center; }
.metric-assessment { margin: 0; padding: 10px 6px 0; color: var(--muted); font-size: 10px; }
.metric-assessment b { color: var(--navy); }
.metric-assessment p { margin: 0 0 2px; color: #344054; font-size: 13px; font-weight: 650; }
.metric-assessment-trigger { margin: 0 auto 2px; padding: 0; display: block; background: transparent; border: 0; color: #344054; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.metric-assessment-trigger:hover,
.metric-assessment-trigger:focus-visible { color: var(--navy); outline: none; }
.metric-logic { margin-top: 13px; padding-top: 11px; border-top: 1px solid #e2e7ee; }
.metric-logic strong { color: #52647a; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.metric-logic p { margin: 5px 0 0; color: #475467; font-size: 11.5px; line-height: 1.5; }

.metric-trend { margin-top: 12px; padding: 10px 12px 8px; background: #fbfcfe; border: 1px solid #e3e8ef; border-radius: 7px; }
.metric-trend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-trend-head span { color: var(--muted); font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; }
.metric-trend-head b { font-size: 12px; font-weight: 750; }
.metric-trend-spark { display: block; margin: 6px auto 2px; }
.metric-trend-foot { color: #94a3b8; font-size: 9.5px; text-align: center; }

.score-hero { margin: 15px 0; padding: 13px; display: grid; grid-template-columns: 1fr 1.4fr; align-items: center; gap: 10px; background: #f5f8fc; border: 1px solid #dbe4ef; border-radius: 7px; }
.score-hero > strong { color: var(--navy-deep); font-size: 42px; line-height: 1; }
.score-hero > span { padding: 8px 10px; border-radius: 7px; font-size: 14px; font-weight: 900; text-align: center; }
.score-hero small { display: block; margin-top: 2px; font-size: 9px; font-weight: 650; }
.pk1 { background: #b7e1cd; color: #174d37; }
.pk2 { background: #d9ead3; color: #275627; }
.pk3 { background: #fff2cc; color: #665214; }
.pk4 { background: #fce5cd; color: #7d4216; }
.pk5 { background: #f4cccc; color: #7f1d1d; }
.popover-score ul { margin: 0; padding: 0; border-top: 1px solid #e2e8f0; list-style: none; }
.popover-score li { padding: 7px 2px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf1f5; color: #475467; font-size: 10px; }
.popover-score li strong { color: var(--navy-deep); }

@keyframes col-shiny {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.bank-col.col-theme-good,
.bank-col.col-theme-good .metric-trigger,
.bank-col.col-theme-good .score-cell button,
.bank-col.col-theme-good .bank-logo-trigger,
.bank-col.col-theme-good .asset-line {
  background: #b7e1cd !important;
  color: #174d37 !important;
}
.bank-col.col-theme-bad,
.bank-col.col-theme-bad .metric-trigger,
.bank-col.col-theme-bad .score-cell button,
.bank-col.col-theme-bad .bank-logo-trigger,
.bank-col.col-theme-bad .asset-line {
  background: #fff2cc !important;
  color: #665214 !important;
}
.bank-col.col-theme-ugly,
.bank-col.col-theme-ugly .metric-trigger,
.bank-col.col-theme-ugly .score-cell button,
.bank-col.col-theme-ugly .bank-logo-trigger,
.bank-col.col-theme-ugly .asset-line {
  background: #f4cccc !important;
  color: #7f1d1d !important;
}

.metric-cell.bank-col.col-theme-good,
.metric-cell.bank-col.col-theme-bad,
.metric-cell.bank-col.col-theme-ugly,
.score-cell.bank-col.col-theme-good,
.score-cell.bank-col.col-theme-bad,
.score-cell.bank-col.col-theme-ugly {
  position: relative;
  overflow: hidden;
}

.metric-cell.bank-col.col-theme-good::after,
.metric-cell.bank-col.col-theme-bad::after,
.metric-cell.bank-col.col-theme-ugly::after,
.score-cell.bank-col.col-theme-good::after,
.score-cell.bank-col.col-theme-bad::after,
.score-cell.bank-col.col-theme-ugly::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: col-shiny 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}

.metric-row.row-color-inverted .metric-cell.col-theme-good,
.metric-row.row-color-inverted .metric-cell.col-theme-bad,
.metric-row.row-color-inverted .metric-cell.col-theme-ugly {
  background: var(--analysis-bg) !important;
  color: var(--analysis-ink) !important;
}
.metric-row.row-color-inverted .metric-cell.col-theme-good .metric-trigger,
.metric-row.row-color-inverted .metric-cell.col-theme-bad .metric-trigger,
.metric-row.row-color-inverted .metric-cell.col-theme-ugly .metric-trigger {
  background: transparent !important;
  color: inherit !important;
}
.metric-row.row-color-inverted .metric-cell.col-theme-good::after,
.metric-row.row-color-inverted .metric-cell.col-theme-bad::after,
.metric-row.row-color-inverted .metric-cell.col-theme-ugly::after {
  display: none;
}

@media (max-width: 720px) {
  :root {
    --header-height: 96px;
    /* Default (ujung kiri): kolom IDEAL penuh seperti desktop. */
    --sticky-dimension: 62px;
    --sticky-indicator: 138px;
    --scrollbar-clearance: 10px;
  }
  /* Saat menggeser masuk ke deretan bank, kolom IDEAL menyempit. */
  html.ideal-collapsed {
    --sticky-dimension: 30px;
    --sticky-indicator: 104px;
  }
  .framework-head, .dimension-cell, .indicator-cell {
    transition: width .25s ease, min-width .25s ease;
  }
  @media (prefers-reduced-motion: reduce) {
    .framework-head, .dimension-cell, .indicator-cell { transition: none; }
  }

  /* Header dua baris: ikon + periode kanan-atas, lalu baris filter geser. */
  .report-header { height: var(--header-height); padding: 8px 10px 6px; align-items: flex-start; justify-content: flex-start; }
  .report-header-nav { width: 100%; flex-wrap: wrap; row-gap: 8px; }
  .report-period { right: 10px; top: 26px; }
  .report-period span { display: none; }
  .color-toggle, .watch-toggle { width: 36px; height: 36px; }
  .filter-group {
    order: 10;
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filter-group::-webkit-scrollbar { display: none; }
  /* Badge jumlah BPR di baris atas, di kiri periode. */
  .filter-count {
    position: absolute;
    top: 26px;
    right: 72px;
    transform: translateY(-50%);
    font-size: 10px;
  }
  .ms { flex: none; position: static; }
  .ms-btn { height: 36px; }
  .ms-btn-label { font-size: 9px; }
  .ms-btn-value { max-width: 86px; font-size: 12px; }
  .seg { flex: none; height: 36px; }
  .seg-btn { padding: 0 10px; font-size: 11px; }

  /* Panel filter jadi bottom sheet. */
  .ms-panel {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%;
    max-height: 68vh;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    box-shadow: 0 -18px 45px rgba(3,27,63,.28);
    display: flex;
    flex-direction: column;
  }
  .ms-panel::before {
    content: "";
    align-self: center;
    width: 40px;
    height: 4px;
    margin-bottom: 10px;
    background: #cbd6e4;
    border-radius: 999px;
  }
  .ms-list { max-height: none; flex: 1; }
  .ms-list label { padding: 11px 8px; font-size: 14px; }
  .ms-list input[type="checkbox"] { width: 18px; height: 18px; }
  .ms-search { padding: 10px; font-size: 14px; }
  .ms-actions button { padding: 6px 10px; font-size: 13px; }

  /* Matriks: kolom IDEAL penuh di ujung kiri, menyempit saat digeser. */
  .framework-head { width: calc(var(--sticky-dimension) + var(--sticky-indicator)); min-width: calc(var(--sticky-dimension) + var(--sticky-indicator)); }
  .framework-logo { padding: 4px; }
  .framework-logo img { max-width: 100%; }
  .dimension-cell { padding: 4px 2px; overflow: hidden; }
  .dimension-cell span { font-size: 16px; }
  .dimension-cell b { font-size: 7.5px; }
  .dimension-cell small { font-size: 7px; }
  html.ideal-collapsed .dimension-cell b,
  html.ideal-collapsed .dimension-cell small { display: none; }
  html.ideal-collapsed .dimension-cell.supplement-dim b {
    display: block;
    font-size: 8px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin: 0 auto;
  }
  .indicator-cell { overflow: hidden; }
  .indicator-cell button, .indicator-cell.supplement-ind { padding: 3px 5px; font-size: 9.5px; line-height: 1.15; }
  .indicator-cell.supplement-ind button { padding: 0; font-size: inherit; }
  .rank-label { font-size: 9px; }
  .metric-trigger { padding: 3px 16px 3px 3px; }
  .metric-trigger b { font-size: clamp(11px, 1.4vh, 14px); }
  .metric-icon { right: 2px; font-size: 12px; }
  .asset-line { grid-template-columns: 1fr 44px; }
  .asset-line b, .asset-line em { font-size: 10px; }
  .supplement-value b { font-size: clamp(11px, 1.4vh, 14px); }
  .supplement-value small { font-size: 8.5px; }
  .score-cell button { font-size: 17px; }
  .footer-label { padding: 5px 8px; font-size: 9px; }

  .detail-popover.is-bank { width: min(520px, calc(100vw - 24px)); }
  .popover-bank-intro { grid-template-columns: 1fr; gap: 14px; }
  .popover-bank-logo { width: auto; min-height: 90px; }
  .popover-bank h2 { font-size: 18px; }
  .popover-bank-meta { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .gbu-grid { flex-direction: column; gap: 0; }
  .gbu-column + .gbu-column { margin: 0; padding-left: 14px; border-left: 0; border-top: 1px solid #cbd5e1; }
}

@media print {
  @page { size: A4 landscape; margin: 7mm; }
  body { overflow: visible; background: #fff; }
  .report-header { display: none; }
  .report-main,
  .report-main > section,
  .matrix-shell { height: auto; overflow: visible; }
  .detail-popover { display: none !important; }
  .ideal-matrix thead th,
  .dimension-cell,
  .indicator-cell,
  .footer-label { position: static; }
  .bank-head,
  .metric-cell { width: 91px; min-width: 91px; }
  .framework-head { width: 164px; min-width: 164px; }
}
