/* ui-override.css — Tampilan Resmi Layanan Air Minum (Pola PDAM Perumda Tugu Tirta)
   Skala jarak kelipatan 8px (8px, 16px, 24px, 32px), satu bahasa kartu, ikon garis SVG konsisten,
   kontras tinggi untuk mode terang & gelap, ramah orang tua/awam. */

body {
  background: #f4f7fb;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ---- Ikon SVG Garis Profesional (Lucide Style) ---- */
.ui-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn .ui-icon,
.role-btn .ui-icon,
.theme-toggle-btn .ui-icon,
.db-pill .ui-icon {
  width: 18px;
  height: 18px;
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Brandbar Biru Resmi PDAM ---- */
.top-banner {
  background: #0b2a6b !important;
  color: #ffffff;
  border-bottom: 3px solid #0a4fb0;
  border-radius: 0;
  padding: 16px 0;
  margin: 0;
}

.top-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-banner h1 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 !important;
  box-shadow: none;
  flex-shrink: 0;
}

.brand-icon .brand-logo-img,
.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  background: transparent;
}

.role-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.db-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.db-pill:hover {
  background: rgba(255, 255, 255, 0.22);
}

.db-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

.db-pill.online .db-dot {
  background: #22c55e;
}

.db-pill.demo .db-dot {
  background: #f59e0b;
}

.role-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.role-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.role-btn.active {
  background: #ffffff;
  color: #0b2a6b;
  border-color: #ffffff;
  font-weight: 700;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ---- Hero Banner Biru PDAM ---- */
.perumda-hero {
  padding: 24px 0 16px;
}

.perumda-hero .customer-service-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(120deg, #0b2a6b 0%, #0a4fb0 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 24px 32px;
  gap: 24px;
  margin-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.perumda-hero .customer-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.perumda-hero h1 {
  color: #ffffff;
  font-size: 26px;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 0;
}

.perumda-hero p {
  margin: 0;
  color: #e2e8f0;
  font-size: 15px;
  line-height: 1.6;
  max-width: 780px;
}

.perumda-hero .customer-hero-icon,
.customer-hero-logo-wrap {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  border-radius: 50% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  overflow: hidden;
  padding: 0 !important;
}

.perumda-hero .customer-hero-icon img,
.customer-hero-logo {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: contain;
  display: block;
  background: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

/* ---- Navigasi Menu Admin (Seragam, Tinggi Min 48px, Font 16px, Ikon Garis) ---- */
.main-nav {
  background: #ffffff;
  border-bottom: 1px solid #d0d7de;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  margin-bottom: 24px;
}

.main-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-tab {
  min-height: 48px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-tab:hover {
  color: #0a4fb0;
  background: #eff6ff;
}

.nav-tab.active {
  color: #ffffff;
  background: #0a4fb0;
  border-color: #0a4fb0;
}

.nav-badge {
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

/* ---- Stepper & Layout Portal Warga (Pola PDAM Perumda Tugu Tirta) ---- */
.pdam-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px 0 24px;
  font-size: 15px;
  font-weight: 600;
  color: #475569;
}

.pdam-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
}

.pdam-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
}

.pdam-step.active {
  color: #0a4fb0;
  font-weight: 700;
}

.pdam-step.active .pdam-step-num {
  background: #0a4fb0;
  color: #ffffff;
}

.pdam-step-sep {
  color: #94a3b8;
  font-weight: 700;
  padding: 0 4px;
}

.pdam-warga-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.pdam-sidebar {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 16px;
}

.pdam-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.pdam-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdam-sidebar-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.pdam-sidebar-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #0a4fb0;
}

.pdam-sidebar-btn.active {
  background: #0a4fb0;
  border-color: #0a4fb0;
  color: #ffffff;
}

.pdam-main-col {
  min-width: 0;
  width: 100%;
}

/* ---- Form Cek Tagihan 2 Field ---- */
.pdam-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.pdam-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ---- Kartu Data Pelanggan (Daftar Label : Nilai) ---- */
.pdam-customer-info-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #e2e8f0;
}

.pdam-info-row {
  display: grid;
  grid-template-columns: 220px 16px minmax(0, 1fr);
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 16px;
}

.pdam-info-label {
  font-weight: 600;
  color: #475569;
}

.pdam-info-colon {
  font-weight: 700;
  color: #475569;
  text-align: center;
}

.pdam-info-value {
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

/* ---- Kartu Konsisten (Satu Bahasa Desain, Skala 8px) ---- */
.card {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  margin-bottom: 24px;
  padding: 24px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.card > .card-header {
  background: #0a4fb0;
  color: #ffffff;
  padding: 16px 24px;
  margin: -24px -24px 24px -24px;
  border-bottom: 1px solid #083e8c;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.card > .card-body {
  padding: 0;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
}

.card-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 400;
}

.section-heading {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 24px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-card {
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.sub-card.important {
  background: #eff6ff;
  border-color: #93c5fd;
}

/* ---- Tabel Rapi & Tidak Melebar Keluar Layar 1920px ---- */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  box-sizing: border-box;
}

table.data-table,
.table.cart {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  table-layout: auto;
}

.data-table th,
.table.cart th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.data-table td,
.table.cart td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  color: #0f172a;
  word-break: break-word;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td,
.table.cart tr:hover td {
  background: #f8fafc;
}

/* ---- Tombol (Area Klik Minimal 48px untuk Utama, Kontras Tinggi) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary {
  background: #0a4fb0;
  color: #ffffff;
  border-color: #0a4fb0;
}

.btn-primary:hover {
  background: #083e8c;
  border-color: #083e8c;
}

.btn-success {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

.btn-success:hover {
  background: #166534;
}

.btn-warning {
  background: #b45309;
  color: #ffffff;
  border-color: #b45309;
}

.btn-danger {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

.btn-danger:hover {
  background: #991b1b;
}

.btn-outline {
  background: #ffffff;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #64748b;
}

.btn-wa {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}

/* ---- Status Badge Resmi (Hanya Status yang Berbeda Warna) ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge.status-lunas,
.status-badge.komplain-selesai {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}

.status-badge.status-belum,
.status-badge.komplain-baru {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #fca5a5;
}

.status-badge.status-sebagian,
.status-badge.komplain-diproses {
  background: #fef3c7;
  color: #78350f;
  border-color: #fcd34d;
}

/* ---- Rekap Box (Satu Bahasa Gaya Kartu Statistik) ---- */
.rekap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.rekap-box {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-left: 4px solid #0a4fb0;
  border-radius: 8px;
  padding: 16px;
}

.rekap-box .rekap-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-transform: none;
  letter-spacing: 0;
  display: block;
  margin-bottom: 8px;
}

.rekap-box .rekap-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  display: block;
}

.rekap-box .rekap-sub {
  font-size: 13px;
  color: #64748b;
  display: block;
  margin-top: 4px;
}

.rekap-box.highlight-primary {
  background: #ffffff;
  border-color: #d0d7de;
  border-left: 4px solid #0a4fb0;
}

.rekap-box.highlight-lunas {
  background: #ffffff;
  border-color: #d0d7de;
  border-left: 4px solid #16a34a;
}

.rekap-box.highlight-belum {
  background: #ffffff;
  border-color: #d0d7de;
  border-left: 4px solid #dc2626;
}

.rekap-box.highlight-sebagian {
  background: #ffffff;
  border-color: #d0d7de;
  border-left: 4px solid #d97706;
}

/* ---- Alert Box ---- */
.alert-box {
  border-radius: 8px;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

.alert-warning {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
}

.alert-info {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

/* ---- Filter Bar & Form Control ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.filter-bar .form-group {
  margin: 0;
  min-width: 180px;
  flex: 1;
}

.filter-bar label,
.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #0a4fb0;
  box-shadow: 0 0 0 3px rgba(10, 79, 176, 0.16);
}

.form-group {
  margin-bottom: 16px;
}

.code-pill,
.area-pill {
  display: inline-block;
  background: #eff6ff;
  color: #0a4fb0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.area-pill {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.pagination-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.pagination-info {
  font-size: 14px;
  color: #475569;
  margin: 0;
}

/* ---- Role Banner ---- */
.role-status-banner {
  border-radius: 8px;
  padding: 16px;
  font-size: 15px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.role-status-banner.admin-banner {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
}

.role-status-banner.warga-banner {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
}

/* ---- Text Utilities untuk Nominal Tabel ---- */
.text-paid {
  color: #15803d;
  font-weight: 700;
}

.text-unpaid {
  color: #b91c1c;
  font-weight: 700;
}

.text-muted-note {
  color: #475569;
  font-size: 14px;
}

/* ---- Print ---- */
.print-only-header {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }
  .print-only-header {
    display: block !important;
    text-align: center;
    margin-bottom: 16px;
  }
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }
  .card > .card-header {
    background: #eee !important;
    color: #000 !important;
  }
  body {
    background: #fff;
  }
  main.container {
    padding: 0;
  }
}

/* ---- Mode Gelap Kontras Tinggi (Perbaikan Bug #6) ---- */
[data-theme="dark"] body {
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="dark"] .top-banner {
  background: #091e4a !important;
  border-bottom-color: #1d4ed8;
}

[data-theme="dark"] .perumda-hero .customer-service-hero {
  background: linear-gradient(120deg, #091e4a 0%, #0b3b8c 100%);
  border-color: #1e3a8a;
}

[data-theme="dark"] .main-nav {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .nav-tab {
  color: #e2e8f0;
}

[data-theme="dark"] .nav-tab:hover {
  background: #334155;
  color: #93c5fd;
}

[data-theme="dark"] .nav-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .pdam-stepper,
[data-theme="dark"] .pdam-sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .rekap-box,
[data-theme="dark"] .sub-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .sub-card.important {
  background: #172554;
  border-color: #1d4ed8;
}

[data-theme="dark"] .card > .card-header {
  background: #1e3a8a;
  border-bottom-color: #1d4ed8;
}

[data-theme="dark"] .pdam-sidebar-title,
[data-theme="dark"] .section-heading,
[data-theme="dark"] .pdam-info-value,
[data-theme="dark"] .rekap-box .rekap-value,
[data-theme="dark"] .filter-bar label,
[data-theme="dark"] .form-group label {
  color: #f8fafc;
}

[data-theme="dark"] .pdam-sidebar-title,
[data-theme="dark"] .pdam-customer-info-list,
[data-theme="dark"] .pdam-info-row,
[data-theme="dark"] .pagination-bar {
  border-color: #334155;
}

[data-theme="dark"] .pdam-info-label,
[data-theme="dark"] .pdam-info-colon,
[data-theme="dark"] .rekap-box .rekap-label,
[data-theme="dark"] .rekap-box .rekap-sub,
[data-theme="dark"] .pagination-info,
[data-theme="dark"] .text-muted-note {
  color: #cbd5e1;
}

[data-theme="dark"] .pdam-step {
  color: #cbd5e1;
}

[data-theme="dark"] .pdam-step-num {
  background: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .pdam-step.active {
  color: #60a5fa;
}

[data-theme="dark"] .pdam-step.active .pdam-step-num {
  background: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .pdam-sidebar-btn {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .pdam-sidebar-btn:hover {
  background: #334155;
  border-color: #475569;
  color: #93c5fd;
}

[data-theme="dark"] .pdam-sidebar-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

[data-theme="dark"] .filter-bar {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .form-control {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

[data-theme="dark"] .form-control::placeholder {
  color: #94a3b8;
}

[data-theme="dark"] .table-responsive {
  border-color: #334155;
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .table.cart th {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .data-table td,
[data-theme="dark"] .table.cart td {
  color: #f8fafc;
  border-color: #334155;
}

[data-theme="dark"] .data-table tr:hover td,
[data-theme="dark"] .table.cart tr:hover td {
  background: #263349;
}

[data-theme="dark"] .btn-outline {
  background: #0f172a;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .btn-outline:hover {
  background: #334155;
}

[data-theme="dark"] .code-pill {
  background: #1e3a8a;
  color: #93c5fd;
  border-color: #2563eb;
}

[data-theme="dark"] .area-pill {
  background: #334155;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .status-badge.status-lunas,
[data-theme="dark"] .status-badge.komplain-selesai {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}

[data-theme="dark"] .status-badge.status-belum,
[data-theme="dark"] .status-badge.komplain-baru {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #dc2626;
}

[data-theme="dark"] .status-badge.status-sebagian,
[data-theme="dark"] .status-badge.komplain-diproses {
  background: #78350f;
  color: #fde68a;
  border-color: #d97706;
}

[data-theme="dark"] .text-paid {
  color: #4ade80;
}

[data-theme="dark"] .text-unpaid {
  color: #f87171;
}

[data-theme="dark"] .role-status-banner.admin-banner {
  background: #172554;
  border-color: #1d4ed8;
  color: #dbeafe;
}

[data-theme="dark"] .role-status-banner.warga-banner {
  background: #052e16;
  border-color: #15803d;
  color: #dcfce7;
}

/* ---- Modal Aplikasi Umum (Tidak Menutupi Header Brandbar) ---- */
.modal-backdrop {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 180;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal-box {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  margin: 0 auto;
}

/* ---- Modal Popup Formulir Pengaduan ---- */
.pengaduan-modal-backdrop {
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 1060;
  padding: 16px 24px 92px;
  overflow-y: auto;
}

.pengaduan-modal-box {
  background: #ffffff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.28);
  animation: pgdSlideUp 0.22s ease-out;
}

@keyframes pgdSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pengaduan-modal-header {
  background: linear-gradient(120deg, #0b2a6b 0%, #0a4fb0 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.pengaduan-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pengaduan-modal-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  object-fit: contain;
  flex-shrink: 0;
}

.pengaduan-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}

.pengaduan-modal-slogan {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  margin: 2px 0 0;
}

.pengaduan-modal-close {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.pengaduan-contact-bar {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #1e3a8a;
}

.pengaduan-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #15803d;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.pengaduan-modal-body {
  padding: 20px;
}

.pengaduan-modal-footer-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
  text-align: center;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

[data-theme="dark"] .modal-box,
[data-theme="dark"] .pengaduan-modal-box {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .pengaduan-contact-bar {
  background: #172554;
  border-bottom-color: #1e3a8a;
  color: #dbeafe;
}

[data-theme="dark"] .pengaduan-modal-footer-note {
  border-top-color: #334155;
  color: #cbd5e1;
}

/* ---- Floating Button Pengaduan (Fixed Pojok Kanan Bawah) ---- */
.pengaduan-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  background: linear-gradient(135deg, #0b2a6b 0%, #0a4fb0 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(11, 42, 107, 0.36);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pengaduan-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 42, 107, 0.45);
}

.pengaduan-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.pengaduan-fab-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pengaduan-fab-badge {
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

.pengaduan-monitor-card {
  border-left: 4px solid #0a4fb0;
}

.pengaduan-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

/* ---- Responsif Mobile & Tablet (Stack Vertikal Rapi Kelipatan 8px) ---- */
@media (max-width: 900px) {
  .pdam-warga-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .top-banner-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .role-switcher {
    width: 100%;
  }
  .role-btn,
  .theme-toggle-btn,
  .db-pill {
    flex: 1 1 auto;
    justify-content: center;
  }
  .perumda-hero .customer-service-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .perumda-hero h1 {
    font-size: 22px;
  }
  .pdam-check-grid {
    grid-template-columns: 1fr;
  }
  .pdam-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .pdam-info-colon {
    display: none;
  }
  .card {
    padding: 16px;
  }
  .card > .card-header {
    padding: 16px;
    margin: -16px -16px 16px -16px;
  }
  .pengaduan-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .modal-backdrop {
    top: 60px;
    padding: 12px;
  }
  .pengaduan-modal-backdrop {
    top: 56px;
    align-items: center;
    justify-content: center;
    padding: 12px 12px 76px;
  }
  .modal-box,
  .pengaduan-modal-box {
    max-width: 100%;
    max-height: calc(100vh - 96px);
  }
}

@media (max-width: 640px) {
  .perumda-hero .customer-hero-icon,
  .customer-hero-logo-wrap {
    width: 80px;
    height: 80px;
  }
}
