/* ============================================================
   APP BANJAR — THEME: Dark Sidebar + Purple Gradient
   ============================================================ */

:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f4f9;
  --sidebar-from: #1b2a4d;
  --sidebar-to: #0c1426;
  --sidebar-text: #aab2c5;
  --sidebar-text-active: #ffffff;
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --ok: #16a34a;
  --danger: #ef4444;
  --radius: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: radial-gradient(circle at top left, #24365f, var(--sidebar-from) 45%, var(--sidebar-to) 100%);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.topbar-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,0.35);
}
.topbar-brand-name {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.topbar-brand-sub {
  color: #8a92b0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
}
.hamburger:hover {
  background: rgba(255,255,255,0.08);
}

/* ============================================================
   ACCOUNT
   ============================================================ */
.account {
  position: relative;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 30px;
}
.account-btn:hover {
  background: rgba(255,255,255,0.08);
}

.account-btn .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.account-btn .caret {
  font-size: 9px;
  color: rgba(255,255,255,0.6);
}

.account-menu {
  display: none;
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  min-width: 190px;
  z-index: 40;
  overflow: hidden;
}
.account-menu.open {
  display: block;
}

.account-menu .info {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.account-menu .info .name {
  font-weight: 700;
  font-size: 13px;
}

.account-menu .info .role-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  color: var(--accent-1);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
}

.account-menu .info .online {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ok);
  margin-top: 8px;
  font-weight: 600;
}
.account-menu .info .online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.account-menu button.linklike {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
}
.account-menu button.linklike:hover {
  background: #fef2f2;
}

/* ============================================================
   SIDEBAR — DARK
   ============================================================ */
.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: 220px;
  background: radial-gradient(circle at top left, #24365f, var(--sidebar-from) 35%, var(--sidebar-to) 100%);
  padding: 18px 0 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-links {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
}

.sidebar-links::-webkit-scrollbar {
  width: 3px;
}
.sidebar-links::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sidebar-text-active);
}

.sidebar-link.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.sidebar-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 12px;
}

.sidebar-version {
  flex-shrink: 0;
  padding: 10px 18px 14px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main.container {
  flex: 1;
  padding: 24px 28px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 2px 0;
  color: var(--ink);
  letter-spacing: -0.3px;
}

h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--ink);
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ============================================================
   STAT CARDS — PURPLE GRADIENT (DASHBOARD)
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 14px 0 22px;
}

.stat-card {
  background: var(--accent-grad);
  border-radius: 14px;
  padding: 20px 18px;
  border: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.stat-card .stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 4px;
  font-weight: 600;
}

.stat-card .stat-detail {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.18);
}

/* Variant accents so individual stat cards can still read distinctly,
   while staying within the purple-gradient family. */
.stat-card.c-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-card.c-red    { background: linear-gradient(135deg, #fb7185, #ef4444); box-shadow: 0 10px 24px rgba(239,68,68,0.25); }
.stat-card.c-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 10px 24px rgba(245,158,11,0.25); }
.stat-card.c-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); box-shadow: 0 10px 24px rgba(13,148,136,0.25); }

/* ============================================================
   MENU GRID
   ============================================================ */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.nav-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 16px 14px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-card:hover {
  border-color: var(--accent-1);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

.nav-card .icon {
  font-size: 20px;
}
.nav-card .title {
  font-weight: 700;
  font-size: 13px;
}
.nav-card .desc {
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  background: #161d2f;
  color: #c3c9da;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }

tr:hover td {
  background: #f8f7ff;
}

/* NOTE: the previous horizontal-scroll-with-edge-fade approach for
   #tableWrap/#tablePemasukan/#tableMeninggal/#tableUsers/etc. has been
   replaced by the .card-table pattern below, which turns each row
   into a readable stacked card on narrow screens instead of forcing
   sideways scrolling through a shrunken table. See "RESPONSIVE
   CARD-TABLE" further down this file. */

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}
.badge.ok {
  background: #dcfce7;
  color: #16a34a;
}
.badge.danger {
  background: #fee2e2;
  color: #dc2626;
}
.badge.warning {
  background: #fef3c7;
  color: #d97706;
}
.badge.primary {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.12));
  color: var(--accent-1);
}

/* ============================================================
   FORMS
   ============================================================ */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  transition: all 0.15s;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
input[readonly] {
  background: #f8fafc;
  color: var(--muted);
}

label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.field {
  margin-bottom: 12px;
  width: 100%;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row > .field {
  flex: 1;
  min-width: 130px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.97);
}

.btn.secondary {
  background: #eef0f7;
  color: var(--ink);
  box-shadow: none;
}
.btn.secondary:hover {
  background: #e2e6f3;
  transform: none;
}

.btn.danger {
  background: linear-gradient(135deg, #fb7185, #ef4444);
  box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.btn.danger:hover {
  filter: brightness(1.05);
}

.btn.small {
  padding: 5px 11px;
  font-size: 11px;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 12px;
}

/* A group of filter fields that should wrap together as a unit,
   separate from action buttons (e.g. Reset Filter, + Tambah).
   Uses a grid (not flex-wrap) so every field's left/right edges
   line up cleanly across rows — each track is the same width, and
   the row always fills edge-to-edge instead of leaving a ragged
   gap after the last field when it wraps. Individual pages no
   longer need an inline max-width on each .field; minmax() below
   keeps fields from getting either too cramped or too stretched. */
.toolbar-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  align-items: end;
  width: 100%;
}
.toolbar-filters .field {
  max-width: none;
  min-width: 0;
  width: 100%;
}

.toolbar-filters .field input,
.toolbar-filters .field select {
  width: 100%;
  box-sizing: border-box;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1b2236;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(15,23,42,0.25);
  z-index: 100;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s;
  max-width: 360px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  background: linear-gradient(135deg, #fb7185, #ef4444);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-backdrop.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 26px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.modal h3 {
  font-size: 16px;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ============================================================
   DETAIL TUNGGAKAN MODAL (warga.html)
   ============================================================ */
.detail-modal-head {
  margin-bottom: 16px;
}
.detail-modal-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.detail-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.detail-summary-value {
  font-size: 15px;
  font-weight: 800;
  color: #dc2626;
}
.detail-summary-total {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.detail-summary-total .detail-summary-value {
  color: #0f172a;
}

.detail-section {
  margin-bottom: 18px;
}
.detail-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}
.detail-section-body {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-section-body .empty {
  padding: 16px;
  text-align: center;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.detail-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.detail-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.detail-table tr:last-child td {
  border-bottom: none;
}
.detail-table tr:hover td {
  background: #f8fafc;
}
.detail-table .col-nominal {
  text-align: right;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
}
.detail-table .col-status {
  text-align: right;
  white-space: nowrap;
}
.detail-table tfoot td {
  padding: 10px 12px;
  font-weight: 800;
  background: #f8fafc;
  border-top: 2px solid var(--line);
  border-bottom: none;
}
.detail-table tfoot .col-nominal {
  color: #dc2626;
}

@media (max-width: 560px) {
  .detail-summary {
    grid-template-columns: 1fr;
  }
  .detail-summary-total {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #232c47, #11162a 60%);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 34px 30px;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  border: 1px solid var(--line);
}

.login-card .logo {
  text-align: center;
  margin-bottom: 16px;
}
.login-card .logo .circ {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-grad);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(99,102,241,0.35);
}

.login-card h1 {
  text-align: center;
  font-size: 21px;
  margin-bottom: 2px;
}

.login-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 22px;
}

.error-box {
  background: #fee2e2;
  color: #dc2626;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: none;
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f1f4f9, #f8fafc, #f1f4f9);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite;
  border-radius: 6px;
  height: 12px;
  margin: 4px 0;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 16px;
  font-size: 12px;
}

/* ============================================================
   BOTTOM NAV (Mobile)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: radial-gradient(circle at top left, #24365f, var(--sidebar-from) 45%, var(--sidebar-to) 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 20;
  padding: 4px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  /* IMPORTANT: .bottom-nav must stay display:block (overridden to
     "block", never "flex", in the @media(max-width:900px) block
     below) so it behaves as a plain horizontally-scrolling
     container. .bottom-nav-inner — a normal block-level child in
     that case — is free to grow wider than its parent and trigger
     the scrollbar. Making .bottom-nav itself display:flex (an
     earlier version of this rule did) turns .bottom-nav-inner into
     a flex item instead, and flex items get squeezed/clipped by
     their flex parent rather than reliably overflowing it — that
     was the actual cause of admin's 8-item menu losing items on
     mobile/tablet even after the centering+scroll markup was added. */
}
.bottom-nav::-webkit-scrollbar {
  display: none;
}
.bottom-nav-inner {
  display: flex;
  width: max-content;
  min-width: 100%;
  justify-content: center;
  margin: 0 auto;
}

.bottom-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-decoration: none;
  color: #8a92a8;
  font-size: 9px;
  font-weight: 600;
  padding: 6px 14px;
  flex: 0 0 auto;
  min-width: 58px;
}
.bottom-icon {
  font-size: 16px;
}
.bottom-link.active {
  color: #fff;
}

/* Scroll-hint arrows for .bottom-nav, shown only when its content
   overflows the viewport and there's more to reveal in that
   direction. These are independent fixed-position elements (siblings
   of .bottom-nav, injected by JS in api.js) rather than nested inside
   it, so they don't interfere with .bottom-nav's own fixed layout —
   their left/right edges are kept in sync with .bottom-nav's box via
   JS on resize. */
.bottom-nav-arrow {
  display: none;
  position: fixed;
  bottom: 0;
  width: 26px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  z-index: 21;
  pointer-events: none;
}
.bottom-nav-arrow.left {
  left: 0;
  background: linear-gradient(to right, var(--sidebar-to), rgba(12,20,38,0));
}
.bottom-nav-arrow.right {
  right: 0;
  background: linear-gradient(to left, var(--sidebar-to), rgba(12,20,38,0));
}
.bottom-nav-arrow.show {
  display: flex;
}

/* ============================================================
   SIDEBAR BACKDROP
   ============================================================ */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 19;
  display: none;
}

/* ============================================================
   FORM ALIGNMENT — keep label/input edges flush left & right
   (.field/.row base rules already defined above; this just
   reinforces that inputs always fill their field's full width
   so left/right edges line up neatly in every form on the site)
   ============================================================ */
.field input,
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pagination-info {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pagination-controls button {
  background: #eef0f7;
  color: var(--ink);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.pagination-controls button:hover:not(:disabled) {
  background: var(--accent-grad);
  color: #fff;
}
.pagination-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-controls button.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.pagination-controls .pg-dots {
  color: var(--muted);
  padding: 0 2px;
  font-size: 12px;
}

/* ============================================================
   BULK SELECT TABLES (admin checklist + hapus/edit)
   ============================================================ */
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.bulk-actionbar {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.bulk-actionbar.show {
  display: flex;
}
.bulk-actionbar .bulk-summary {
  font-size: 12px;
}
.bulk-actionbar .bulk-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE TABLE — plain table at every screen size
   Per explicit request: tables must look the same on phones/
   tablets as on desktop (normal rows/columns), not turn into
   stacked "cards". When a table is wider than its container,
   .table-wrap (overflow-x:auto, set earlier in this file) lets
   the user scroll left/right to see the rest, instead of
   reflowing the layout.
   ============================================================ */
.table-wrap table {
  min-width: 640px;
}
.table-wrap td, .table-wrap th {
  white-space: nowrap;
}

@media (max-width: 1024px) {
  main.container {
    padding: 18px 20px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 22;
    width: 230px;
    padding-top: 64px;
    padding-bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: block;
  }

  .bottom-nav {
    display: block;
  }

  main.container {
    padding: 12px;
    padding-bottom: 68px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-grid {
    grid-template-columns: 1fr 1fr;
  }

  .row {
    flex-direction: column;
  }
  .row > .field {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 10px;
    height: 50px;
  }
  .topbar .brand .brand-name {
    font-size: 13px;
  }
  .topbar .page-title {
    font-size: 12px;
  }
  .account-btn span:not(.avatar) {
    display: none;
  }

  h1 {
    font-size: 18px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card .stat-value {
    font-size: 19px;
  }

  .nav-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .nav-card {
    padding: 12px 10px;
  }
  .nav-card .icon {
    font-size: 18px;
  }

  .card {
    padding: 12px;
  }

  .login-card {
    padding: 26px 18px;
    margin: 10px;
  }

  .toast {
    bottom: 64px;
    right: 10px;
    left: 10px;
    max-width: 100%;
  }

  .pagination {
    justify-content: center;
    text-align: center;
  }
  .bulk-actionbar {
    flex-direction: column;
    align-items: stretch;
  }
  .bulk-actionbar .bulk-buttons {
    justify-content: stretch;
  }
  .bulk-actionbar .bulk-buttons .btn {
    flex: 1;
  }
}

/* Wilayah form - responsive */
.wilayah-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  width: 100%;
}

.wilayah-form .field {
  flex: 1;
  min-width: 200px;
}

.wilayah-form .field input {
  width: 100%;
}

.wilayah-form .btn {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .wilayah-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .wilayah-form .field {
    min-width: 100%;
  }
  
  .wilayah-form .btn {
    width: 100%;
  }
}

/* ============================================================
   SETTINGS PAGE - MOBILE RESPONSIVE
   ============================================================ */

/* Settings cards - full width di mobile */
.settings-card {
  flex: 1;
  min-width: 300px;
  max-width: 480px;
  width: 100%;
}

.settings-card-full {
  max-width: 100%;
  width: 100%;
}

.settings-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.settings-row .settings-card {
  flex: 1;
  min-width: 280px;
}

/* Settings form - full width inputs */
.settings-card input,
.settings-card select,
.settings-card textarea {
  width: 100%;
  box-sizing: border-box;
}

.settings-card .btn {
  width: 100%;
}

/* Responsive untuk settings */
@media (max-width: 768px) {
  .settings-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .settings-row .settings-card {
    min-width: 100%;
    max-width: 100%;
  }
  
  .settings-card-full {
    padding: 14px;
  }
  
  /* Nominal info display */
  #infoNominal {
    padding: 12px !important;
  }
  
  #infoNominal > div {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start !important;
  }
  
  #infoNominal > div span:last-child {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .settings-card {
    padding: 14px;
  }
  
  .settings-card h2 {
    font-size: 15px;
  }
  
  #infoNominal > div {
    padding: 8px 0 !important;
  }
}
/* ====== EXPORT BAR ====== */
.export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.export-label {
  font-size: 13px;
  color: var(--muted, #6b7280);
  font-weight: 500;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  transition: opacity .15s;
}
.export-btn:disabled { opacity: .5; cursor: wait; }

/* ============================================================
   SETTINGS TABS — pill-style nav bar (Pengaturan)
   Menggantikan tab lama yang memakai .btn/.btn.secondary biasa,
   yang jadi berantakan saat jumlah tab banyak & lebar tidak rata.
   ============================================================ */
.settings-tabs-card {
  padding: 8px;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  padding: 6px;
  border-radius: 12px;
}
.settings-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.settings-tab:hover {
  background: #e2e6f3;
  color: var(--ink);
}
.settings-tab.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Pemisah visual antara tab "umum" dan tab khusus Super Admin,
   supaya jelas kalau grup tab terakhir itu memang lebih sensitif. */
.settings-tabs-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
  align-self: stretch;
}
.settings-tabs-divider span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .settings-tabs {
    padding: 5px;
    gap: 5px;
  }
  .settings-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 9px 10px;
    font-size: 12px;
  }
  .settings-tabs-divider {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 6px 0 0;
    margin: 2px 0 0;
    justify-content: center;
  }
}
