/* CK Analyzer — small layer on top of Tabler: brand color, numeric type, severity accents. */
:root, [data-bs-theme="light"] {
  /* palette taken from the app icon: deep navy tile, bright blue glow, gold accents */
  --cka-navy-900: #021336; --cka-navy-800: #031a45; --cka-navy-700: #06275e; --cka-blue: #2d7dff; --cka-gold: #f5c242;
  --tblr-primary: #1d5bd8; --tblr-primary-rgb: 29, 91, 216; --tblr-primary-text: #1a50bd;
  --tblr-primary-fg: #fff; --tblr-primary-darken: #174bb3; --tblr-primary-lt: #e7eefc;
  --tblr-font-monospace: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-bs-theme="dark"] { --tblr-primary: #5b8ff0; --tblr-primary-rgb: 91, 143, 240; --tblr-primary-text: #8db1f5; --tblr-primary-lt: #18284a; }

/* ---- sidebar in the icon's colours (dark in both themes) ---- */
.navbar-vertical {
  background: linear-gradient(180deg, var(--cka-navy-700) 0%, var(--cka-navy-800) 55%, var(--cka-navy-900) 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, .06);
  --tblr-navbar-color: rgba(214, 226, 255, .72); --tblr-navbar-hover-color: #fff; --tblr-navbar-active-color: #fff;
}
.navbar-vertical .nav-link { color: rgba(214, 226, 255, .72); border-radius: 8px; margin: 1px .5rem; transition: background .15s, color .15s; }
.navbar-vertical .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.navbar-vertical .nav-item.active > .nav-link { color: #fff !important; background: rgba(45, 125, 255, .18) !important; box-shadow: inset 3px 0 0 var(--cka-gold); }
.navbar-vertical .nav-item.active > .nav-link .nav-link-icon { color: var(--cka-gold); }
.navbar-vertical .navbar-brand { color: #fff; }
.navbar-vertical .dropdown a.text-reset { color: rgba(214, 226, 255, .85) !important; }
.navbar-vertical .avatar { background: rgba(245, 194, 66, .16); color: var(--cka-gold); }
@media (max-width: 991.98px) { .navbar-vertical { background: var(--cka-navy-800) !important; } }

/* ---- hide / show sidebar (desktop) ---- */
.sidebar-toggle { position: absolute; top: .9rem; right: .6rem; z-index: 2; border: 0; background: transparent; color: rgba(214, 226, 255, .55); width: 2rem; height: 2rem; border-radius: 8px; align-items: center; justify-content: center; font-size: 1.15rem; }
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); }
.sidebar-show { display: none; }
@media (min-width: 992px) {
  .navbar-vertical { transition: transform .2s ease, visibility .2s; }
  .page-wrapper { transition: margin .2s ease; }
  html.sidebar-hidden { --tblr-sidebar-width: 0px; }
  html.sidebar-hidden .navbar-vertical { transform: translateX(-100%); visibility: hidden; }
  html.sidebar-hidden .sidebar-show { display: inline-flex; position: fixed; top: .75rem; left: .75rem; z-index: 1031; align-items: center; gap: .35rem; padding: .3rem .55rem .3rem .3rem; border: 0; border-radius: 12px;
    background: linear-gradient(180deg, var(--cka-navy-700), var(--cka-navy-900)); color: #fff; box-shadow: 0 4px 14px rgba(2, 19, 54, .35); }
  html.sidebar-hidden .sidebar-show img { border-radius: 7px; }
  html.sidebar-hidden .sidebar-show:hover { box-shadow: 0 0 0 2px var(--cka-gold), 0 4px 14px rgba(2, 19, 54, .35); }
  html.sidebar-hidden .page-header .container-xl { padding-left: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .navbar-vertical, .page-wrapper { transition: none !important; } }

.brand-mark { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 6px; background: var(--tblr-primary); color: #fff; font: 800 .8rem/1 var(--tblr-font-sans-serif); letter-spacing: .04em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: .95rem; }
.brand-text small { font-weight: 500; font-size: .68rem; opacity: .65; letter-spacing: .06em; }
.brand-text small.brand-label { opacity: 1; color: var(--cka-gold); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.navbar-vertical .navbar-collapse { display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .navbar-vertical .navbar-collapse:not(.show) { display: none; } }

.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--tblr-font-monospace); font-size: .85em; }
.merek { font-family: var(--tblr-font-monospace); font-size: .8rem; overflow-wrap: anywhere; min-width: 12rem; }
.text-minus { color: var(--tblr-red) !important; font-weight: 600; }
.sev-row-tinggi { box-shadow: inset 3px 0 0 var(--tblr-red); }
.sev-row-sedang { box-shadow: inset 3px 0 0 var(--tblr-yellow); }
.sev-row-info { box-shadow: inset 3px 0 0 var(--tblr-azure); }
tr.row-bad td { background: rgba(var(--tblr-red-rgb), .07); }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--tblr-bg-surface); }
.table-responsive.tall { max-height: 70vh; }
.finding-detail { color: var(--tblr-secondary); max-width: 80ch; }
.kpi .h1 { font-variant-numeric: tabular-nums; }
.filters .form-control, .filters .form-select { min-width: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--tblr-body-color); }
th.sortable::after { content: "\2195"; margin-left: .25rem; opacity: .35; font-size: .85em; }
th.sortable[aria-sort="ascending"]::after { content: "\25B2"; opacity: .9; color: var(--tblr-primary); }
th.sortable[aria-sort="descending"]::after { content: "\25BC"; opacity: .9; color: var(--tblr-primary); }

.dropzone-box { border: 2px dashed var(--tblr-border-color); border-radius: var(--tblr-border-radius-lg); padding: 2.5rem 1rem; text-align: center; background: var(--tblr-bg-surface-secondary); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone-box.over { border-color: var(--tblr-primary); background: var(--tblr-primary-lt); }
.dropzone-box .ti { font-size: 2.5rem; color: var(--tblr-primary); }
.upload-list { max-height: 55vh; overflow: auto; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--tblr-secondary); }
.inline-edit { width: 7.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.login-bg { background: radial-gradient(1200px 500px at 50% -10%, rgba(45, 125, 255, .18), transparent 60%), linear-gradient(180deg, var(--tblr-primary-lt), var(--tblr-bg-surface-secondary) 55%); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .navbar-vertical, .page-header .btn-list, .filters { display: none !important; } .page-wrapper { margin: 0 !important; } }
.card-header { flex-wrap: wrap; gap: .5rem; }
.card-header .card-actions { margin-left: auto; }
.list-group-item .flex-fill, .finding-detail, .table td .fw-medium { min-width: 0; overflow-wrap: anywhere; }
td.ket { min-width: 12rem; white-space: normal; }
@media (max-width: 575.98px) { .page-title { font-size: 1.1rem; overflow-wrap: anywhere; } .card-header .card-actions { width: 100%; margin-left: 0; } .card-header .card-actions .input-icon { flex: 1; } }
[hidden] { display: none !important; }
.brand-logo { flex: none; width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.brand-logo-lg { width: 56px; height: 56px; border-radius: 13px; }
@media (max-width: 991.98px) { .navbar-vertical .brand-logo { width: 30px; height: 30px; border-radius: 7px; } }
@media (min-width: 992px) { .navbar-vertical .navbar-brand { justify-content: flex-start !important; width: 100%; padding-inline: .25rem; } }

/* ---- 1.9.0: per-unit totals, reconciliation status, follow-up panel ---- */
#totals:empty { display: none; }
.unit { color: var(--tblr-secondary); font-size: .85em; }
.unit-totals { gap: .5rem 1rem !important; }
.unit-total { min-width: 8.5rem; padding: .35rem .75rem; border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary); }
.unit-total-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary); }
.unit-total-value { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .unit-total { min-width: calc(50% - .5rem); flex: 1 1 calc(50% - .5rem); } }
.num-link { font-variant-numeric: tabular-nums; text-decoration: underline dotted; text-underline-offset: 3px; font-weight: 500; }
.recon-selisih { box-shadow: inset 3px 0 0 var(--tblr-red); }
.recon-menunggu { box-shadow: inset 3px 0 0 var(--tblr-yellow); }
.corrected { text-decoration: underline dotted var(--tblr-yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
tr.row-corrected td:first-child { box-shadow: inset 3px 0 0 var(--tblr-yellow); }
tr.row-gone { opacity: .78; }
/* follow-up panel */
.fu-panel.offcanvas-end { --tblr-offcanvas-width: min(46rem, 100vw); }
.fu-panel .offcanvas-title { font-size: 1.05rem; }
.fu-finding { padding: .85rem 1rem; border-radius: var(--tblr-border-radius-lg); background: var(--tblr-bg-surface-secondary); }
.fu-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.fu-section { margin-top: 1.25rem; }
.fu-h { font-size: .95rem; font-weight: 600; margin-bottom: .5rem; }
.fu-lines { max-height: 42vh; border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); }
.fu-lines thead th { position: sticky; top: 0; z-index: 1; background: var(--tblr-bg-surface); }
.fu-lines .merek { min-width: 10rem; }
tr.fu-rel td { background: rgba(var(--tblr-primary-rgb), .06); }
.fu-timeline { list-style: none; padding: 0; margin: 0; }
.fu-timeline li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--tblr-border-color-translucent); }
.fu-dot { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--tblr-bg-surface-secondary); font-size: 1.05rem; }
.fu-note { white-space: pre-line; font-size: .875rem; margin-top: .15rem; overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .fu-actions .btn { flex: 1 1 calc(50% - .5rem); } }
.unit-total.is-zero .unit-total-value { color: var(--tblr-secondary); font-weight: 500; }
/* findings list as stacked cards on phones (the 7-column table is too narrow there) */
@media (max-width: 767.98px) {
  .findings-table thead { display: none; }
  .findings-table tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--tblr-border-color); }
  .findings-table tbody td { display: block; padding: 0 !important; border: 0 !important; }
  .findings-table tbody td:nth-child(1) { grid-row: 1; grid-column: 1; }
  .findings-table tbody td:nth-child(2) { grid-row: 1; grid-column: 2; display: flex; gap: .5rem; align-items: center; }
  .findings-table tbody td:nth-child(2) .mt-1 { margin: 0 !important; }
  .findings-table tbody td:nth-child(6) { grid-row: 1; grid-column: 3; text-align: right; }
  .findings-table tbody td:nth-child(3), .findings-table tbody td:nth-child(4) { grid-column: 1 / -1; }
  .findings-table tbody td:nth-child(5) { grid-column: 1 / 3; font-size: .8rem; color: var(--tblr-secondary); align-self: center; }
  .findings-table tbody td:nth-child(7) { grid-column: 3; text-align: right; }
  .findings-table tbody td[colspan] { grid-column: 1 / -1; }
}
/* ---- dashboard cards (1.10) ---- */
.dash-card > .card { min-width: 0; }
.dash-card .card-header .card-title { font-size: .95rem; }
.dash-body { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.dash-body > .list-group, .dash-body > .table-responsive { flex: 1 1 auto; }
.dash-card .dropdown-menu { min-width: 12rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
.kpi-tile { display: block; padding: .75rem 1rem; border-radius: var(--tblr-border-radius-lg); background: var(--tblr-bg-surface-secondary); transition: box-shadow .15s; }
.kpi-tile:hover { box-shadow: inset 0 0 0 1px var(--tblr-primary); }
.kpi-tile .h1 { font-variant-numeric: tabular-nums; }
.recon-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .5rem; }
.recon-stat { display: block; padding: .6rem .75rem; border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary); }
.recon-stat:hover { box-shadow: inset 0 0 0 1px var(--tblr-border-color-dark, var(--tblr-primary)); }
.recon-stat .h2 { font-variant-numeric: tabular-nums; }
.dash-card .card-header { flex-wrap: nowrap; }
.dash-card .card-header .card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) { .dash-card .card-header .card-actions { width: auto; margin-left: auto; flex: none; } }
/* findings: "sudah ditindaklanjuti" = yellow Done */
.badge-done { background: #ffe14d !important; color: #4a3a00 !important; font-weight: 700; letter-spacing: .02em; }
[data-bs-theme="dark"] .badge-done { background: #e6c62e !important; color: #2b2200 !important; }
.row-done { box-shadow: inset 3px 0 0 #ffd60a; }
.fu-tabs .nav-link { padding: .85rem 1.1rem; font-weight: 500; }
@media (max-width: 575.98px) { .fu-tabs { flex-wrap: nowrap; } .fu-tabs .nav-item { flex: 1; } .fu-tabs .nav-link { padding: .75rem .5rem; justify-content: center; font-size: .82rem; } .fu-tabs .nav-link .ti { display: none; } }
/* ---- reconciliation: tablet & phone friendly (1.11.1) ---- */
.recon-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem 1rem; }
.recon-title { flex: 1 1 18rem; min-width: 0; }
.recon-title .merek { min-width: 0; }
.recon-badges { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.recon-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--tblr-border-color); }
.recon-sum .rs { padding: .4rem .65rem; border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary); }
.recon-sum .rs-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary); }
.recon-sum .rs-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.recon-table .sub { font-size: .75rem; color: var(--tblr-secondary); white-space: nowrap; }
.recon-table td, .recon-table th { white-space: nowrap; }
@media (max-width: 1199.98px) { .recon-table th { font-size: .68rem; } }
/* phones: each month becomes a small card */
@media (max-width: 575.98px) {
  .recon-table thead { display: none; }
  .recon-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--tblr-border-color); }
  .recon-table tbody td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .recon-table tbody td::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary); }
  .recon-table tbody td:nth-child(1)::before, .recon-table tbody td:nth-child(2)::before { display: none; }
  .recon-table tbody td:nth-child(2) { text-align: right !important; }
  .recon-badges { justify-content: flex-start; }
}
.unit-total-docs { background: var(--tblr-primary-lt); } .unit-total-docs .unit-total-label { color: var(--tblr-primary); }
/* 1.13: corrected = yellow, ignored = grey "Skip" */
.badge-koreksi { background: #ffe14d !important; color: #4a3a00 !important; font-weight: 600; }
[data-bs-theme="dark"] .badge-koreksi { background: #e6c62e !important; color: #2b2200 !important; }
tr.row-corrected td:first-child { box-shadow: inset 3px 0 0 #ffd60a !important; }
.corrected { text-decoration-color: #e6c200 !important; }
.badge-skip { background: #e2e5ea !important; color: #5b6370 !important; font-weight: 700; letter-spacing: .02em; }
[data-bs-theme="dark"] .badge-skip { background: #3a4150 !important; color: #c3c9d4 !important; }
.row-skip { box-shadow: inset 3px 0 0 #9aa3af !important; }

/* 1.16: merek groups per isi with tarif year boxes, uniform quantity cells, tarif table */
.merek-line { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; line-height: 1.35; }
.merek-line + .merek-line { margin-top: .15rem; }
.merek-line .merek { word-break: break-all; }
.year-box { display: inline-block; font-size: .68rem; font-weight: 600; line-height: 1; padding: .18rem .35rem; border: 1px solid currentColor; border-radius: 4px; font-variant-numeric: tabular-nums; }
.year-c0 { color: #1d5bd8; background: rgba(29, 91, 216, .08); }
.year-c1 { color: #b45309; background: rgba(180, 83, 9, .08); }
.year-c2 { color: #0f766e; background: rgba(15, 118, 110, .08); }
.year-c3 { color: #9333ea; background: rgba(147, 51, 234, .08); }
.year-c4 { color: #be123c; background: rgba(190, 18, 60, .08); }
.year-c5 { color: #4d7c0f; background: rgba(77, 124, 15, .1); }
.recon-sum .rs-sub { font-size: .75rem; color: var(--tblr-secondary); font-variant-numeric: tabular-nums; }
.recon-sum .rs-sub.text-minus, .recon-table .sub.text-minus { color: var(--tblr-red); }
.recon-table td.num .unit { font-size: .72rem; }
.tarif-table input { min-width: 6.5rem; }
.tarif-table th { white-space: nowrap; }
[data-bs-theme="dark"] .year-c0 { color: #8db1f5; } [data-bs-theme="dark"] .year-c1 { color: #f5b25b; } [data-bs-theme="dark"] .year-c2 { color: #5ed3c3; }
[data-bs-theme="dark"] .year-c3 { color: #c99bf7; } [data-bs-theme="dark"] .year-c4 { color: #f48aa5; } [data-bs-theme="dark"] .year-c5 { color: #a8d86a; }
.recon-table .num-link { line-height: inherit; vertical-align: baseline; border: 0; min-height: 0; font-size: inherit; }
/* KPI tiles: title at the top, number in the middle, caption at the bottom; all tiles in a row share one height */
.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpi-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.kpi-tile { display: flex; flex-direction: column; min-height: 8.25rem; height: 100%; }
.kpi-tile .kpi-label { margin: 0; line-height: 1.1rem; }
.kpi-tile .kpi-value { flex: 1 1 auto; display: flex; align-items: center; margin: .35rem 0; line-height: 1.1; }
.kpi-tile .kpi-sub { margin-top: auto; line-height: 1.25; }
