/* Tabel panel: kepala gelap membulat, baris dipisah garis tipis horizontal saja (tanpa garis tepi),
   angka rata kanan, baris "Jumlah" tebal, serta batang persen (.pn-bar). Terang & gelap.
   Dipisah dari panel.css; dimuat setelahnya. */
:root, .light {
  --pn-th-bg: #13141a;
  --pn-th-ink: #ffffff;
  --pn-td-line: #eceef2;
  --pn-td-ink: var(--tw-gray-800);
  --pn-row-hover: #f7f8fa;
  --pn-bar: #e8f1ff;
  --pn-caption: #8a93a6;
}
.dark {
  --pn-th-bg: #2a2c35;
  --pn-th-ink: #f3f5f8;
  --pn-td-line: rgba(255, 255, 255, .07);
  --pn-td-ink: var(--tw-gray-800);
  --pn-row-hover: rgba(255, 255, 255, .03);
  --pn-bar: rgba(43, 176, 228, .16);
  --pn-caption: #7d8597;
}

/* ── kerangka ─────────────────────────────────────────────────────────── */
#content .table {
  border-collapse: separate;
  border-spacing: 0;
  border: 0;
  width: 100%;
}
#content .table > :is(thead, tbody, tfoot) > tr > :is(th, td) {
  border: 0;
  border-bottom: 1px solid var(--pn-td-line);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--pn-td-ink);
  background: transparent;
}
#content .table.table-border > :is(thead, tbody, tfoot) > tr > :is(th, td) { border-inline: 0; border-top: 0; }

/* kepala: pita gelap dengan sudut membulat */
#content .table > thead > tr > th {
  background: var(--pn-th-bg);
  color: var(--pn-th-ink);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  white-space: nowrap;
}
#content .table > thead > tr > th:first-child { border-radius: 10px 0 0 10px; }
#content .table > thead > tr > th:last-child { border-radius: 0 10px 10px 0; }
#content .table > thead > tr > th:only-child { border-radius: 10px; }
#content .table > thead > tr > th :is(a, span, i, .text-gray-600, .text-gray-700) { color: inherit; }
#content .table > thead .checkbox { background-color: transparent; border-color: rgba(255, 255, 255, .45); }

#content .table > tbody > tr { transition: background-color .15s; }
#content .table > tbody > tr:hover > td { background: var(--pn-row-hover); }
#content .table > tbody > tr:last-child > td { border-bottom: 1px solid var(--pn-td-line); }

/* baris jumlah */
#content .table > tfoot > tr > :is(th, td),
#content .table > tbody > tr.pn-total > td { font-weight: 700; color: var(--tw-gray-900); }

/* angka */
#content .table :is(td, th).text-end,
#content .table :is(td, th).pn-num { text-align: right; font-variant-numeric: tabular-nums; }

/* tabel di kartu: beri ruang agar pita kepala tidak menempel ke tepi kartu */
#content .card-grid > .card-body > .scrollable-x-auto,
#content .card-grid > .card-body > .table,
#content .card-grid > .card-body > div > .table:only-child { padding: 4px 20px 10px; }
#content .card-grid > .card-body > .scrollable-x-auto > .table { margin: 0; }
#content .card-grid > .card-body { padding: 0; }

/* judul kecil di atas tabel (seperti "PENDUDUK PER DUSUN") */
.pn-table-caption {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pn-caption);
}

/* batang persen di sel (pola .pn-bar yang sudah ada di panel.css: <td class="pn-bar" style="--w:29%">):
   batang biru muda di belakang teks, seperti tabel "Kelompok usia" */
#content .table td.pn-bar { position: relative; }
#content .table td.pn-bar::before {
  inset: 7px auto 7px 6px;
  max-width: calc(100% - 12px);
  min-width: 4px;
  border-radius: 6px;
  background: var(--pn-bar);
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}

/* ── pencarian langsung ───────────────────────────────────────────────── */
.pn-filter input[type="search"] {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2399a1b3' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 15px;
}
.pn-filter button[type="submit"].pn-live-hide { display: none; }

[data-pn-live] { position: relative; }
[data-pn-live] .card-body,
[data-pn-live] .card-footer { transition: opacity .18s; }
[data-pn-live].is-loading .card-body,
[data-pn-live].is-loading .card-footer { opacity: .45; pointer-events: none; }
[data-pn-live].is-loading::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: var(--pn-load-top, 0);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--tw-primary), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: pn-load 1s linear infinite;
}
@keyframes pn-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.pn-live-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  #content .table td.pn-bar::before, [data-pn-live] .card-body, [data-pn-live] .card-footer { transition: none; }
  [data-pn-live].is-loading::after { animation: none; }
}
