:root {
  --bg: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #dbe3ef;
  --input-bg: #ffffff;
  --input-text: #0f172a;
  --input-placeholder: #94a3b8;
  --id-pill-bg: #dbeafe;
  --id-pill-text: #1e3a8a;
  --status-paid-bg: #d1fae5;
  --status-paid-text: #065f46;
  --status-unpaid-bg: #fef3c7;
  --status-unpaid-text: #92400e;
  --sidebar: linear-gradient(180deg, #0b1635 0%, #08122d 100%);
  --sidebar-text: #d7e3ff;
}

body[data-theme="dark"] {
  --bg: #020617;
  --card: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --input-bg: #0b1220;
  --input-text: #e2e8f0;
  --input-placeholder: #64748b;
  --id-pill-bg: #1e3a8a;
  --id-pill-text: #dbeafe;
  --status-paid-bg: #064e3b;
  --status-paid-text: #a7f3d0;
  --status-unpaid-bg: #78350f;
  --status-unpaid-text: #fde68a;
  --sidebar: linear-gradient(180deg, #020617 0%, #0a1225 100%);
  --sidebar-text: #cbd5e1;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 28%), var(--bg);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

button,
.btn,
a.btn,
input,
select,
textarea {
  min-height: 42px;
}

.app-loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loader-message {
  margin-top: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
}

.app-loader-subtitle {
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: rgba(226, 232, 240, 0.82);
}

.app-loader.hide {
  opacity: 0;
  visibility: hidden;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  transition: grid-template-columns 0.25s ease;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.app-sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.app-layout.sidebar-collapsed .app-sidebar {
  transform: translateX(-110%);
  opacity: 0;
}

.app-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.app-subtitle {
  font-size: 0.76rem;
  opacity: 0.9;
}

.topbar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

.login-brand-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.side-nav {
  display: grid;
  gap: 0.35rem;
}

.side-link {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  display: block;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.side-link:hover,
.side-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateX(2px);
}

.app-content-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.app-topbar {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 90%, white 10%);
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(6px);
}

.app-main {
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.app-footer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: transparent;
}

.app-footer a {
  color: #2563eb;
  text-decoration: none;
}

.bg-white,
.bg-slate-100,
.bg-slate-50,
[class*="rounded-xl shadow"] {
  background: var(--card) !important;
  color: var(--text) !important;
}

.text-slate-500,
.text-slate-600,
.text-slate-700 {
  color: var(--muted) !important;
}

.border,
.border-b {
  border-color: var(--border) !important;
}

table td, table th {
  vertical-align: top;
}

.table-soft thead th {
  font-size: 0.79rem;
  font-weight: 700;
  color: color-mix(in oklab, var(--muted) 84%, var(--text) 16%);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.table-soft tbody tr {
  transition: background 0.2s ease;
}

.table-soft tbody tr:hover {
  background: color-mix(in oklab, var(--card) 92%, #3b82f6 8%);
}

.id-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--id-pill-bg);
  color: var(--id-pill-text);
}

.name-cell {
  font-weight: 600;
  color: var(--text);
  min-width: 120px;
}

.address-cell {
  max-width: 280px;
  line-height: 1.35;
  color: var(--muted);
  font-size: 0.83rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-pill.paid {
  background: var(--status-paid-bg);
  color: var(--status-paid-text);
}

.status-pill.unpaid {
  background: var(--status-unpaid-bg);
  color: var(--status-unpaid-text);
}

.dashboard-hero-card,
.dashboard-update-card {
  border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.08);
}

.dashboard-hero-card {
  background: linear-gradient(135deg, color-mix(in oklab, var(--card) 92%, #eff6ff 8%), var(--card));
  border-radius: 1.25rem;
  padding: 1.2rem;
}

.dashboard-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.8fr);
  gap: 1rem;
  align-items: center;
}

.dashboard-hero-kicker,
.dashboard-section-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2563eb;
}

.dashboard-hero-title,
.dashboard-section-title {
  margin: 0.35rem 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
}

.dashboard-hero-text,
.dashboard-section-text {
  margin-top: 0.55rem;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.dashboard-hero-card--compact {
  padding: 0.9rem 1rem;
}

.dashboard-hero-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-hero-compact-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.dashboard-hero-logo-inline {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 94%, #eff6ff 6%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-hero-logo {
  width: min(100%, 160px);
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(37, 99, 235, 0.14));
}

.dashboard-hero-logo--mini {
  width: 32px;
  max-height: 32px;
  filter: none;
}

.dashboard-hero-title--compact {
  font-size: 1.2rem;
  margin-top: 0.15rem;
}

.dashboard-hero-text--compact {
  margin-top: 0.2rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.dashboard-hero-actions--compact {
  margin-top: 0;
  align-items: center;
}

.dashboard-section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.dashboard-section-head--compact {
  margin-bottom: 0.75rem;
}

.dashboard-section-title--compact {
  font-size: 1.15rem;
}

.dashboard-update-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.8rem;
}

.dashboard-feature-grid,
.dashboard-flow-list {
  display: grid;
  gap: 0.85rem;
}

.dashboard-feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-update-card--compact {
  min-height: auto;
}

.dashboard-bullet-list,
.dashboard-inline-steps {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-bullet-list li,
.dashboard-inline-steps li {
  margin-bottom: 0.38rem;
}

.dashboard-feature-item,
.dashboard-flow-item,
.dashboard-shortcut-card,
.tutorial-step-card {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 97%, #f8fafc 3%);
}

.dashboard-feature-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.8rem;
  border-radius: 1rem;
  padding: 0.95rem;
}

.dashboard-feature-icon,
.dashboard-flow-no,
.tutorial-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: #eff6ff;
  color: #2563eb;
  font-size: 1.1rem;
  font-weight: 800;
}

.dashboard-feature-title,
.dashboard-flow-title,
.tutorial-step-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.18rem;
}

.dashboard-feature-text,
.dashboard-flow-text,
.tutorial-step-text {
  color: var(--muted);
  line-height: 1.58;
  font-size: 0.9rem;
}

.dashboard-flow-item,
.tutorial-step-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.85rem;
  border-radius: 1rem;
  padding: 1rem;
}

.dashboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.dashboard-shortcuts--compact {
  margin-top: 0.9rem;
}

.dashboard-shortcut-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  min-height: 64px;
}

.dashboard-shortcut-card:hover {
  background: color-mix(in oklab, var(--card) 90%, #dbeafe 10%);
  color: #1d4ed8;
}

.dashboard-shortcut-card i {
  font-size: 1.15rem;
}

.tutorial-modal {
  background: var(--card);
  color: var(--text);
  border-radius: 1.25rem;
  border: 1px solid var(--border);
}

body[data-theme="dark"] .dashboard-update-badge,
body[data-theme="dark"] .dashboard-feature-icon,
body[data-theme="dark"] .dashboard-flow-no,
body[data-theme="dark"] .tutorial-step-number {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.stat-card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 96%, #ffffff 4%), var(--card));
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.08);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.table-card-mode .inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-card-mode td[data-label="Aksi"] .inline,
.table-card-mode td[data-label="Aksi"] form,
.table-card-mode td[data-label="Aksi"] .d-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

input,
select,
textarea,
.form-control,
.form-select {
  background: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--border) !important;
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
  color: var(--input-placeholder) !important;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 0.18rem rgba(59, 130, 246, 0.22) !important;
}

.btn-outline-secondary {
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.btn-outline-secondary:hover {
  background: color-mix(in oklab, var(--card) 84%, #334155 16%) !important;
  color: var(--text) !important;
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary,
.btn-outline-primary:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
  color: var(--text) !important;
}

.bg-slate-200,
.bg-slate-100,
.bg-red-100,
.bg-amber-100,
.bg-emerald-100,
.bg-cyan-100,
.bg-sky-100,
.bg-white {
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bg-slate-200 {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.bg-slate-100 {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.bg-red-100 {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.bg-amber-100 {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.bg-emerald-100 {
  background: #d1fae5 !important;
  color: #065f46 !important;
}

.bg-cyan-100 {
  background: #cffafe !important;
  color: #155e75 !important;
}

.bg-sky-100 {
  background: #e0f2fe !important;
  color: #075985 !important;
}

body[data-theme="dark"] .bg-slate-200 {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .bg-slate-100 {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body[data-theme="dark"] .bg-red-100 {
  background: rgba(127, 29, 29, 0.9) !important;
  color: #fecaca !important;
}

body[data-theme="dark"] .bg-amber-100 {
  background: rgba(120, 53, 15, 0.95) !important;
  color: #fde68a !important;
}

body[data-theme="dark"] .bg-emerald-100 {
  background: rgba(6, 78, 59, 0.95) !important;
  color: #a7f3d0 !important;
}

body[data-theme="dark"] .bg-cyan-100 {
  background: rgba(22, 78, 99, 0.95) !important;
  color: #a5f3fc !important;
}

body[data-theme="dark"] .bg-sky-100 {
  background: rgba(12, 74, 110, 0.95) !important;
  color: #bae6fd !important;
}

body[data-theme="dark"] .text-red-800,
body[data-theme="dark"] .text-red-700,
body[data-theme="dark"] .text-amber-800,
body[data-theme="dark"] .text-amber-700,
body[data-theme="dark"] .text-emerald-800,
body[data-theme="dark"] .text-emerald-700,
body[data-theme="dark"] .text-slate-700,
body[data-theme="dark"] .text-slate-600,
body[data-theme="dark"] .text-slate-500 {
  color: inherit !important;
}

body[data-theme="dark"] .table,
body[data-theme="dark"] .table td,
body[data-theme="dark"] .table th,
body[data-theme="dark"] .table-light,
body[data-theme="dark"] .table-light th {
  background-color: transparent !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

body[data-theme="dark"] .table-success {
  background: rgba(6, 95, 70, 0.2) !important;
  color: #a7f3d0 !important;
}

.badge.text-bg-success {
  background: #0f766e !important;
  color: #ecfeff !important;
}

.grid > section,
.app-main > section,
.app-main > div {
  animation: riseIn 0.35s ease both;
}

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

.js-table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.js-table-search {
  min-width: 220px;
  max-width: 360px;
}

.js-table-search-wrap {
  flex: 1 1 260px;
}

.js-table-pager {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.js-table-pager .btn {
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
}

.js-page-size-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.js-page-size-wrap select {
  min-width: 74px;
}

.js-table-info {
  font-size: 0.8rem;
  color: var(--muted);
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.info-card {
  background: linear-gradient(180deg, color-mix(in oklab, var(--card) 96%, #ffffff 4%), var(--card));
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

.info-card .info-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-card .info-value {
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
}

.info-card .info-note {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.bill-layout-table {
  min-width: 1120px;
}

.bill-meta,
.bill-meter,
.bill-charge,
.bill-payment {
  display: grid;
  gap: 0.24rem;
}

.bill-subline {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.bill-highlight {
  color: #059669;
  font-weight: 800;
}

.bill-actions {
  display: grid;
  gap: 0.5rem;
  min-width: 180px;
}

.bill-action-form {
  display: grid;
  gap: 0.4rem;
}

.bill-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bill-inline-note {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.announcement-banner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

.announcement-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.55);
}

.announcement-banner-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.announcement-banner-text {
  color: inherit;
  line-height: 1.6;
  font-size: 0.92rem;
}

.announcement-banner-audience {
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0.8;
}

.announcement-info {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1e3a8a;
  border-color: #bfdbfe;
}

.announcement-success {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  color: #065f46;
  border-color: #a7f3d0;
}

.announcement-warning {
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  color: #92400e;
  border-color: #fde68a;
}

.announcement-danger {
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  color: #991b1b;
  border-color: #fecaca;
}

body[data-theme="dark"] .announcement-info {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.32), rgba(15, 23, 42, 0.95));
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.45);
}

body[data-theme="dark"] .announcement-success {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.35), rgba(15, 23, 42, 0.95));
  color: #d1fae5;
  border-color: rgba(52, 211, 153, 0.4);
}

body[data-theme="dark"] .announcement-warning {
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.4), rgba(15, 23, 42, 0.95));
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
}

body[data-theme="dark"] .announcement-danger {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(15, 23, 42, 0.95));
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.36);
}

.announcement-login-wrap {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
}

.announcement-admin-card {
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
}

.announcement-admin-title {
  font-size: 1rem;
  font-weight: 800;
}

.announcement-admin-meta,
.announcement-admin-date {
  font-size: 0.8rem;
  opacity: 0.85;
}

.announcement-admin-message {
  margin-top: 0.75rem;
  line-height: 1.65;
}

.announcement-admin-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.app-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(7px);
}

.app-popup-card {
  width: min(100%, 560px);
  border-radius: 1.35rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.32);
}

.app-popup-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem 0.4rem;
}

.app-popup-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.app-popup-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 0.2rem;
}

.app-popup-close {
  border: 0;
  background: transparent;
  color: inherit;
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.app-popup-close:hover {
  background: rgba(255,255,255,0.16);
}

.app-popup-body {
  padding: 0.2rem 1.1rem 1.1rem;
}

.app-popup-text {
  line-height: 1.7;
  font-size: 0.95rem;
}

.app-popup-meta {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  opacity: 0.85;
}

.app-popup-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.table-card-mode td[data-label] {
  position: relative;
}

.install-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.48);
  backdrop-filter: blur(8px);
}

.install-popup-card {
  width: min(100%, 680px);
  background: var(--card);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: installPromptUp 0.28s ease;
}

.install-popup-head {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.install-popup-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.install-popup-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-popup-icon {
  width: 32px;
  height: 32px;
}

.install-popup-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.install-popup-subtitle {
  opacity: 0.9;
  font-size: 0.95rem;
}

.install-popup-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.install-popup-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.install-popup-body {
  padding: 1.25rem;
}

.install-popup-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 1rem;
}

.install-popup-note {
  background: #fff7db;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.install-steps {
  display: grid;
  gap: 0.85rem;
}

.install-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 96%, #f8fafc 4%);
  border-radius: 1rem;
  padding: 1rem;
}

.install-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 1rem;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

body[data-theme="dark"] .install-step-icon {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.install-step-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.18rem;
}

.install-step-text {
  color: var(--muted);
  line-height: 1.6;
}

.install-popup-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.install-main-btn {
  min-width: 150px;
  font-weight: 700;
}

@keyframes installPromptUp {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ts-control,
.ts-dropdown {
  border-color: var(--border) !important;
  background: var(--card) !important;
  color: var(--text) !important;
}

.ts-control input::placeholder {
  color: var(--input-placeholder) !important;
}

@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 30;
    transition: left 0.2s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    transform: none;
    opacity: 1;
  }

  .app-layout.sidebar-open .app-sidebar {
    left: 0;
  }

  .app-layout.sidebar-collapsed .app-sidebar {
    left: -280px;
    transform: none;
    opacity: 1;
  }

  .app-topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
  }

  .app-topbar > div {
    width: 100%;
  }

  .app-topbar > div:last-child {
    justify-content: stretch !important;
  }

  .app-topbar > div:last-child .btn,
  .app-topbar > div:last-child .badge {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
    text-align: center;
  }

  .app-main {
    padding: 0.8rem;
  }

  .js-table-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .js-table-search {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .js-table-pager {
    width: 100%;
    justify-content: space-between;
  }

  .js-page-size-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .js-page-size-wrap select {
    min-width: 88px;
  }

  .dashboard-hero-grid,
  .dashboard-feature-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-compact-row,
  .dashboard-hero-compact-main {
    align-items: flex-start;
  }

  .stats-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-soft th,
  .table-soft td {
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    padding-right: 0.5rem !important;
  }

  .address-cell {
    max-width: 180px;
  }

  .id-pill,
  .status-pill {
    font-size: 0.7rem;
  }

  .mobile-form-actions,
  .bill-action-links,
  .bill-actions {
    width: 100%;
  }

  .mobile-form-actions > *,
  .bill-action-links > *,
  .bill-actions > * {
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .table-card-mode {
    min-width: 0;
  }

  .table-card-mode thead {
    display: none;
  }

  .table-card-mode,
  .table-card-mode tbody,
  .table-card-mode tr,
  .table-card-mode td {
    display: block;
    width: 100%;
  }

  .table-card-mode tbody tr {
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin: 0.85rem;
    padding: 0.35rem 0.85rem;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
    background: color-mix(in oklab, var(--card) 97%, #ffffff 3%);
  }

  .table-card-mode tbody tr:hover {
    background: color-mix(in oklab, var(--card) 94%, #3b82f6 6%);
  }

  .table-card-mode td[data-label] {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.55rem 0 !important;
    border-bottom: 1px dashed var(--border) !important;
  }

  .table-card-mode td[data-label]::before {
    content: attr(data-label);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .table-card-mode td[data-label]:last-child {
    border-bottom: 0 !important;
  }

  .bill-actions {
    min-width: 0;
  }

  .table-card-mode td[data-label="Aksi"] .btn,
  .table-card-mode td[data-label="Aksi"] button,
  .table-card-mode td[data-label="Aksi"] a,
  .table-card-mode td[data-label="Aksi"] input,
  .table-card-mode td[data-label="Aksi"] select {
    width: 100%;
  }

  .table-card-mode td[data-label="Aksi"] form {
    width: 100%;
  }
}

@media (max-width: 640px) {
  button,
  .btn,
  a.btn,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .dashboard-hero-card,
  .dashboard-update-card,
  .tutorial-step-card,
  .dashboard-feature-item,
  .dashboard-flow-item,
  .dashboard-shortcut-card {
    border-radius: 1rem;
  }

  .dashboard-section-head {
    flex-direction: column;
  }

  .dashboard-feature-item,
  .dashboard-flow-item,
  .tutorial-step-card {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-compact-main {
    width: 100%;
  }

  .dashboard-hero-actions--compact {
    width: 100%;
    margin-top: 0.2rem;
  }

  .dashboard-feature-icon,
  .dashboard-flow-no,
  .tutorial-step-number {
    width: 42px;
    height: 42px;
    border-radius: 0.85rem;
  }

  .dashboard-hero-actions > *,
  .dashboard-shortcuts > * {
    width: 100%;
  }

  .stats-grid-4 {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    padding: 0.65rem;
  }

  .app-topbar > div:last-child .btn,
  .app-topbar > div:last-child .badge {
    flex: 1 1 100%;
  }

  .app-main {
    padding: 0.65rem;
  }

  .bg-white,
  [class*="rounded-xl shadow"] {
    border-radius: 1rem !important;
  }

  .js-table-tools {
    gap: 0.65rem;
  }

  .js-table-pager {
    gap: 0.5rem;
  }

  .js-table-pager .btn,
  .js-page-size-wrap,
  .js-table-info {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .table-card-mode tbody tr {
    margin: 0.75rem 0;
    padding: 0.2rem 0.75rem;
  }

  .table-card-mode td[data-label] {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .table-card-mode td[data-label]::before {
    margin-bottom: 0.15rem;
  }

  .name-cell {
    min-width: 0;
  }

  .address-cell {
    max-width: 100%;
  }

  .install-popup-backdrop {
    padding: 0.6rem;
  }

  .install-popup-card {
    border-radius: 1.25rem;
  }

  .install-popup-head,
  .install-popup-body {
    padding: 1rem;
  }

  .install-popup-title {
    font-size: 1.35rem;
  }

  .install-step {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .install-step-icon {
    width: 42px;
    height: 42px;
    border-radius: 0.9rem;
  }

  .install-popup-actions > * {
    width: 100%;
  }

  .announcement-banner {
    grid-template-columns: 1fr;
  }

  .announcement-banner-audience {
    text-align: left;
  }

  .announcement-login-wrap {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 0.65rem;
  }

  .app-popup-backdrop {
    padding: 0.7rem;
  }

  .app-popup-actions .btn {
    width: 100%;
  }
}

/* PDAM-style operational upgrade */
.pdam-hero,
.pdam-command-center {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: stretch;
  background: linear-gradient(135deg, rgba(14,165,233,.14), rgba(20,184,166,.12)), #fff;
  border: 1px solid rgba(14,165,233,.18);
  border-radius: 1.25rem;
  padding: 1.1rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}
.pdam-command-copy { max-width: 34rem; }
.pdam-command-copy h3 { margin: .2rem 0 .35rem; font-size: 1.35rem; font-weight: 850; color: #0f172a; }
.pdam-command-copy p { margin: 0; color: #64748b; }
.pdam-command-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: .75rem; flex: 1; }
.pdam-command-card {
  display: block;
  text-decoration: none;
  color: #0f172a;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 1rem;
  padding: .85rem;
  min-height: 96px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pdam-command-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,23,42,.12); color: #0f172a; }
.pdam-command-card span { display: block; color: #64748b; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.pdam-command-card b { display: block; margin-top: .25rem; font-size: 1.32rem; line-height: 1.15; }
.pdam-command-card small { display: block; margin-top: .3rem; color: #64748b; }
.pdam-command-card.warning b { color: #d97706; }
.pdam-command-card.success b { color: #059669; }
.pdam-command-card.danger b { color: #dc2626; }
.meter-progress { height: .55rem; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: .4rem; }
.meter-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0ea5e9, #14b8a6); }
.meter-preview-card {
  border: 1px solid rgba(14,165,233,.18);
  background: linear-gradient(135deg, rgba(240,249,255,.95), rgba(240,253,250,.95));
  border-radius: 1rem;
  padding: .8rem;
}
.meter-preview-title { font-size: .78rem; color: #0369a1; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .45rem; }
.meter-preview-grid { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; font-size: .88rem; }
.meter-preview-grid span { color: #64748b; }
.meter-preview-warning { margin-top: .55rem; padding: .5rem .65rem; border-radius: .75rem; color: #92400e; background: #fef3c7; font-size: .82rem; font-weight: 700; }
.bulk-meter-table input { min-width: 130px; }
.bulk-preview { min-width: 170px; font-weight: 750; }
.anomaly-card { display:flex; justify-content:space-between; gap:.75rem; align-items:center; border:1px solid #e2e8f0; border-radius: .9rem; padding:.7rem .8rem; background:#fff; }
.anomaly-card.warning { border-color:#fde68a; background:#fffbeb; }
.anomaly-card.danger { border-color:#fecaca; background:#fef2f2; }
.wa-template { width: 260px; min-height: 72px; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .55rem; font-size: .78rem; color: #334155; background: #f8fafc; }
@media (max-width: 1100px) { .pdam-command-center, .pdam-hero { flex-direction: column; } .pdam-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pdam-command-grid { grid-template-columns: 1fr; } .wa-template { width: 100%; } }

/* Admin tutorial page */
.admin-tutorial-hero { background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(20,184,166,.14)), #fff; }
.tutorial-admin-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .85rem; }
.tutorial-admin-card { display:flex; flex-direction:column; gap:.25rem; text-decoration:none; color:#0f172a; background:#fff; border:1px solid rgba(148,163,184,.24); border-radius:1rem; padding:1rem; box-shadow:0 12px 28px rgba(15,23,42,.06); }
.tutorial-admin-card:hover { color:#0f172a; transform:translateY(-2px); box-shadow:0 18px 36px rgba(15,23,42,.10); }
.tutorial-admin-card i { font-size:1.3rem; color:#0ea5e9; }
.tutorial-admin-card b { font-size:.95rem; }
.tutorial-admin-card span { color:#64748b; font-size:.8rem; }
.tutorial-section { background:#fff; border:1px solid rgba(148,163,184,.22); border-radius:1.2rem; padding:1.1rem; margin-bottom:1rem; box-shadow:0 14px 34px rgba(15,23,42,.06); scroll-margin-top:1rem; }
.tutorial-section-head { display:flex; gap:.85rem; align-items:flex-start; margin-bottom:1rem; }
.tutorial-section-head > span { width:2.5rem; height:2.5rem; border-radius:.9rem; display:grid; place-items:center; background:linear-gradient(135deg,#0ea5e9,#14b8a6); color:#fff; font-weight:900; }
.tutorial-section-head h3 { margin:0; font-size:1.15rem; font-weight:850; color:#0f172a; }
.tutorial-section-head p { margin:.15rem 0 0; color:#64748b; font-size:.9rem; }
.tutorial-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.85rem; }
.tutorial-step, .tutorial-panel { border:1px solid #e2e8f0; background:#f8fafc; border-radius:1rem; padding:.95rem; }
.tutorial-step b, .tutorial-panel h4 { display:block; margin:0 0 .45rem; color:#0f172a; font-weight:850; }
.tutorial-step p, .tutorial-panel li, .tutorial-flow-list li, .tutorial-faq p { color:#475569; font-size:.9rem; }
.tutorial-step a { font-size:.84rem; font-weight:800; color:#0284c7; text-decoration:none; }
.tutorial-flow-list { display:grid; gap:.55rem; margin:0; padding-left:1.25rem; }
.tutorial-flow-list li { background:#f8fafc; border:1px solid #e2e8f0; border-radius:.85rem; padding:.75rem .85rem; }
.tutorial-two-col { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.tutorial-panel ul { margin:0 0 .8rem; padding-left:1.15rem; }
.tutorial-warning { background:#fffbeb; color:#92400e; border:1px solid #fde68a; border-radius:1rem; padding:.85rem; margin-top:1rem; font-size:.9rem; }
.tutorial-faq { display:grid; gap:.65rem; }
.tutorial-faq details { border:1px solid #e2e8f0; border-radius:.9rem; padding:.8rem .9rem; background:#f8fafc; }
.tutorial-faq summary { cursor:pointer; font-weight:850; color:#0f172a; }
.tutorial-checklist { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.6rem; }
.tutorial-checklist label { display:flex; align-items:center; gap:.55rem; background:#f8fafc; border:1px solid #e2e8f0; border-radius:.85rem; padding:.75rem; color:#334155; font-weight:700; }
@media (max-width: 1180px) { .tutorial-admin-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } .tutorial-steps { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) { .tutorial-admin-grid, .tutorial-steps, .tutorial-two-col, .tutorial-checklist { grid-template-columns:1fr; } }

/* Discount clarity in bills */
.discount-line { color:#be123c; font-size:.82rem; margin-top:.2rem; }
.discount-preview { display:grid; grid-template-columns:1fr; gap:.15rem; background:#f8fafc; border:1px solid #e2e8f0; border-radius:.75rem; padding:.5rem .65rem; color:#475569; font-size:.78rem; }
.discount-preview b { color:#0f172a; }
.discount-input-wrap { display:grid; gap:.2rem; color:#64748b; font-size:.72rem; font-weight:800; }
.compact-discount-form { background:#eef2ff; border:1px solid #c7d2fe; border-radius:.85rem; padding:.55rem; }
