/* ═══════════════════════════════════════════════════════════════════════════
   BARANTUMCHAT REPORT WIDGETS — sistem .chw- (chrome/state per widget) +
   renderer .gnx- (redesign tab General).
   Sumber desain: dummypreview/barantumchat-widgets.html (.chw-) dan
   adesign/agent-status-timeline.html (.gnx-, KATEGORI 1 GENERAL).
   File ini yang dulu di-link commit ac3e6a89 tapi tidak pernah dibuat
   (link-nya sempat dihapus karena 404/nosniff) — sekarang dibuat sungguhan.
   Chrome kartu (judul/filter/export) tetap milik reports.vue (.ra-*);
   kelas di sini hanya untuk ISI widget + state-nya.
   ═══════════════════════════════════════════════════════════════════════════ */

:root{
  --chw-brand:#1a83c7; --chw-brand-d:#136aa3; --chw-brand-l:#e7f2fa; --chw-brand-l2:#f0f6fb;
  --chw-ink:#1d2433; --chw-ink2:#394c62; --chw-ink3:#5e6e82; --chw-muted:#8492a6; --chw-faint:#a3afbd;
  --chw-line:#e8ecf2; --chw-line2:#eef2f7;
  --chw-hot:#2e9e5b; --chw-hot-l:#e9f7ee; --chw-warn:#c47f17; --chw-warn-l:#fdf6ec;
  --chw-bad:#d8483f; --chw-bad-l:#fbe8e6;
}

/* alias var pendek yang dipakai renderer .gnx- (scoped, tidak bocor global) */
.chw-root, .list-report.rep-grid{
  --pri:#1a83c7; --pri-bg:#e7f2fa; --ink:#1d2433; --ink2:#394c62; --mut:#8492a6;
  --line:#e8ecf2; --on:#16a34a; --on-bg:#dcfce7; --br:#d97706; --br-bg:#fdf2e3;
  --dn:#dc2626; --dn-bg:#fde8e8; --off:#64748b;
}

/* ════════════ ROOT + DATA ════════════ */
.chw-root{display:flex;flex-direction:column;min-height:0;height:100%;color:var(--chw-ink2);position:relative}
.chw-root button{font-family:inherit;cursor:pointer}
.chw-data{flex:1;display:flex;flex-direction:column;min-height:0}

/* ════════════ STATES (gating via data-state di .chw-root) ════════════ */
.chw-state{flex:1;display:none;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:4px;padding:18px;min-height:220px}
.chw-root[data-state="skeleton"] .chw-state.skeleton{display:flex}
.chw-root[data-state="firstuse"] .chw-state.firstuse{display:flex}
.chw-root[data-state="empty"]    .chw-state.empty{display:flex}
.chw-root[data-state="nosearch"] .chw-state.nosearch{display:flex}
.chw-root[data-state="error"]    .chw-state.error{display:flex}
.chw-root[data-state="skeleton"] .chw-data,
.chw-root[data-state="firstuse"] .chw-data,
.chw-root[data-state="empty"] .chw-data,
.chw-root[data-state="error"] .chw-data{display:none}

.chw-ill{width:54px;height:54px;border-radius:14px;display:grid;place-items:center;font-size:24px;margin-bottom:8px}
.chw-ill.muted{background:var(--chw-line2);color:var(--chw-faint)}
.chw-ill.brand{background:var(--chw-brand-l);color:var(--chw-brand)}
.chw-ill.warn{background:var(--chw-warn-l);color:var(--chw-warn)}
.chw-ill.bad{background:var(--chw-bad-l);color:var(--chw-bad)}
.chw-state .st-t{font-size:13px;font-weight:750;color:var(--chw-ink)}
.chw-state .st-d{font-size:11.5px;color:var(--chw-muted);line-height:1.5;max-width:320px}
.chw-state .st-acts, 
.rep-wcard .agp-empty .st-acts
{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap;justify-content:center}
.rep-wcard .agp-empty .st-acts .chw-sbtn,
.chw-sbtn{height:32px;padding:0 13px;border-radius:8px;font-size:12px;font-weight:650;display:inline-flex;align-items:center;gap:6px;border:none;background:none}
.rep-wcard .agp-empty .st-acts .chw-sbtn.pri, .chw-sbtn.pri{background:var(--chw-brand);color:#fff}
.rep-wcard .agp-empty .st-acts .chw-sbtn.pri:hover, .chw-sbtn.pri:hover{background:var(--chw-brand-d)}
.rep-wcard .agp-empty .st-acts .chw-sbtn.ghost, .chw-sbtn.ghost{border:1px solid var(--chw-line);background:#fff;color:var(--chw-ink2)}
.rep-wcard .agp-empty .st-acts .chw-sbtn.ghost:hover, .chw-sbtn.ghost:hover{border-color:#cfdae6}

/* skeleton shimmer */
.chw-sk{width:100%;height:13px;border-radius:7px;background:linear-gradient(90deg,#eef2f7 25%,#e2e8f0 37%,#eef2f7 63%);
  background-size:400% 100%;animation:chwshim 1.3s ease infinite}
@keyframes chwshim{0%{background-position:100% 0}100%{background-position:-100% 0}}
.chw-sk-rows{width:100%;display:flex;flex-direction:column;gap:13px;padding:6px 2px}
.chw-sk-row{display:flex;align-items:center;gap:12px}
.chw-sk-row .chw-sk.c{width:34px;height:34px;border-radius:9px;flex-shrink:0}

/* ════════════ SAMPLE BANNER ════════════ */
.chw-samplebar{display:none;align-items:center;gap:8px;margin:0 0 12px;padding:7px 11px;border-radius:9px;
  background:linear-gradient(90deg,var(--chw-warn-l),#fffaf1);border:1px solid #f1e2c4;font-size:11.5px;color:#9c6a13}
.chw-root.is-sample .chw-samplebar{display:flex}
.chw-samplebar>i{font-size:13px;color:var(--chw-warn);flex-shrink:0}
.chw-samplebar b{font-weight:750;color:#7e560f}
.chw-samplebar .sp{flex:1}
.chw-samplebar .exit{display:inline-flex;align-items:center;gap:5px;height:25px;padding:0 10px;border-radius:7px;
  font-size:11px;font-weight:700;color:var(--chw-warn);background:#fff;border:1px solid #ecd5a4;transition:.12s;flex-shrink:0}
.chw-samplebar .exit:hover{background:var(--chw-warn);border-color:var(--chw-warn);color:#fff}

/* ════════════ TABEL ════════════ */
.chw-tblwrap{flex:1;overflow:auto;min-height:0}
.chw-tbl{width:100%;border-collapse:collapse;font-size:12.5px}
.chw-tbl thead th{position:sticky;top:0;z-index:1;background:var(--chw-brand-l);border-bottom:1px solid #d4e6f5;text-align:left;
  padding:8px 12px;font-size:11px;font-weight:700;color:var(--chw-ink2);text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}
.chw-tbl thead th.num{text-align:right}
.chw-tbl tbody td{padding:9px 12px;border-bottom:1px solid var(--chw-line2);color:var(--chw-ink2);white-space:nowrap}
.chw-tbl tbody td.num{text-align:right;font-variant-numeric:tabular-nums;font-weight:650;color:var(--chw-ink)}
.chw-tbl tbody tr.lnkrow:hover{background:var(--chw-brand-l2);cursor:pointer}
/* `num` di sini penanda kolom angka, tapi style.css:1821 memakai nama yang sama
   untuk utility pil: border 1px #9e9e9e, border-radius 19px, height 53px,
   cursor pointer, dan `.num:hover{background:#F2F4F4;color:#fff}` — teks header
   HILANG saat kursor masuk dan sudut 19px-nya ikut terlihat. Jebakan yang sama
   sudah tercatat di src/bi/components/salesdashboard/sd-content.css.
   `:where()` dipakai agar spesifisitasnya 0: cukup untuk mengalahkan `.num`
   global (berkas ini dimuat setelahnya) tanpa menimpa aturan th/td tabel. */
.chw-tbl :where(.num){border:0;border-radius:0;height:auto;background-color:transparent;color:inherit;cursor:default}
/* `.num:hover` global = spesifisitas (0,2,0), jadi hover butuh selector lebih kuat. */
.chw-tbl thead th.num:hover{background-color:var(--chw-brand-l);color:var(--chw-ink2)}
.chw-tbl tbody td.num:hover{background-color:transparent;color:var(--chw-ink)}
.chw-tbl tfoot td.num:hover{background-color:transparent;color:var(--chw-ink)}
.chw-tbl .sw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:7px;vertical-align:-1px}
.chw-tbl tfoot td{padding:9px 12px;border-top:2px solid var(--chw-line);font-weight:800;color:var(--chw-ink);font-size:12.5px}
.chw-tbl tfoot td.num{text-align:right;font-variant-numeric:tabular-nums}
.chw-chan{display:inline-flex;align-items:center;gap:7px}
.chw-tav{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:7px;font-size:10px;font-weight:700;color:#fff;
  margin-right:8px;vertical-align:-7px;letter-spacing:.02em;background:var(--chw-brand)}

/* ════════════ CHART WRAPPER + KPI (dipakai file chw lama) ════════════ */
.chw-chart{flex:1;display:flex;align-items:center;justify-content:center;padding:6px;gap:18px;min-height:0}
.chw-hc{min-height:0}
.chw-kpi{flex:1;display:flex;flex-direction:column;justify-content:center;gap:14px;padding:8px 4px}
.chw-kpi .kp-top{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.chw-kpi .kp-l{font-size:12.5px;font-weight:600;color:var(--chw-ink2)}
.chw-kpi .kp-big{font-size:46px;font-weight:800;color:var(--chw-brand);line-height:.95;font-variant-numeric:tabular-nums}
.chw-kpi .kp-sub{font-size:11.5px;color:var(--chw-muted);margin-top:2px}

/* ════════════ LIST + CHIP + SEARCH + PAGINATION ════════════ */
.chw-list{flex:1;display:flex;flex-direction:column;min-height:0;overflow:auto}
.chw-li{display:flex;align-items:center;gap:11px;padding:9px 6px;border-bottom:1px solid var(--chw-line2);transition:.12s}
.chw-li:hover{background:var(--chw-brand-l2);border-radius:8px}
.chw-av{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;font-size:12.5px;font-weight:700;color:#fff;flex-shrink:0;letter-spacing:.02em;background:var(--chw-brand)}
.chw-li-main{min-width:0;flex:1}
.chw-li-nm{font-size:12.5px;font-weight:700;color:var(--chw-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chw-li-meta{font-size:11px;color:var(--chw-muted);margin-top:2px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.chw-li-meta .mi{display:inline-flex;align-items:center;gap:4px}
.chw-chip{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:20px;
  background:var(--chw-brand-l);color:var(--chw-brand)}
.chw-chip.warn{background:var(--chw-warn-l);color:var(--chw-warn)}
.chw-chip.hot{background:var(--chw-hot-l);color:var(--chw-hot)}
.chw-chip.bad{background:var(--chw-bad-l);color:var(--chw-bad)}

.chw-toolrow{display:flex;align-items:center;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.chw-search{display:flex;align-items:center;gap:7px;border:1px solid var(--chw-line);border-radius:8px;padding:0 10px;height:30px;
  background:#f7f9fc;width:190px;flex-shrink:0;transition:.13s}
.chw-search:focus-within{border-color:var(--chw-brand);background:#fff;box-shadow:0 0 0 3px var(--chw-brand-l)}
.chw-search i{color:var(--chw-faint);font-size:12px;flex-shrink:0}
.chw-search input{border:none;outline:none;background:none;font-size:12px;color:var(--chw-ink2);width:100%;min-width:0}

.chw-foot{border-top:1px solid var(--chw-line2);padding:9px 2px 0;display:flex;align-items:center;gap:10px;margin-top:8px}
.chw-fcap{font-size:11px;color:var(--chw-muted);display:inline-flex;align-items:center;gap:6px}
.chw-pg{display:flex;align-items:center;gap:3px;margin-left:auto}
.chw-pg button{min-width:28px;height:28px;padding:0 7px;border-radius:7px;font-size:12px;font-weight:600;color:var(--chw-ink3);
  border:1px solid var(--chw-line);background:#fff}
.chw-pg button:hover:not(:disabled){border-color:#cfdae6;color:var(--chw-brand)}
.chw-pg button.on{background:var(--chw-brand);border-color:var(--chw-brand);color:#fff}
.chw-pg button:disabled{opacity:.4;cursor:default}

/* ═══════════════════════════════════════════════════════════════════════════
   RENDERER .gnx- — REDESIGN TAB GENERAL (mirror adesign/agent-status-timeline)
   ═══════════════════════════════════════════════════════════════════════════ */

/* KPI ¼ lebar: angka + bar porsi dari total (delta/sparkline = TODO backend) */
.gnx-kpi{display:flex;flex-direction:column;gap:9px}
.gnx-kpi-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.gnx-kpi-big{font-size:30px;font-weight:800;color:var(--ink);line-height:1.05;font-variant-numeric:tabular-nums}
.gnx-kpi-big a{color:var(--pri);text-decoration:none}
.gnx-kpi-big a:hover{text-decoration:underline}
.gnx-kpi-big a i{font-size:14px;vertical-align:6px;margin-left:3px;opacity:.7}
.gnx-kpi-big.sm{font-size:17px;line-height:1.25}
.gnx-kpi-label{font-size:12px;color:var(--ink2);font-weight:600;line-height:1.35;display:flex;align-items:center;gap:6px;position:relative}
.gnx-kpi-label .bx-info-circle{color:var(--mut);font-size:14px}
.gnx-share{display:flex;align-items:center;gap:8px;font-size:10.5px;color:var(--mut)}
.gnx-share .t{flex:1;height:5px;border-radius:3px;background:#eef2f7;overflow:hidden}
.gnx-share .t span{display:block;height:100%;border-radius:3px;background:linear-gradient(90deg,#4aa3dd,var(--pri))}
.gnx-share.warn .t span{background:linear-gradient(90deg,#f0894e,var(--dn))}
.gnx-share.ok .t span{background:linear-gradient(90deg,#34c26b,var(--on))}
.gnx-share b{color:var(--ink2);font-variant-numeric:tabular-nums;white-space:nowrap}
.gnx-kpi-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:18px;color:var(--mut);font-size:11px;line-height:1.3}
.gnx-kpi-delta{display:inline-flex;align-items:center;gap:2px;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.gnx-kpi-delta i{font-size:13px;line-height:1}
.gnx-kpi-delta.up{background:#dcfce7;color:#16a34a}
.gnx-kpi-delta.down{background:#fee2e2;color:#ef4444}

/* donut per-kanal (SVG; toggle Chart/Tabel dipertahankan dari produksi) */
.gnx-donut{flex:1;display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap;padding:6px}
.gnx-pie{width:148px;height:148px;border-radius:50%;flex-shrink:0;position:relative}
.gnx-pie svg{width:100%;height:100%;display:block;transform:rotate(-90deg)}
.gnx-pie .c{position:absolute;inset:30px;background:#fff;border-radius:50%;display:grid;place-items:center;text-align:center;box-shadow:0 0 0 1px #f1f5f9}
.gnx-pie .c b{font-size:19px;font-weight:800;color:var(--ink);line-height:1}
.gnx-pie .c small{font-size:9.5px;color:var(--mut)}
.gnx-cleg{flex:1;min-width:170px;max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:3px}
.gnx-cleg .r{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink2);padding:4px 6px;border-radius:7px}
.gnx-cleg .r:hover{background:#f6faff}
.gnx-cleg .sw{width:9px;height:9px;border-radius:3px;flex-shrink:0}
.gnx-cleg .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.gnx-cleg .nm img{height:14px;width:14px;object-fit:contain}
.gnx-cleg .vl{font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.gnx-cleg .pc{width:44px;text-align:right;font-size:10.5px;font-weight:700;color:var(--mut);font-variant-numeric:tabular-nums}
.gnx-cleg .r{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;column-gap:8px;row-gap:4px}
.gnx-cleg .gnx-progress{grid-column:2 / -1;display:block;height:5px;overflow:hidden;background:#eaf0f6;border-radius:999px}
.gnx-cleg .gnx-progress>i{display:block;height:100%;min-width:0;border-radius:inherit;transition:width .2s ease}

/* status per kanal: bar bertumpuk + pil angka ber-link drill */
.gnx-stack{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0;overflow:auto}
.gnx-strow{display:flex;align-items:center;gap:10px;padding:8px 6px;border-radius:8px}
.gnx-strow:hover{background:#f6faff}
.gnx-stnm{width:120px;flex:0 0 120px;font-size:12px;font-weight:600;color:var(--ink2);display:flex;align-items:center;gap:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gnx-stnm img{height:16px;width:16px;object-fit:contain}
.gnx-stbar{flex:1;display:flex;height:16px;border-radius:6px;overflow:hidden;background:#f1f5f9}
.gnx-stbar span{display:block;height:100%;min-width:0}
.gnx-stv{width:238px;flex:0 0 238px;display:flex;gap:6px;justify-content:flex-end}
.gnx-stv a{font-size:11px;font-weight:700;border-radius:20px;padding:3px 9px;text-decoration:none;font-variant-numeric:tabular-nums;white-space:nowrap}
.gnx-stv a:hover{filter:brightness(.93)}
.gnx-stv a.z{opacity:.45;pointer-events:none}
.gnx-stv a.done{background:var(--on-bg);color:#15803d}
.gnx-stv a.pend{background:var(--br-bg);color:var(--br)}
.gnx-stv a.prog{background:var(--pri-bg);color:#1d6fa5}
.gnx-stleg{display:flex;gap:14px;align-items:center;font-size:10.5px;color:var(--mut);margin-top:9px;flex-wrap:wrap}
.gnx-stleg i{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:-1px}

/* kolom 24 jam (inbound per jam) */
.gnx-hours-scroll{overflow-x:auto;padding-bottom:2px}
.gnx-hours{display:flex;align-items:stretch;gap:3px;height:180px;min-width:640px}
.gnx-hr{flex:1;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:4px;min-width:24px;position:relative;height:100%}
.gnx-bar-track{display:grid;grid-template-rows:14px minmax(0,1fr);gap:2px;min-height:0;width:100%}
.gnx-bar-plot{display:flex;align-items:flex-end;min-height:0;height:100%;width:100%}
.gnx-hr .b{width:100%;border-radius:4px 4px 0 0;background:#cfe3f7;min-height:0;transition:filter .1s}
.gnx-hr.has-value .b{min-height:4px}
.gnx-hr:hover .b{filter:brightness(.9)}
.gnx-hr.office .b{background:#7db9e3}
.gnx-hr.peak .b{background:var(--pri)}
.gnx-hr .l,.gnx-hr .v{font-size:9px;text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
.gnx-hr .l{color:var(--mut)}
.gnx-hr .v{display:block;width:100%;overflow:visible;font-weight:700;color:var(--ink2)}
.gnx-hr.peak .v{color:var(--pri)}
.gnx-hlegend{display:flex;gap:14px;align-items:center;font-size:10.5px;color:var(--mut);margin-top:9px;flex-wrap:wrap}
.gnx-hlegend i{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:-1px}

/* bar per hari Senin–Minggu */
.gnx-week{flex:1;display:flex;flex-direction:column;gap:11px;justify-content:center;padding:6px 2px}
.gnx-wk{display:grid;grid-template-columns:76px 1fr 62px;align-items:center;gap:10px}
.gnx-wk .wl{font-size:11.5px;color:var(--ink2);font-weight:600;white-space:nowrap}
.gnx-wk.dim .wl{color:var(--mut)}
.gnx-wk .wt{height:16px;border-radius:6px;background:#f1f5f9;overflow:hidden}
.gnx-wk .wf{height:100%;border-radius:6px;background:linear-gradient(90deg,#7db9e3,#4aa3dd);min-width:4px}
.gnx-wk.peak .wf{background:linear-gradient(90deg,#4aa3dd,var(--pri))}
.gnx-wk.dim .wf{opacity:.55}
.gnx-wk .wv{font-size:11.5px;font-weight:700;color:var(--ink);text-align:right;font-variant-numeric:tabular-nums}

/* tile biaya WA (billing) */
.gnx-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px}
.gnx-tile{border:1px solid var(--line);border-radius:11px;padding:12px;position:relative;overflow:hidden}
.gnx-tile .ic{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;font-size:14px;margin-bottom:8px}
.gnx-tile .v{font-size:20px;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.gnx-tile .l{font-size:10.5px;color:var(--mut);margin-top:1px}
.gnx-tile .t{height:4px;border-radius:2px;background:#eef2f7;overflow:hidden;margin-top:9px}
.gnx-tile .t span{display:block;height:100%;border-radius:2px}
.gnx-band{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#f7f9fc;border:1px solid var(--line);border-radius:10px;padding:9px 13px;margin-top:11px;font-size:12px;color:var(--ink2)}
.gnx-band b{font-size:15px;color:var(--ink);font-variant-numeric:tabular-nums}

/* ring sukses vs gagal (outbound broadcast) */
.gnx-okfail{flex:1;display:flex;align-items:center;justify-content:center;gap:20px;flex-wrap:wrap;padding:6px}
.gnx-ring{width:124px;height:124px;border-radius:50%;flex-shrink:0;position:relative}
.gnx-ring svg{width:100%;height:100%;display:block;transform:rotate(-90deg)}
.gnx-ring .c{position:absolute;inset:14px;background:#fff;border-radius:50%;display:grid;place-items:center;text-align:center;box-shadow:0 0 0 1px #f1f5f9}
.gnx-ring .c b{font-size:21px;font-weight:800;color:var(--on);line-height:1}
.gnx-ring .c small{font-size:9px;color:var(--mut)}
.gnx-okfail-rows{flex:1;min-width:160px;max-width:280px;display:flex;flex-direction:column;gap:10px}
.gnx-ofr{display:flex;align-items:center;gap:9px;font-size:12.5px;color:var(--ink2)}
.gnx-ofr .sw{width:10px;height:10px;border-radius:3px;flex-shrink:0}
.gnx-ofr .nm{flex:1}
.gnx-ofr b{font-variant-numeric:tabular-nums;color:var(--ink)}
.gnx-ofr small{color:var(--mut);font-weight:600}

/* footer total di tabel inisiasi WA + pil sesi gratis */
.gnx-rp{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.gnx-free{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:700;border-radius:20px;padding:2px 9px;background:var(--on-bg);color:#15803d;font-variant-numeric:tabular-nums}

/* matriks chat→deals + pil closing rate */
.chw-chat-deals-wrap{
  max-height:440px;
  overflow:auto;
  border:1px solid #dfe7ef;
  border-radius:12px;
  background:#fff;
  scrollbar-width:thin;
  scrollbar-color:#cbd6e2 transparent;
}
.chw-chat-deals-wrap::-webkit-scrollbar{width:7px;height:7px}
.chw-chat-deals-wrap::-webkit-scrollbar-thumb{background:#cbd6e2;border-radius:99px}
.chw-chat-deals-table{
  min-width:760px;
  table-layout:fixed;
  border-collapse:separate !important;
  border-spacing:0;
  background:#fff;
}
.chw-chat-deals-table .chw-date-col{width:20%}
.chw-chat-deals-table .chw-value-col{width:13.333%}
.chw-chat-deals-table thead th{
  box-sizing:border-box;
  z-index:2;
  padding:0 14px !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  background-image:none !important;
  line-height:1.2;
}
.chw-chat-deals-table thead th::before,
.chw-chat-deals-table thead th::after{content:none !important;display:none !important}
.chw-chat-deals-table thead tr:first-child th{
  top:0;
  height:38px;
  background:#eef6fc;
  border-bottom:1px solid #d8e6f1 !important;
  color:#244a69;
  font-size:10.5px;
  letter-spacing:.045em;
}
.chw-chat-deals-table thead tr:nth-child(2) th{
  top:38px;
  height:34px;
  background:#f8fbfe;
  border-bottom:1px solid #dfe7ef !important;
  color:#607086;
  font-size:10px;
  letter-spacing:.035em;
}
.chw-chat-deals-table thead th.chw-date-head{z-index:3;vertical-align:middle;text-align:left}
.chw-chat-deals-table thead th.chw-group-head{text-align:center;border-left:1px solid #d8e6f1 !important}
.chw-chat-deals-table .chw-group-label{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.chw-chat-deals-table .chw-group-label i{
  display:inline-grid;
  place-items:center;
  width:18px;
  height:18px;
  border-radius:6px;
  background:#e5f7ed;
  color:#179957;
  font-size:12px;
}
.chw-chat-deals-table th.chw-group-start,
.chw-chat-deals-table td.chw-group-start{border-left:1px solid #dfe7ef !important}
.chw-chat-deals-table tbody td{
  box-sizing:border-box;
  height:48px;
  padding:0 14px;
  border:0;
  border-bottom:1px solid #edf1f5;
  color:#334155;
  background:transparent;
}
.chw-chat-deals-table tbody td:first-child{font-weight:600;color:#52677d}
.chw-chat-deals-table tbody td.num{font-weight:650;color:#273444}
.chw-chat-deals-table tbody tr:nth-child(even){background:#fbfcfe}
.chw-chat-deals-table tbody tr:hover{background:#f2f8fd}
.chw-chat-deals-table tbody tr:last-child td{border-bottom:0}
.gnx-cr{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  height:22px;
  border-radius:7px;
  padding:0 8px;
  font-size:10.5px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  background:#eef3f7;
  color:#52677d;
}
.gnx-cr.best{background:#e6f7ed;color:#16864d;box-shadow:inset 0 0 0 1px #c9ecd8}

/* chip error (pesan gagal) + identitas kanal */
.gnx-err{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:700;border-radius:6px;padding:2px 7px;background:var(--dn-bg);color:var(--dn);font-variant-numeric:tabular-nums;white-space:nowrap}
.gnx-errmsg{font-size:11.5px;color:var(--ink2);display:block;max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gnx-chip-ch{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;color:var(--ink)}
.gnx-chip-ch img{height:15px;width:15px;object-fit:contain}
.gnx-uid{font-size:11px;color:var(--mut);font-variant-numeric:tabular-nums}

/* ═══════════════════════════════════════════════════════════════════════════
   RENDERER .agp- — redesign KATEGORI 2 KINERJA AGEN
   (adesign/agent-status-timeline.html). Baru dipakai widget samir per-kanal;
   kelas lain menyusul saat port tab Kinerja Agen.
   ═══════════════════════════════════════════════════════════════════════════ */

/* leaderboard kanal (render 'chan'): ikon + bar durasi, tercepat di atas */
.agp-clist{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:2px;padding:4px 6px}
.agp-crow{display:flex;align-items:center;gap:9px;padding:7px 6px;border-radius:8px}
.agp-crow:hover{background:#f6faff}
.agp-cic{width:26px;height:26px;flex:0 0 26px;border-radius:8px;background:#f4f7fb;display:inline-grid;place-items:center}
.agp-cic img{width:15px;height:15px;object-fit:contain}
.agp-cnm{width:104px;flex:0 0 104px;font-size:12.5px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agp-ctrack{flex:1;height:9px;border-radius:5px;background:#eef2f7;overflow:hidden}
.agp-bfill{display:block;height:100%;border-radius:5px;background:linear-gradient(90deg,#4aa3dd,var(--pri))}
.agp-bfill.good{background:linear-gradient(90deg,#34c26b,var(--on))}
.agp-bfill.bad{background:linear-gradient(90deg,#f0894e,var(--dn))}
.agp-bval{width:62px;flex:0 0 62px;text-align:right;font-size:12.5px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.agp-bval.good{color:var(--on)} .agp-bval.bad{color:var(--dn)}
.agp-bval.mut{color:var(--mut);font-weight:600}
.agp-cmut{width:82px;flex:0 0 82px;font-size:11px;color:var(--mut);text-align:right;font-variant-numeric:tabular-nums}

/* bar bertumpuk 100% (render 'split': agen-vs-bot · service level) */
.agp-sleg{display:flex;gap:14px;font-size:11px;color:var(--ink2);margin-bottom:6px;align-items:center;padding:4px 12px 0}
.agp-sleg i{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:5px;vertical-align:-1px}
.agp-sleg .note{margin-left:auto;color:var(--mut)}
.agp-srow{display:flex;align-items:center;gap:10px;padding:7px 6px;border-radius:8px}
.agp-srow:hover{background:#f6faff}
.agp-snm{width:158px;flex:0 0 158px;display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden}
.agp-strack{flex:1;height:14px;border-radius:5px;overflow:hidden;display:flex;background:#eef2f7}
.agp-strack span{display:block;height:100%}
.agp-sv{width:92px;flex:0 0 92px;text-align:right;font-size:11.5px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.agp-sv small{color:var(--mut);font-weight:600}
.agp-sv.bad{color:var(--dn)}
.agp-stot{width:60px;flex:0 0 60px;text-align:right;font-size:11.5px;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.agp-golink{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);background:#fff;border-radius:20px;height:26px;padding:0 10px;font-size:10.5px;font-weight:600;color:var(--pri);cursor:pointer;white-space:nowrap;text-decoration:none}
.agp-golink:hover{border-color:var(--pri);background:var(--pri-bg);color:var(--pri)}

/* SoT volume KPI cards: visual override only; grid dimensions and API data stay legacy. */
.chw-kpi.chw-kpi--volume{justify-content:flex-start;gap:8px;padding:10px 4px}
.chw-kpi--volume .kp-top{align-items:flex-start;flex-direction:column;gap:7px}
.chw-kpi--volume .kp-l{font-size:12px;font-weight:600;color:var(--chw-muted)}
.chw-kpi--volume .kp-big{color:var(--chw-ink);font-size:38px;line-height:1;font-weight:800}
.chw-kpi--volume .kp-sub{margin-top:1px;color:var(--chw-muted);font-size:11.5px;line-height:1.35}

/* Dashboard GridStack uses the same Barantumchat empty-state language as Report View.
   It affects only the content inside existing cards, never their persisted dimensions. */
.barantumchat-dashboard-widget .agp-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:200px;padding:34px 20px;text-align:center}
.barantumchat-dashboard-widget .agp-empty .ic{display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;margin-bottom:12px;border-radius:50%;background:#eef2f7;color:#8a9ab0;font-size:23px}
.barantumchat-dashboard-widget .agp-empty h5{margin:0 0 4px;color:#1a2234;font-size:13.5px;font-weight:700}
.barantumchat-dashboard-widget .agp-empty p{max-width:430px;margin:0 0 14px;color:#8a9ab0;font-size:11.5px;line-height:1.55}
.barantumchat-dashboard-widget .agp-empty button{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 13px;border:1px solid #d8e0e9;border-radius:8px;background:#fff;color:#394c62;font-size:12px;font-weight:600}
.barantumchat-dashboard-widget .agp-empty button:hover{background:#2284c6;color:#fff}

/* Dashboard GridStack mounts the legacy widgets directly, while Report View
   scopes these table rules under .rep-wcard.  Keep the renderer and its data
   untouched; provide the same visual contract only inside a Barantumchat card. */
.barantumchat-dashboard-widget .wg-tblwrap{width:100%;max-height:100%;overflow:auto;padding:0 8px 8px}
.barantumchat-dashboard-widget .wg-tbl{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;color:var(--chw-ink2)}
.barantumchat-dashboard-widget .wg-tbl th{height:36px;padding:0 10px;background:#e7f2fa;border-bottom:1px solid #d4e6f5;color:#39536f;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;white-space:nowrap}
.barantumchat-dashboard-widget .wg-tbl th:first-child{border-radius:8px 0 0 0;text-align:left}
.barantumchat-dashboard-widget .wg-tbl th:last-child{border-radius:0 8px 0 0}
.barantumchat-dashboard-widget .wg-tbl td{height:46px;padding:0 10px;border-bottom:1px solid #edf1f5;vertical-align:middle;white-space:nowrap}
.barantumchat-dashboard-widget .wg-tbl tbody tr:nth-child(even){background:#fbfcfe}
.barantumchat-dashboard-widget .wg-tbl tbody tr:hover{background:#f3f8fc}
.barantumchat-dashboard-widget .wg-tav{display:inline-grid;place-items:center;width:24px;height:24px;margin-right:8px;border-radius:50%;color:#fff;font-size:10px;font-weight:700;vertical-align:middle}
.barantumchat-dashboard-widget .wg-rk{display:inline-grid;place-items:center;width:18px;height:18px;margin-right:6px;border-radius:6px;background:#f0f4f8;color:#718096;font-size:10px;font-weight:700;vertical-align:middle}
.barantumchat-dashboard-widget .wg-rk.r1{background:#fff1cf;color:#bc7d13}.barantumchat-dashboard-widget .wg-rk.r2{background:#edf2f7;color:#66778c}.barantumchat-dashboard-widget .wg-rk.r3{background:#ffeadf;color:#bc6f42}
.barantumchat-dashboard-widget .wg-cell{position:relative;display:block;min-width:66px;height:18px;border-radius:6px;background:#edf3f8;overflow:hidden;text-align:right;line-height:18px}
.barantumchat-dashboard-widget .wg-cbar{position:absolute;inset:0 auto 0 0;display:block;max-width:100%;background:#dcecf9;border-radius:inherit}
.barantumchat-dashboard-widget .wg-cv{position:relative;z-index:1;padding-right:7px;color:#34455b;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums}
.barantumchat-dashboard-widget .wg-cv.top{color:#1676bb}
.barantumchat-dashboard-widget .rep-wfoot{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px 10px;color:#8492a6;font-size:11px}
.barantumchat-dashboard-widget .rep-pg{display:flex;gap:3px}.barantumchat-dashboard-widget .rep-pg button{min-width:25px;height:25px;border:1px solid #dce5ee;border-radius:6px;background:#fff;color:#607086;font-size:11px}.barantumchat-dashboard-widget .rep-pg button.on{background:#1a83c7;border-color:#1a83c7;color:#fff}

/* Dashboard-only renderer for legacy Barantumchat KPI payloads that had no
   standalone component. It uses the card's existing GridStack size. */
.barantumchat-dashboard-widget .bc-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px 12px}
.barantumchat-dashboard-widget .bc-summary-metric{display:flex;flex-direction:column;justify-content:center;min-height:58px;padding:10px 12px;border:1px solid #e5edf4;border-radius:8px;background:#fbfdff}
.barantumchat-dashboard-widget .bc-summary-metric span{color:#70839a;font-size:11px;font-weight:600;line-height:1.3}
.barantumchat-dashboard-widget .bc-summary-metric b{margin-top:4px;color:#26364a;font-size:22px;line-height:1;font-variant-numeric:tabular-nums}
