/* Gaya halaman Client (Task 18). Komponen khusus halaman ini berawalan cl-; komponen bersama ada di app.css. */

.cl-gulir { overflow-x: auto; }
.cl-kosong { color: var(--muted); font-size: 12.5px; padding: 14px 18px; margin: 0; }
td.cl-kosong { text-align: center; height: 56px; }

/* kotak ringkasan daftar */
.cl-sumrow { display: flex; align-items: stretch; padding: 10px 6px; margin: 0; }
.cl-sumrow > div { flex: 1 1 0; padding: 0 16px; border-left: 1px solid var(--rule); min-width: 0; }
.cl-sumrow > div:first-child { border-left: 0; }
.cl-sumrow dt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cl-sumrow dd { margin: 2px 0 0; font: 600 20px/1.15 var(--f-body); white-space: nowrap; }
.cl-sumrow dd small { display: block; font: 400 12px var(--f-body); color: var(--muted); margin: 1px 0 0; }
.cl-sumrow .lebar { flex: 2 1 0; }
.cl-sumrow .lebar dd { font: 500 12.5px/1.4 var(--f-body); white-space: normal; color: #3B3631; }

.cl-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 12px; }
.cl-ctl .sp { flex: 1; }
.cl-ctl .sel-f { margin-left: 6px; }

/* tabel daftar client */
.cl-tabel { min-width: 960px; table-layout: fixed; }
.cl-tabel th:nth-child(1) { width: 230px; }
.cl-tabel th:nth-child(2) { width: 130px; }
.cl-tabel th:nth-child(3) { width: 206px; }
.cl-tabel td:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-tabel th:nth-child(4) { width: 120px; }
.cl-tabel th:nth-child(6) { width: 104px; }
.cl-tabel th:nth-child(7) { width: 124px; }
.cl-tabel td { height: 42px; }
.cl-tabel td.num, .cl-tabel th.num { text-align: right; }
.cl-tabel td.num { font-weight: 600; white-space: nowrap; }
.cl-tabel tr.redup td { color: var(--muted); }
.cl-tabel .tag.kos { height: 18px; font-size: 10.5px; padding: 0 5px; }
.cl-tabel .wc { display: flex; align-items: center; gap: 7px; }
.cl-tabel .wc .av.s { width: 20px; height: 20px; font-size: 9.5px; border-width: 1.25px; }

.cl-jalur { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; max-width: 100%; min-width: 0; }
.cl-jalur .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-belum { color: var(--muted); font-weight: 400; }
.cl-jalur i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--ink); flex: none; }
.cl-jalur.via { color: var(--muted); }
.cl-jalur.via i { background: #fff; }
.cl-jalur b { font-weight: 600; color: #3B3631; }

.cl-perantara { list-style: none; margin: 0; padding: 0 18px 12px; }
.cl-perantara li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.cl-perantara li:last-child { border-bottom: 0; }

/* detail */
.cl-logo { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ink); display: grid; place-items: center; font: 400 20px/1 var(--f-head); background: var(--pill-sky); flex: none; }
.cl-ringkasan.grow { max-width: 360px; }
.cl-ringkasan.grow dd { white-space: normal; font-weight: 500; font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-jalur:is(.kepala .kv dd > *) { font-weight: 600; font-size: 13.5px; }

/* kolom Project yang lentur (sisa lebar), kolom lain tetap; isi sel boleh turun baris biar nama panjang ga nabrak */
.cl-proyek { min-width: 700px; table-layout: fixed; }
.cl-proyek th:nth-child(2) { width: 178px; }
.cl-proyek th:nth-child(3) { width: 126px; }
.cl-proyek th:nth-child(4) { width: 196px; }
.cl-proyek th:nth-child(5) { width: 74px; }
.cl-proyek td { white-space: normal; overflow-wrap: break-word; vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.cl-proyek td:nth-child(3), .cl-proyek td.num { white-space: nowrap; }
.cl-proyek th:nth-child(2), .cl-proyek td:nth-child(2), .cl-proyek th:nth-child(3), .cl-proyek td:nth-child(3) { padding-left: 6px; padding-right: 4px; }
.cl-proyek td:nth-child(4) { padding-left: 10px; padding-right: 8px; }
.cl-proyek td:nth-child(4) .sub { white-space: normal; line-height: 1.3; }
.cl-proyek td:nth-child(4) .pill { margin: 2px 0 3px; }
.cl-proyek .tag.kos { height: 18px; font-size: 10.5px; padding: 0 5px; }
.cl-proyek .tn { font-size: 12.5px; }
.cl-proyek .tn b { font-weight: 600; }
.cl-aturan { margin: 0 18px 12px; padding: 9px 12px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--pill-yellow); font-size: 12.5px; line-height: 1.4; }

/* riwayat jalur masuk */
.cl-jm { padding: 6px 18px 14px; overflow-x: auto; }
.cl-jm .line { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); }
.cl-jm .line::before { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; height: 2px; background: var(--ink); }
.cl-jm .nd { position: relative; padding-right: 10px; }
.cl-jm .nd i { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); background: var(--ink); margin-bottom: 6px; position: relative; }
.cl-jm .nd.via i { background: #fff; }
.cl-jm .nd.now i { background: var(--sky); }
.cl-jm .nd.via.now i { background: repeating-linear-gradient(135deg, var(--sky) 0 3px, #fff 3px 6px); }
.cl-jm .nd em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.cl-jm .nd b, .cl-jm .nd .cl-nm { display: block; font-weight: 600; font-size: 13px; line-height: 1.25; }
.cl-jm .nd span { display: block; font-size: 12px; color: #3B3631; }
.cl-jm .ring { display: flex; align-items: center; gap: 16px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.cl-jm .ring b { color: var(--ink); font-weight: 600; }
.cl-jm .ring .sp { flex: 1; }
.cl-kleg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.cl-kleg i, .cl-kleg span i { width: 10px; height: 10px; border: 1.5px solid var(--ink); border-radius: 2px; display: inline-block; vertical-align: -1px; margin-right: 5px; background: #fff; }
.cl-kleg i.jl { background: var(--ink); }

/* total spending */
.cl-spend { padding: 0 18px 14px; }
.cl-spend .big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cl-spend .big b { font: 600 26px/1.1 var(--f-body); }
.cl-spend .big span { font-size: 12.5px; color: var(--muted); }
.cl-spend .r2 { display: grid; grid-template-columns: 1fr 1fr; margin: 10px 0 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cl-spend .r2 div { padding: 7px 0; }
.cl-spend .r2 div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.cl-spend .r2 dt { font-size: 11.5px; color: var(--muted); }
.cl-spend .r2 dd { margin: 0; font-weight: 600; font-size: 15px; }
.cl-spend .r2 dd.ok { color: #1C6B43; }
.cl-spend .cap { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; display: block; }
.cl-kbars, .cl-klbl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.cl-kbars { align-items: end; height: 108px; padding: 0 2px; border-bottom: 1.5px solid var(--ink); }
.cl-kbars .kb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; font-size: 11px; font-weight: 600; min-width: 0; }
.cl-kbars .kb i { display: block; width: 100%; max-width: 34px; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 3px 3px 0 0; background: var(--navy); }
.cl-kbars .kb i.via { background: repeating-linear-gradient(135deg, var(--navy) 0 3px, #fff 3px 6px); }
.cl-kbars .kb i.nol { border: 0; height: 0; }
.cl-klbl { padding: 4px 2px 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.cl-spend .cl-kleg { margin-top: 8px; }
.cl-spend .cl-kleg i { background: var(--navy); }
.cl-spend .cl-kleg i.via { background: repeating-linear-gradient(135deg, var(--navy) 0 2px, #fff 2px 4px); }

/* contact person */
.cl-kp { list-style: none; margin: 0; padding: 0 18px 10px; }
.cl-kp li { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; line-height: 1.3; }
.cl-kp li:last-child { border-bottom: 0; }
.cl-kp li .av { width: 28px; height: 28px; font-size: 11.5px; border-width: 1.5px; background: var(--pill-grey); }
.cl-kp li b { font-weight: 600; }
.cl-kp li small { display: block; font-size: 12px; color: var(--muted); }
.cl-kp li .ch { font-size: 12px; color: var(--sky-ink); font-weight: 500; text-align: right; }
.cl-kp li.per { background: repeating-linear-gradient(135deg, #FBF8F5 0 7px, #fff 7px 14px); }
.cl-kp li .tag { height: 18px; font-size: 10.5px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

/* ---------- HP: ringkasan dua kolom, tabel daftar dan tabel project jadi kartu ---------- */
@media (max-width: 760px) {
  .cl-sumrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 0; padding: 12px 4px 10px; }
  .cl-sumrow > div { padding: 0 12px; border-left: 0; }
  .cl-sumrow > div:nth-child(even) { border-left: 1px solid var(--rule); }
  .cl-sumrow .lebar { grid-column: 1 / -1; border-left: 0 !important; padding-top: 10px; border-top: 1px solid var(--rule); }
  .cl-sumrow dd { font-size: 18px; white-space: normal; }
  .cl-ctl { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cl-ctl .chip, .cl-ctl .sel-f { flex: none; }
  .cl-ctl .sp { display: none; }
  .cl-gulir { overflow: visible; }
  .cl-tabel thead, .cl-proyek thead { display: none; }
  .cl-tabel, .cl-tabel tbody, .cl-proyek, .cl-proyek tbody, .cl-proyek tfoot { display: block; width: 100%; min-width: 0; }
  .cl-tabel tr, .cl-proyek tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--rule); }
  .cl-tabel td, .cl-proyek td { display: block; height: auto; padding: 0 !important; border: 0; white-space: normal; overflow: visible; }
  .cl-tabel td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .cl-tabel td.num { grid-column: 2; grid-row: 1; text-align: right; }
  .cl-tabel td:nth-child(2) { display: none; }
  .cl-tabel td:nth-child(3) { grid-column: 1; grid-row: 2; }
  .cl-tabel td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
  .cl-tabel td:nth-child(4) .main-c { font-weight: 500; font-size: 12.5px; }
  .cl-tabel td:nth-child(5) { grid-column: 1; grid-row: 3; }
  .cl-tabel td:nth-child(6) { grid-column: 2; grid-row: 3; font-size: 12.5px; }
  .cl-tabel td.cl-kosong { grid-column: 1 / -1; text-align: left; }
  .cl-proyek td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .cl-proyek td.num { grid-column: 2; grid-row: 1; text-align: right; }
  .cl-proyek td:nth-child(2) { grid-column: 1; grid-row: 2; font-size: 12.5px; }
  .cl-proyek td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .cl-proyek td:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }
  .cl-proyek td.cl-kosong { grid-column: 1 / -1; text-align: left; }
  .cl-proyek tfoot tr { border-top: 1.5px solid var(--ink); }
  .cl-proyek tfoot td { height: auto; border: 0; font-weight: 600; }
  .cl-proyek tfoot td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .cl-proyek tfoot td.num { grid-column: 2; grid-row: 1; }
  .cl-ringkasan.grow { flex-direction: column; align-items: flex-start; max-width: none; }
  .cl-ringkasan.grow dd { text-align: left; }
  .cl-jm { padding: 6px 14px 12px; }
  .cl-jm .ring { flex-wrap: wrap; gap: 4px 12px; }
  .cl-jm .ring .sp { display: none; }
  .cl-spend, .cl-perantara, .cl-kp { padding-left: 14px; padding-right: 14px; }
}
