/* =========================================================================
   Colors and Styles
   ========================================================================= */
:root {
  /* surfaces & text */
  --ink: #0d1a2b;
  --ink-2: #13263d;
  --panel: #fff;
  --canvas: #eef1f5;
  --line: #d8dee7;
  --line-strong: #c2cad6;
  --muted: #5c6b7d;
  --muted-2: #8593a3;

  /* accent colours (base + soft tint) */
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --amber: #c77d12;
  --amber-soft: #fbf0db;
  --green: #1f8a52;
  --green-soft: #e3f3e9;
  --red: #c0392b;
  --red-soft: #fbe9e7;
  --purple: #6b46c1;
  --purple-soft: #efe9fb;

  /* shape & type */
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(13, 26, 43, .06), 0 8px 24px rgba(13, 26, 43, .08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   Layout
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "side top"
    "side main";
  height: 100vh;
}

/* Shared flex-filler */
.topbar .spacer,
.view-head .spacer,
.section-head .spacer,
.kontrak-card .kc-head .spacer,
.nav .grow {
  flex: 1;
}

/* ---- Top bar ---- */
.topbar {
  grid-area: top;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 58px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 22px 22px;
}

.topbar .crumb {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: #9db4d6;
}

.topbar .crumb b {
  color: #fff;
  font-weight: 600;
}

.topbar .crumb a {
  color: #9db4d6;
  text-decoration: none;
  font-weight: 600;
}

.topbar .crumb a:hover {
  color: #fff;
}

.conn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}

.dot.ok {
  background: #3ad17e;
  box-shadow: 0 0 0 3px rgba(58, 209, 126, .2);
}

.dot.bad {
  background: #ff6b5e;
  box-shadow: 0 0 0 3px rgba(255, 107, 94, .2);
}

.topbtn {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
}

.topbtn:hover {
  background: rgba(255, 255, 255, .16);
}

/* ---- Sidebar ---- */
.sidebar {
  grid-area: side;
  background: var(--ink-2);
  color: #cdd9e8;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #0a1626;
  transition: transform .22s ease;
}

.brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand .mark {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: #6c89ab;
  text-transform: uppercase;
}

.brand h1 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 650;
  color: #fff;
  letter-spacing: -.01em;
}

.nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav .sec {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: #5f7997;
  text-transform: uppercase;
  padding: 14px 12px 6px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #bccadb;
  text-decoration: none;
  cursor: pointer;
  font-size: 13.5px;
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

.nav a.active {
  background: var(--accent);
  color: #fff;
  border-color: #3d82f5;
}

.nav a .ico {
  width: 16px;
  text-align: center;
  opacity: .9;
  font-size: 13px;
}

/* ---- Main / view header ---- */
.main {
  grid-area: main;
  overflow: auto;
  padding: 24px 28px 60px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.view-head .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.view-head h2 {
  margin: 2px 0 0;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.015em;
}

.view-head .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: #1a5fcf;
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--canvas);
  color: var(--ink);
}

.btn.danger {
  color: var(--red);
  border-color: var(--line);
}

.btn.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* =========================================================================
   Panels & stats
   ========================================================================= */
.panel,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

/* grid children must be allowed to shrink, or wide content
   (tables, nowrap values) forces page overflow */
.grid > * {
  min-width: 0;
}

.stat {
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.stat.amber::before {
  background: var(--amber);
}

.stat.green::before {
  background: var(--green);
}

.stat.purple::before {
  background: var(--purple);
}

.stat .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stat .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.stat .v {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Tables
   ========================================================================= */
.tablewrap {
  overflow: auto;
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #f4f6f9;
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: var(--accent-soft);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.rowact {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.linklike {
  color: var(--accent);
  font-weight: 550;
}

/* =========================================================================
   Pills
   ========================================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill.blue {
  background: var(--accent-soft);
  color: #1a5fcf;
  border-color: #cfe0fb;
}

.pill.amber {
  background: var(--amber-soft);
  color: #9a6310;
  border-color: #f0dcb0;
}

.pill.green {
  background: var(--green-soft);
  color: #176b40;
  border-color: #bfe3cc;
}

.pill.purple {
  background: var(--purple-soft);
  color: #553aa3;
  border-color: #d8c9f3;
}

.pill.gray {
  background: #eef1f5;
  color: var(--muted);
  border-color: var(--line);
}

/* =========================================================================
   Forms & modal
   ========================================================================= */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 26, 43, .46);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow: auto;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(13, 26, 43, .3);
  animation: pop .14s ease;
}

@keyframes pop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.modal .mhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal .mhead .x {
  cursor: pointer;
  color: var(--muted-2);
  font-size: 20px;
  line-height: 1;
  background: none;
  border: none;
}

.modal .mbody {
  padding: 18px 20px;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.modal .mfoot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  text-transform: uppercase;
}

.field label .req {
  color: var(--red);
}

input,
select,
textarea {
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted-2);
}

.field .err {
  font-size: 11.5px;
  color: var(--red);
  font-weight: 550;
}

/* Pratinjau angka besar di bawah kolom uang (mis. 66.030.072.849 · 66,03 M). */
.field .num-preview {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .01em;
  min-height: 14px;
}
.field .num-preview:empty {
  display: none;
}

.field.has-err input,
.field.has-err select {
  border-color: var(--red);
}

input[readonly] {
  background: var(--bg-soft, #f4f4f5);
  color: var(--muted);
  cursor: default;
}

input[readonly]:focus {
  border-color: var(--line-strong);
  box-shadow: none;
}

.input-affix {
  position: relative;
}

.input-affix .affix {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
}

.input-affix:not(.pre) input {
  padding-right: 28px;
}

.input-affix.pre .affix {
  left: 11px;
  right: auto;
}

.input-affix.pre input {
  padding-left: 30px;
}

/* =========================================================================
   Detail view
   ========================================================================= */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 14px;
  text-decoration: none;
}

.back:hover {
  color: var(--accent);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin-top: 14px;
}

.detail-meta .mi .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.detail-meta .mi .v {
  font-size: 14px;
  font-weight: 550;
  margin-top: 2px;
}

.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.section-head .ttl {
  font-size: 15px;
  font-weight: 650;
}

.section-head .count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  background: var(--canvas);
  padding: 2px 8px;
  border-radius: 999px;
}

.nested {
  border-left: 2px solid var(--accent-soft);
  margin-left: 2px;
  padding-left: 14px;
}

.kontrak-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.kontrak-card .kc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty .big {
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
  margin-bottom: 3px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar input[type=search] {
  width: 240px;
}

.toolbar select {
  width: auto;
}

/* =========================================================================
   Toasts & loading
   ========================================================================= */
#toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 15px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  display: flex;
  gap: 9px;
  align-items: center;
  max-width: 360px;
  animation: pop .14s ease;
}

.toast.ok {
  background: #16623c;
}

.toast.err {
  background: #a3271b;
}

.toast .tx {
  flex: 1;
}

.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rot .7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================================
   Progress bars
   ========================================================================= */
/* Kinerja Tahunan — daftar tahun sebagai kartu yang dapat diklik. */
.kin-block + .kin-block {
  margin-top: 26px;
}
.kin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
  gap: 16px;
}
.kin-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kin-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(13, 26, 43, .08);
  transform: translateY(-2px);
}
.kin-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.kin-year {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}
.kin-pct {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.kin-pct.pos {
  color: var(--green);
}
.kin-bar {
  height: 8px;
  background: var(--canvas);
  border-radius: 5px;
  overflow: hidden;
}
.kin-bar-fill {
  height: 100%;
  min-width: 2px;
  background: var(--accent);
  border-radius: 5px;
}
.kin-figs {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.kin-fig {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kin-fig .lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.kin-fig b {
  font-size: 14px;
  color: var(--ink-2);
}
.kin-go {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

/* =========================================================================
   Responsive
   ========================================================================= */
.menu-btn {
  display: none;
  font-size: 15px;
  line-height: 1;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 26, 43, .46);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s;
}

/* tablet & below: sidebar becomes a slide-in drawer */
@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "main";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    max-width: 82vw;
    z-index: 60;
    transform: translateX(-100%);
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
  }

  .app.nav-open .sidebar {
    transform: none;
  }

  .app.nav-open .nav-scrim {
    opacity: 1;
    visibility: visible;
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0;
  }

  .topbar {
    padding: 0 12px;
    gap: 10px;
  }

  /* keep a long breadcrumb from shoving the action buttons off-screen */
  .topbar .crumb {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main {
    padding: 18px 16px 56px;
  }

  .modal .mbody {
    grid-template-columns: 1fr;
  }
}

/* phones */
@media (max-width: 560px) {
  .topbar .conn,
  .topbar .lbl {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .view-head {
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .view-head h2 {
    font-size: 20px;
  }

  .main {
    padding: 14px 12px 44px;
  }

  .panel-pad {
    padding: 14px;
  }

  .scrim {
    padding: 16px 10px;
  }

  .modal .mbody {
    padding: 16px;
  }

  .toolbar {
    gap: 8px;
  }

  .toolbar input[type=search] {
    width: 100%;
  }

  .toolbar select {
    flex: 1;
    min-width: 0;
  }

  .stat {
    padding: 14px 16px;
  }

  .stat .v {
    font-size: 22px;
  }

  thead th,
  tbody td {
    padding: 9px 10px;
  }

  .detail-meta {
    gap: 14px 20px;
  }

  /* full-width primary action below the title reads better than a cramped
     right-aligned button */
  .view-head .spacer {
    display: none;
  }

  .view-head > .btn,
  .view-head > .btn.primary {
    flex: 1 1 auto;
  }

  /* roomier tap targets for row actions on touch */
  .rowact .btn.sm {
    padding: 7px 11px;
  }

  /* kontrak card header stacks cleanly instead of squeezing */
  .kontrak-card .kc-head {
    gap: 10px 14px;
  }
}

/* =========================================================================
   Grafik perolehan kumulatif bulanan
   ========================================================================= */
.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend .sw {
  width: 18px;
  height: 0;
  border-top-width: 2.5px;
  border-top-style: solid;
  display: inline-block;
}

.chart-legend .sw-line {
  border-top-color: var(--accent);
}

.chart-legend .sw-dash {
  border-top-color: var(--amber);
  border-top-style: dashed;
}

.chart-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.chart-footer b {
  color: var(--ink);
  font-weight: 650;
}

.chart-footer .pos {
  color: var(--green);
  font-weight: 600;
}

/* Tooltip hover grafik perolehan */
.rz-wrap {
  position: relative;
}

.rz-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  min-width: 172px;
  box-shadow: var(--shadow);
}

.rz-tip-h {
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #cdd9e8;
}

.rz-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  line-height: 1.75;
}

.rz-tip-row span {
  color: #9db4d6;
  white-space: nowrap;
}

.rz-tip-row b {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.rz-tip-row b.up {
  color: #3ad17e;
}

.rz-tip-row b.down {
  color: #ff8a7e;
}

/* pemisah antar-grup di dalam tooltip penyerapan */
.rz-tip-sep {
  height: 1px;
  background: rgba(255, 255, 255, .16);
  margin: 6px 0;
}

/* =========================================================================
   Baris ringkasan kumulatif & sisa di bawah tabel capaian
   ========================================================================= */
tfoot .sumrow td {
  padding: 11px 14px;
  background: var(--canvas);
  font-weight: 650;
  color: var(--ink);
}

tfoot .sumrow .num {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink);
}

tfoot .sumrow:first-child td {
  border-top: 2px solid var(--line-strong);
}

tfoot .sumrow.sub td {
  border-bottom: none;
}

/* grafik Aktual vs Rencana penyerapan (memakai gaya tooltip .rz-tip yang sama) */
.pz-wrap { position: relative; }

/* =========================================================================
   Paginator daftar (5 item per halaman) — tombol nomor yang tegas & terlihat
   ========================================================================= */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 4px 2px;
}

.pager:empty {
  display: none;
}

.pg-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s, color .12s;
}

.pg-btn:hover:not(:disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.pg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(31, 111, 235, .35);
}

.pg-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.pg-nav {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

/* =========================================================================
   Tab Marketing / Teknis pada halaman Detail Proyek
   ========================================================================= */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0 16px;
}

.tab-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}

.tab-btn:hover:not(.active) {
  color: var(--ink);
  background: var(--canvas);
  border-radius: 6px 6px 0 0;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
  display: none;
}

/* =========================================================================
   Dashboard Marketing (mengikuti tata letak PDF DASHBOARD CAPAIAN).
   Memakai token warna & gaya panel/stat yang sudah ada agar konsisten.
   ========================================================================= */

/* Grid KPI (3 kartu sejajar seperti baris atas PDF) */
.cp-kpi-grid {
  grid-template-columns: repeat(3, 1fr);
}
.cp-kpi-grid .stat .v {
  font-size: 23px;
}

/* Blok "Capaian Marketing" (KPI + grid grafik utama) — kotak terkategori memakai
   ungu-soft, dibedakan dari blok Target vs Perolehan (biru) dan Potensi (hijau). */
.cp-capaian {
  padding: 18px;
  background: var(--purple-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Grid 2×2 grafik utama */
.cp-chart-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

/* Bagian potensi (blok hijau PDF, diselaraskan dg gaya aplikasi) */
.cp-potensi {
  margin-top: 20px;
  padding: 18px;
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cp-potensi-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

/* Bagian Target vs Perolehan — blok terkategori memakai biru-soft (beda dari blok potensi
   yang hijau) agar kategorinya jelas dan tidak berdempetan dengan grid grafik di atasnya. */
.cp-target {
  margin-top: 20px;
  padding: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cp-target .section-head {
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .cp-kpi-grid,
  .cp-chart-grid,
  .cp-potensi-grid {
    grid-template-columns: 1fr;
  }
}

/* Wadah grafik + tooltip bersama */
.cp-chart {
  position: relative;
}
.cp-chart .cp-bar,
.cp-chart .cp-hbar,
.cp-chart .cp-slice {
  cursor: pointer;
  transition: opacity .12s;
}
.cp-chart .cp-bar.cp-hot,
.cp-chart .cp-hbar.cp-hot {
  opacity: .82;
}
.cp-chart .cp-slice.cp-hot {
  opacity: .85;
}
/* Titik hover grafik Progress Teknis (rencana vs realisasi) */
.cp-chart .cp-pt {
  cursor: pointer;
}
.cp-chart .cp-pt.cp-hot circle {
  r: 5;
}

/* Tooltip (gaya sama dg .rz-tip agar seragam) */
.cp-tip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  min-width: 150px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  box-shadow: 0 6px 20px rgba(13, 26, 43, .28);
}
.cp-tip[hidden] {
  display: none;
}
.cp-tip-h {
  font-weight: 650;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.cp-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 1px 0;
}
.cp-tip-row span {
  color: #b9c6d6;
}
.cp-tip-row b {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

/* Legenda pie/donat */
.cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  justify-content: center;
}
.cp-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.cp-leg-item b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cp-leg-item small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
}
.cp-sw {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

/* Tabel Status Potensi */
.cp-status-table tfoot td {
  font-weight: 650;
  border-top: 2px solid var(--line-strong);
}
.cp-status-table td.num,
.cp-status-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}
.cp-trow {
  cursor: pointer;
  transition: background .12s;
}
.cp-trow.cp-hot {
  background: var(--accent-soft);
}
/* =========================================================================
   Sesi & peran
   ========================================================================= */
/* Identitas pengguna di topbar */
.who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
  margin-right: 4px;
}

.who-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.who-role {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9db4d0;
}

/* Peran non-admin: sembunyikan seluruh tombol yang mengubah data, termasuk yang
   digambar ulang setelah halaman dimuat (paginasi, panel detail). */
body.readonly [data-act$="add"],
body.readonly [data-act$="edit"],
body.readonly [data-act$="del"],
body.readonly [data-act="escalate"] {
  display: none !important;
}

/* =========================================================================
   Layar login
   ========================================================================= */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--canvas);
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(13, 26, 43, .10);
  padding: 30px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-logo {
  width: 132px;
  height: auto;
  align-self: center;
  margin-bottom: 2px;
}

.login-card h1 {
  font-size: 19px;
  font-weight: 650;
  text-align: center;
  margin: 0;
}

.login-sub {
  margin: -8px 0 4px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.login-field input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-submit {
  margin-top: 6px;
  justify-content: center;
  padding: 10px 14px;
}

.login-note {
  margin: 2px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
}

.login-alert {
  background: var(--red-soft);
  border: 1px solid #f3cabf;
  color: #a3271b;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
}

@media (max-width: 700px) {
  .who {
    display: none;
  }
}
