/* ── Global ── */
body { font-size: 0.9rem; background: #f5f7fb; }

/* ── Stat cards ── */
.stat-card {
  border-radius: 12px;
  padding: 1rem 1.2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,.12);
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  opacity: .25;
}
.stat-num { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-lbl { font-size: .8rem; opacity: .9; margin-top: 2px; }

/* ── Tables ── */
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table td { vertical-align: middle; }
.sortable:hover { background-color: #cfe2ff !important; }
.sort-icon { font-size: .7rem; opacity: .5; margin-left: 2px; }

/* ── Tabs ── */
.nav-tabs .nav-link { color: #495057; font-weight: 500; }
.nav-tabs .nav-link.active { color: #0d6efd; font-weight: 600; }

/* ── Badge pills ── */
.badge-laki { background: #0d6efd22; color: #0d6efd; }
.badge-perempuan { background: #dc354522; color: #dc3545; }
.badge-produktif { background: #19875422; color: #198754; }
.badge-lansia { background: #ffc10722; color: #856404; }

/* ── Chart ── */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: .8rem;
}
.bar-chart-label { min-width: 155px; text-align: right; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart-bar-wrap { flex: 1; background: #e9ecef; border-radius: 4px; height: 18px; }
.bar-chart-bar { height: 18px; border-radius: 4px; transition: width .6s ease; }
.bar-chart-val { min-width: 28px; color: #333; font-weight: 600; }

/* ── Donut placeholder ── */
.donut-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.donut-svg { width: 160px; height: 160px; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.donut-pct { font-size: 1.3rem; font-weight: 700; }

/* ── Pagination ── */
.pagination { gap: 3px; }

/* ── Responsive ── */
@media (max-width: 576px) {
  .stat-num { font-size: 1.5rem; }
  .bar-chart-label { min-width: 110px; font-size: .72rem; }
}

/* ── Dark Mode ── */
body.dark {
  background: #121212;
  color: #e0e0e0;
}
body.dark .navbar { background-color: #1a1a2e !important; }
body.dark .card { background: #1e1e2e; border-color: #2a2a3e; color: #e0e0e0; }
body.dark .card-header { background: #252535 !important; color: #e0e0e0; border-color: #2a2a3e; }
body.dark .card-body { color: #e0e0e0; }
body.dark .table { color: #e0e0e0; }
body.dark .table th { background: #252535; color: #adb5bd; }
body.dark .table td { border-color: #2a2a3e; }
body.dark .table-striped > tbody > tr:nth-of-type(odd) { background: #1a1a2e; }
body.dark .table-hover tbody tr:hover { background: #2a2a3e; }
body.dark .table-light { background: #252535 !important; color: #e0e0e0 !important; }
body.dark .table-primary { background: #1a3a5c !important; color: #e0e0e0 !important; }
body.dark .nav-tabs { border-color: #2a2a3e; }
body.dark .nav-tabs .nav-link { color: #adb5bd; border-color: transparent; }
body.dark .nav-tabs .nav-link.active { background: #1e1e2e; color: #74b9ff; border-color: #2a2a3e #2a2a3e #1e1e2e; }
body.dark .nav-tabs .nav-link:hover { background: #252535; color: #e0e0e0; }
body.dark .form-control, body.dark .form-select, body.dark .input-group-text {
  background: #252535; color: #e0e0e0; border-color: #3a3a5e;
}
body.dark .form-control:focus, body.dark .form-select:focus {
  background: #2a2a3e; color: #e0e0e0; border-color: #74b9ff; box-shadow: 0 0 0 .2rem rgba(116,185,255,.25);
}
body.dark .modal-content { background: #1e1e2e; color: #e0e0e0; border-color: #2a2a3e; }
body.dark .modal-header { background: #252535; border-color: #2a2a3e; }
body.dark .modal-footer { border-color: #2a2a3e; }
body.dark .btn-outline-secondary { color: #adb5bd; border-color: #adb5bd; }
body.dark .btn-close { filter: invert(1); }
body.dark .text-muted { color: #888 !important; }
body.dark .bg-light { background: #252535 !important; }
body.dark .border { border-color: #2a2a3e !important; }
body.dark .border-top { border-color: #2a2a3e !important; }
body.dark .alert-info { background: #1a3a4a; color: #74d7f7; border-color: #1a4a5e; }
body.dark .sortable:hover { background-color: #1a3a5c !important; }
body.dark .bar-chart-label { color: #adb5bd; }
body.dark .bar-chart-bar-wrap { background: #2a2a3e; }
body.dark .bar-chart-val { color: #e0e0e0; }
body.dark .pagination .page-link { background: #252535; border-color: #3a3a5e; color: #74b9ff; }
body.dark .pagination .page-link:hover { background: #2a2a3e; }
body.dark .pagination .page-item.active .page-link { background: #0d6efd; border-color: #0d6efd; }
body.dark .pagination .page-item.disabled .page-link { background: #1e1e2e; color: #555; }

/* ── Dark mode: badge anggota KK ── */
body.dark .badge.bg-light { background: #2a2a3e !important; color: #e0e0e0 !important; border-color: #3a3a5e !important; }
body.dark .badge.text-dark { color: #e0e0e0 !important; }

/* ── Undangan / Mail Merge ── */
.undangan-card-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.undangan-card {
  border: 1px solid #aaa;
  padding: 18px 20px;
  font-size: 0.82rem;
  line-height: 1.6;
  page-break-inside: avoid;
  break-inside: avoid;
  background: #fff;
  color: #000;
}
.undangan-card.kolom-2 { width: 50%; }
.undangan-card.kolom-1 { width: 100%; }
.undangan-judul { text-align: center; font-weight: bold; font-size: 0.95rem; margin-bottom: 4px; }
.undangan-kop { text-align: center; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.undangan-kop-nama { font-weight: bold; font-size: 1rem; text-transform: uppercase; }
.undangan-kop-sub  { font-size: 0.78rem; }
.undangan-nomor   { margin-bottom: 6px; font-size: 0.8rem; }
.undangan-perihal { margin-bottom: 10px; }
.undangan-kepada  { margin-bottom: 10px; }
.undangan-isi     { margin-bottom: 10px; text-align: justify; white-space: pre-wrap; }
.undangan-detail-acara { margin: 8px 0 10px 20px; }
.undangan-detail-acara td { padding: 1px 8px 1px 0; }
.undangan-ttd     { margin-top: 16px; display: flex; justify-content: flex-end; }
.undangan-ttd-box { text-align: center; min-width: 130px; }
.undangan-ttd-ruang { height: 48px; }

/* ── Print ── */
@media print {
  body * { visibility: hidden !important; }
  #undangan-print-area, #undangan-print-area * { visibility: visible !important; }
  #undangan-print-area {
    position: fixed !important;
    top: 0; left: 0;
    width: 100vw;
    margin: 0; padding: 0;
  }
  .undangan-card { border: 1px solid #000; }
  @page { margin: 8mm; size: A4 portrait; }
}

/* Dark mode override for undangan editor */
body.dark #tab-undangan .card { background: #1e1e2e; }
body.dark #tab-undangan .undangan-card { background: #fff; color: #000; }

/* ───────────────────────────────────────────────────────────────────────────
   PERBAIKAN KONTRAS — Tema Terang & Gelap
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Tema Terang (default) ── */
.stat-lbl { opacity: 1 !important; }
.sort-icon { opacity: 0.7 !important; }
.bar-chart-label { color: #333 !important; }
.bar-chart-val { color: #1a1a1a !important; }
.text-muted { color: #5a5a5a !important; }
.table th { color: #2a2a2a !important; }
.nav-tabs .nav-link { color: #2c3138 !important; }
.nav-tabs .nav-link:hover { color: #0a58ca !important; }
.form-control, .form-select, .input-group-text { color: #1a1a1a; }
.card-header.bg-light { color: #1a1a1a; }
.btn-outline-secondary { color: #2c3138; border-color: #5a6268; }
.btn-outline-secondary:hover { color: #fff; background: #5a6268; }
.stat-card .stat-lbl { color: rgba(255,255,255,.95) !important; }
.stat-card.bg-warning .stat-lbl { color: rgba(0,0,0,.85) !important; }
.stat-card.bg-light .stat-lbl { color: #2a2a2a !important; }
.alert-info { color: #0c5460; }
small.text-muted { color: #5a5a5a !important; }

/* ── Tema Gelap ── */
body.dark { color: #e8eaed; }
body.dark .text-muted { color: #b0b6bf !important; }
body.dark small.text-muted { color: #b0b6bf !important; }
body.dark .table th { color: #d0d5dd !important; background: #2a2a3e !important; }
body.dark .table td { color: #e0e4ea; }
body.dark .nav-tabs .nav-link { color: #c0c8d0 !important; }
body.dark .nav-tabs .nav-link.active { color: #8fc4ff !important; }
body.dark .nav-tabs .nav-link:hover { color: #fff !important; }
body.dark .card-header { color: #e8eaed !important; }
body.dark .card-header.bg-light { color: #e8eaed !important; }
body.dark .stat-card .stat-lbl { color: rgba(255,255,255,.95) !important; }
body.dark .stat-card.bg-warning .stat-lbl { color: rgba(0,0,0,.85) !important; }
body.dark .stat-card.bg-light .stat-lbl { color: #1a1a1a !important; }
body.dark .stat-num { color: #fff; }
body.dark .text-dark { color: #1a1a1a !important; }
body.dark .bg-warning { color: #1a1a1a !important; }
body.dark .btn-outline-secondary { color: #c0c8d0; border-color: #6a7080; }
body.dark .btn-outline-secondary:hover { color: #fff; background: #3a3a4e; }
body.dark .btn-outline-dark { color: #e8eaed; border-color: #6a7080; }
body.dark .btn-outline-dark:hover { color: #1a1a1a; background: #e8eaed; }
body.dark .pagination .page-item.disabled .page-link { color: #777 !important; background: #1e1e2e !important; }
body.dark .pagination .page-link { color: #8fc4ff !important; }
body.dark .alert-info { color: #8fd8f0 !important; background: #143845 !important; border-color: #1a4a5e !important; }
body.dark .alert { color: #e8eaed; }
body.dark .form-label { color: #e0e4ea; }
body.dark .form-text { color: #b0b6bf; }
body.dark .form-control::placeholder { color: #8a8e96; }
body.dark .input-group-text { color: #c0c8d0; }
body.dark .dropdown-menu { background: #1e1e2e; border-color: #3a3a5e; }
body.dark .dropdown-item { color: #e0e4ea; }
body.dark .dropdown-item:hover { background: #2a2a3e; color: #fff; }
body.dark .navbar .text-white-50 { color: #c0c8d0 !important; }
body.dark .navbar .text-white { color: #fff !important; }
body.dark .bar-chart-label { color: #c0c8d0 !important; }
body.dark .bar-chart-val { color: #e8eaed !important; }
body.dark .badge { color: #fff; }
body.dark .badge.bg-dark { background: #2a2a3e !important; color: #e8eaed !important; }
body.dark .badge.bg-warning { color: #1a1a1a !important; }
body.dark .badge.text-dark { color: #1a1a1a !important; }
body.dark .badge.bg-light { background: #2a2a3e !important; color: #e8eaed !important; }
body.dark .table-success { background: #1e3a2e !important; color: #e8eaed !important; }
body.dark .table-warning { background: #3a3520 !important; color: #e8eaed !important; }
body.dark .table-dark { background: #2a2a3e !important; color: #e8eaed !important; }
body.dark footer { color: #b0b6bf !important; border-color: #2a2a3e !important; }
body.dark .modal-title { color: #fff !important; }
body.dark .modal-header.bg-primary { color: #fff; }
body.dark .modal-header.bg-danger { color: #fff; }
body.dark .modal-header.bg-success { color: #fff; }
body.dark .modal-header.bg-info { color: #fff; }
body.dark .modal-header.bg-warning { color: #1a1a1a; }
body.dark .modal-body { color: #e8eaed; }
body.dark .form-label.fw-semibold { color: #e8eaed; }
body.dark .text-primary { color: #8fc4ff !important; }
body.dark .text-danger { color: #ff8a9e !important; }
body.dark .text-success { color: #7fd0a0 !important; }
body.dark .text-warning { color: #ffd97a !important; }
body.dark .text-info { color: #8fd8f0 !important; }
body.dark .link-primary { color: #8fc4ff; }
body.dark .link-danger { color: #ff8a9e; }

/* Stat card fix — angka tetap putih di card berwarna gelap */
body.dark .stat-card.text-white { color: #fff !important; }
body.dark .stat-card.text-white .stat-num,
body.dark .stat-card.text-white .stat-lbl { color: #fff !important; }
body.dark .stat-card.text-dark { color: #1a1a1a !important; }
body.dark .stat-card.text-dark .stat-num,
body.dark .stat-card.text-dark .stat-lbl { color: #1a1a1a !important; }

/* Undangan editor di dark mode — field input tetap terang */
body.dark #tab-undangan .form-control { color: #e8eaed; }
body.dark #tab-undangan .form-select { color: #e8eaed; }
body.dark #tab-undangan .form-label { color: #e8eaed; }

/* Footer kontras */
footer { color: #5a5a5a; }

/* ── Tambahan dark mode: elemen yang sering terlewat ── */

/* Tabel di dalam modal (Detail KK, dll) */
body.dark .table-bordered { border-color: #3a3a5e !important; }
body.dark .table-bordered th,
body.dark .table-bordered td { border-color: #3a3a5e !important; }
body.dark .table-sm td { border-color: #3a3a3e !important; }

/* Modal Detail KK header tabel */
body.dark .modal-body .table thead { background: #2a2a3e !important; color: #d0d5dd !important; }
body.dark .modal-body .table thead th { background: #2a2a3e !important; color: #d0d5dd !important; }
body.dark .modal-body .table td { color: #e0e4ea; border-color: #3a3a5e; }
body.dark .modal-body .table-striped > tbody > tr:nth-of-type(odd) { background: #1a1a2e !important; }
body.dark .modal-body .table-hover > tbody > tr:hover { background: #2a2a3e !important; }

/* Modal Info Warga detail */
body.dark #infoContent { color: #e8eaed; }
body.dark #infoContent strong { color: #fff; }
body.dark #infoContent div { color: #e0e4ea; }
body.dark #infoContent .text-muted { color: #b0b6bf !important; }

/* Modal Share */
body.dark #shareContent { color: #e8eaed; }
body.dark #shareContent strong { color: #fff; }

/* Lokasi info di modal */
body.dark #lokasiInfo { color: #b0b6bf; }
body.dark #mapContainer { border-color: #3a3a5e !important; }
body.dark #kkMapContainer { border-color: #3a3a5e !important; }

/* Leaflet popup di dark mode */
body.dark .leaflet-popup-content-wrapper { background: #1e1e2e; color: #e8eaed; }
body.dark .leaflet-popup-tip { background: #1e1e2e; }

/* Card body di dashboard dengan border */
body.dark .card .card-body { color: #e0e4ea; }

/* Input di modal Edit Lokasi */
body.dark .alert-info { color: #8fd8f0 !important; }

/* Tombol di modal */
body.dark .modal-footer .btn-secondary { color: #e8eaed; border-color: #6a7080; }
body.dark .modal-footer .btn-secondary:hover { background: #3a3a4e; color: #fff; }

/* Filter select di tab Warga */
body.dark select.form-select { background-color: #252535; color: #e8eaed; }
body.dark select.form-select option { background-color: #252535; color: #e8eaed; }

/* Tabel header di tab Meninggal, Pindah, Pendatang */
body.dark .table-dark { background: #2a2a3e !important; color: #e8eaed !important; }
body.dark .table-dark th { background: #2a2a3e !important; color: #d0d5dd !important; border-color: #3a3a5e; }
body.dark .table-success th { background: #1e3a2e !important; color: #e8eaed !important; }
body.dark .table-warning th { background: #3a3520 !important; color: #e8eaed !important; }

/* Baris tabel dengan opacity (meninggal/pindah/pendatang) */
body.dark tr[style*="opacity:0.7"] { color: #b0b6bf; }
body.dark tr[style*="opacity:0.6"] { color: #b0b6bf; }
body.dark tr[style*="opacity:0.7"] td { color: #c0c8d0; }
body.dark tr[style*="opacity:0.6"] td { color: #c0c8d0; }

/* Info badge di atas tabel (count alert) */
body.dark .alert { color: #e8eaed; }
body.dark .alert-info i { color: #8fd8f0; }

/* Pagination info text */
body.dark #paginasiInfo { color: #b0b6bf; }

/* Responsive flex container */
body.dark .d-flex { color: inherit; }

/* Sticky header tabel undangan */
body.dark #tab-undangan thead.sticky-top { background: #2a2a3e !important; }
body.dark #tab-undangan thead.sticky-top th { background: #2a2a3e !important; color: #d0d5dd !important; }

/* ── Fix: baris tabel genap masih putih di dark mode ── */
body.dark .table > tbody > tr > td,
body.dark .table > tbody > tr > th {
  background-color: #1e1e2e !important;
  color: #e0e4ea !important;
}
body.dark .table-striped > tbody > tr:nth-of-type(odd) > td,
body.dark .table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: #1a1a2e !important;
  color: #e0e4ea !important;
}
body.dark .table-hover > tbody > tr:hover > td,
body.dark .table-hover > tbody > tr:hover > th {
  background-color: #2a2a3e !important;
  color: #fff !important;
}
/* Header tabel */
body.dark .table > thead > tr > th {
  background-color: #252535 !important;
  color: #d0d5dd !important;
  border-color: #3a3a5e !important;
}
/* Border semua sel */
body.dark .table > tbody > tr > td {
  border-color: #2a2a3e !important;
}
/* Baris highlight (table-primary, table-warning) */
body.dark .table > tbody > tr.table-primary > td { background-color: #1a3a5c !important; color: #e0e4ea !important; }
body.dark .table > tbody > tr.table-warning > td { background-color: #3a3520 !important; color: #e8eaed !important; }

/* ══════════════════════════════════════════════
   KALENDER JAWA — redesign
   ══════════════════════════════════════════════ */

/* ── Banner header ── */
.kal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 50%, #0288d1 100%);
  border-radius: 16px;
  padding: 18px 24px;
  color: white;
  box-shadow: 0 4px 20px rgba(21,101,192,.35);
}
.kal-banner-left  { display: flex; align-items: center; gap: 14px; }
.kal-banner-icon  { font-size: 2.4rem; line-height: 1; }
.kal-banner-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.kal-banner-sub   { font-size: .82rem; opacity: .8; margin-top: 2px; }
.kal-banner-nav   { display: flex; gap: 8px; align-items: center; }

.kal-nav-btn {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: white;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, transform .1s;
  backdrop-filter: blur(4px);
}
.kal-nav-btn:hover      { background: rgba(255,255,255,.32); transform: translateY(-1px); }
.kal-nav-btn:active     { transform: translateY(0); }
.kal-nav-today          { font-weight: 600; }

/* ── Grid wrapper ── */
.kal-wrap {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

/* ── Header nama hari ── */
.kal-head-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(135deg, #1565c0, #0288d1);
}
.kal-head {
  text-align: center;
  padding: 10px 4px;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.kal-head.ahad  { color: #ffcdd2; }
.kal-head.jumat { color: #c8e6c9; }

/* ── Grid sel ── */
.kal-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.kal-cell {
  border-right: 1px solid #f0f4f8;
  border-bottom: 1px solid #f0f4f8;
  padding: 8px 7px 6px;
  min-height: 82px;
  cursor: pointer;
  transition: background .12s, transform .1s, box-shadow .12s;
  position: relative;
  overflow: hidden;
}
.kal-cell:hover {
  background: #e3f2fd;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(21,101,192,.15);
  transform: scale(1.03);
  border-radius: 8px;
}
.kal-kosong {
  background: #fafbfc;
  cursor: default;
  border-right: 1px solid #f0f4f8;
  border-bottom: 1px solid #f0f4f8;
}
.kal-kosong:hover { transform: none; box-shadow: none; background: #fafbfc; }

/* Angka tanggal Masehi */
.kal-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
}
.kal-num-ahad  { color: #c62828; }
.kal-num-jumat { color: #2e7d32; }

/* Tanggal Jawa */
.kal-jawa-tgl {
  font-size: .62rem;
  color: #78909c;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tanggal Hijriyah */
.kal-hijri-tgl {
  font-size: .60rem;
  color: #7b5ea7;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge pasaran */
.kal-badge-pas {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 3px;
  letter-spacing: .02em;
}
.kal-badge-kliwon { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.kal-badge-pon    { background: #ede7f6; color: #4527a0; border: 1px solid #ce93d8; }
.kal-badge-legi   { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.kal-badge-pahing { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }
.kal-badge-wage   { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }

/* Flag libur */
.kal-libur-flag {
  position: absolute;
  top: 4px; right: 4px;
  font-size: .65rem;
  line-height: 1;
}
.kal-libur-label2 {
  font-size: .55rem;
  color: #c62828;
  margin-top: 2px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── State khusus ── */
.kal-today .kal-num {
  background: linear-gradient(135deg, #1565c0, #0288d1);
  color: white !important;
  box-shadow: 0 2px 8px rgba(21,101,192,.4);
}
.kal-today { background: #e8f4ff; }

.kal-dipilih {
  background: #fffde7 !important;
  box-shadow: inset 0 0 0 2px #f9a825;
  border-radius: 4px;
}
.kal-dipilih .kal-num { background: #f9a825; color: white !important; }

/* Background warna per pasaran */
.kal-bg-kliwon { background: #fff8f0; }
.kal-bg-pon    { background: #f9f4ff; }
.kal-bg-legi   { background: #f4fbf4; }
.kal-bg-pahing { background: #fff4f7; }
.kal-bg-wage   { background: #f0f8ff; }

/* ── Info card kanan ── */
.kal-info-card {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  background: white;
}
.kal-card-today .kal-info-card-header {
  background: linear-gradient(135deg, #1565c0, #0288d1);
  color: white;
}
.kal-info-card-header {
  padding: 10px 16px;
  font-weight: 700;
  font-size: .85rem;
  background: #f8fafc;
  border-bottom: 1px solid #e9ecef;
  color: #1565c0;
}
.kal-info-card-body {
  padding: 14px 16px;
  font-size: .85rem;
}

/* Hari ini detail */
.kal-today-weton {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1565c0;
  line-height: 1.2;
}
.kal-today-neptu {
  display: inline-block;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-top: 4px;
}
.kal-today-jawa {
  font-size: .8rem;
  color: #546e7a;
  margin-top: 6px;
}
.kal-today-wuku {
  font-size: .78rem;
  color: #546e7a;
  margin-top: 2px;
}

/* Detail tabel */
.kal-detail-tbl { width: 100%; font-size: .82rem; }
.kal-detail-tbl td { padding: 4px 0; vertical-align: top; }
.kal-detail-tbl td:first-child { color: #78909c; white-space: nowrap; padding-right: 10px; width: 40%; }
.kal-detail-tbl td:last-child  { font-weight: 500; color: #263238; }

/* Legenda */
.kal-legend-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  font-size: .82rem;
}
.kal-badge-sel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-weight: 700; font-size: .8rem;
}
.kal-badge-today  { background: linear-gradient(135deg,#1565c0,#0288d1); color:white; }
.kal-libur-dot    { background: none; font-size: 1rem; }

/* ── Dark mode ── */
body.dark .kal-wrap          { background: #1e2a3a; box-shadow: 0 2px 16px rgba(0,0,0,.3); }
body.dark .kal-cell          { border-color: #2a3a4a; color: #e2e8f0; }
body.dark .kal-cell:hover    { background: #2a3a4a; }
body.dark .kal-kosong        { background: #161f2a; }
body.dark .kal-jawa-tgl      { color: #90a4ae; }
body.dark .kal-hijri-tgl     { color: #ce93d8; }
body.dark .kal-bg-kliwon     { background: #2d2010; }
body.dark .kal-bg-pon        { background: #21133a; }
body.dark .kal-bg-legi       { background: #0d2010; }
body.dark .kal-bg-pahing     { background: #2a0d18; }
body.dark .kal-bg-wage       { background: #0d1f2d; }
body.dark .kal-today         { background: #1a2f4a; }
body.dark .kal-dipilih       { background: #2d2800 !important; box-shadow: inset 0 0 0 2px #f9a825; }
body.dark .kal-info-card     { background: #1e2a3a; }
body.dark .kal-info-card-header { background: #152030; border-color: #2a3a4a; }
body.dark .kal-detail-tbl td:last-child { color: #e2e8f0; }
body.dark .kal-banner        { box-shadow: 0 4px 20px rgba(0,0,0,.4); }
body.dark .kal-num-ahad      { color: #ef9a9a; }
body.dark .kal-num-jumat     { color: #a5d6a7; }

/* ── Dot legenda lama (kompatibilitas) ── */
.kal-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
