/* ==========================================================================
   TailwindAdmin Theme - Sistem Informasi Penduduk Sirod RT 06 RW 10
   Modern Design System inspired by TailwindAdmin React & Tailwind CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Color Palette */
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Primary Accent: Emerald / Forest Green */
  --color-primary-50: #ecfdf5;
  --color-primary-100: #d1fae5;
  --color-primary-200: #a7f3d0;
  --color-primary-300: #6ee7b7;
  --color-primary-400: #34d399;
  --color-primary-500: #10b981;
  --color-primary-600: #059669;
  --color-primary-700: #047857;
  --color-primary-800: #065f46;
  --color-primary-900: #064e3b;

  /* Secondary / Brand accents */
  --color-indigo-50: #eef2ff;
  --color-indigo-500: #6366f1;
  --color-indigo-600: #4f46e5;

  --color-amber-50: #fffbeb;
  --color-amber-500: #f59e0b;
  --color-amber-600: #d97706;

  --color-rose-50: #fff1f2;
  --color-rose-500: #f43f5e;
  --color-rose-600: #e11d48;

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: var(--font-sans);
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(244, 63, 94, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--color-slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: #ffffff;
  border-right: 1px solid var(--color-slate-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--color-slate-100);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-slate-900);
  letter-spacing: -0.01em;
}

.brand-text p {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-slate-400);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-slate-400);
  letter-spacing: 0.05em;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-slate-600);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--color-slate-100);
  color: var(--color-slate-900);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-700));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--color-slate-100);
}

.admin-badge-card {
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-badge-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-slate-800);
}

.admin-badge-info p {
  font-size: 11px;
  color: var(--color-slate-500);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.topbar {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1.5px solid var(--color-slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 4px 16px -2px rgba(16, 185, 129, 0.07);
}

.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #059669 0%, #0284c7 35%, #f59e0b 70%, #f43f5e 100%);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-slate-700);
}

.topbar-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-slate-900);
  letter-spacing: -0.01em;
}

.topbar-title span {
  font-size: 12px;
  color: var(--color-slate-500);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-slate-600);
  background: var(--color-slate-100);
  padding: 6px 12px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary-600);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-primary-700);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--color-slate-700);
  border-color: var(--color-slate-300);
}

.btn-secondary:hover {
  background-color: var(--color-slate-50);
  border-color: var(--color-slate-400);
}

.btn-danger {
  background-color: var(--color-rose-500);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--color-rose-600);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Content Container */
.content-body {
  flex: 1;
  padding: 28px;
}

/* ==========================================================================
   STATISTICS CARDS (TailwindAdmin Style)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -4px rgba(0, 0, 0, 0.09);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.stat-content {
  min-width: 0;
}

.stat-content h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-slate-500);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-slate-900);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.2;
}

.stat-meta {
  font-size: 11.5px;
  color: var(--color-slate-500);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.08);
}

/* 1. Emerald (Total Rumah) */
.stat-card:nth-child(1), .stat-card.stat-card-emerald {
  background: linear-gradient(145deg, #ffffff 0%, #ecfdf5 100%);
  border-color: #a7f3d0;
}
.stat-card:nth-child(1)::before, .stat-card.stat-card-emerald::before {
  background: linear-gradient(90deg, #10b981, #059669);
}
.stat-card:nth-child(1) .stat-number, .stat-card.stat-card-emerald .stat-number {
  color: #065f46;
}
.stat-card:nth-child(1) .stat-icon, .stat-card.stat-card-emerald .stat-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

/* 2. Blue (Jumlah Penduduk) */
.stat-card:nth-child(2), .stat-card.stat-card-blue {
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
  border-color: #bfdbfe;
}
.stat-card:nth-child(2)::before, .stat-card.stat-card-blue::before {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}
.stat-card:nth-child(2) .stat-number, .stat-card.stat-card-blue .stat-number {
  color: #1e40af;
}
.stat-card:nth-child(2) .stat-icon, .stat-card.stat-card-blue .stat-icon {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

/* 3. Indigo (Warga Tetap) */
.stat-card:nth-child(3), .stat-card.stat-card-indigo {
  background: linear-gradient(145deg, #ffffff 0%, #eef2ff 100%);
  border-color: #c7d2fe;
}
.stat-card:nth-child(3)::before, .stat-card.stat-card-indigo::before {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}
.stat-card:nth-child(3) .stat-number, .stat-card.stat-card-indigo .stat-number {
  color: #3730a3;
}
.stat-card:nth-child(3) .stat-icon, .stat-card.stat-card-indigo .stat-icon {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

/* 4. Amber / Orange (Warga Kontrak) */
.stat-card:nth-child(4), .stat-card.stat-card-amber {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%);
  border-color: #fde68a;
}
.stat-card:nth-child(4)::before, .stat-card.stat-card-amber::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}
.stat-card:nth-child(4) .stat-number, .stat-card.stat-card-amber .stat-number {
  color: #92400e;
}
.stat-card:nth-child(4) .stat-icon, .stat-card.stat-card-amber .stat-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

/* 5. Rose / Pink (Warga Singgah) */
.stat-card:nth-child(5), .stat-card.stat-card-rose {
  background: linear-gradient(145deg, #ffffff 0%, #fff1f2 100%);
  border-color: #fecdd3;
}
.stat-card:nth-child(5)::before, .stat-card.stat-card-rose::before {
  background: linear-gradient(90deg, #f43f5e, #e11d48);
}
.stat-card:nth-child(5) .stat-number, .stat-card.stat-card-rose .stat-number {
  color: #9f1239;
}
.stat-card:nth-child(5) .stat-icon, .stat-card.stat-card-rose .stat-icon {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.35);
}

/* 6. Cyan / Teal (Pemakaian Air) */
.stat-card:nth-child(6), .stat-card.stat-card-cyan {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdfa 100%);
  border-color: #99f6e4;
}
.stat-card:nth-child(6)::before, .stat-card.stat-card-cyan::before {
  background: linear-gradient(90deg, #0d9488, #0284c7);
}
.stat-card:nth-child(6) .stat-number, .stat-card.stat-card-cyan .stat-number {
  color: #0f766e;
}
.stat-card:nth-child(6) .stat-icon, .stat-card.stat-card-cyan .stat-icon {
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.35);
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 60%, #eff6ff 100%);
  border-bottom: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #059669 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.25);
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 13px;
  color: var(--color-slate-500);
  font-weight: 400;
}

.card-body {
  padding: 24px;
}

/* ==========================================================================
   TABLES (Clean Modern TailwindAdmin style)
   ========================================================================== */
.mobile-table-hint {
  display: none;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.custom-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 16px;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-slate-100);
  color: var(--color-slate-700);
  vertical-align: middle;
}

.custom-table tbody tr:nth-child(even) td {
  background-color: #fafbfd;
}

.custom-table tbody tr:hover td {
  background-color: #ecfdf5 !important;
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-paid {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-unpaid {
  background-color: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-pending {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-tetap {
  background-color: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.badge-kontrak {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-singgah {
  background-color: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

/* Action toggle button on table */
.toggle-badge-btn {
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.toggle-badge-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-slate-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-slate-800);
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3.5px rgba(16, 185, 129, 0.18);
}

.form-control[readonly] {
  background-color: var(--color-slate-100);
  color: var(--color-slate-600);
  cursor: not-allowed;
}

.form-hint {
  font-size: 11.5px;
  color: var(--color-slate-400);
  margin-top: 4px;
}

/* Search Box Container */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-slate-400);
  width: 16px;
  height: 16px;
}

.search-wrapper input {
  padding-left: 36px;
}

/* ==========================================================================
   RESIDENT DETAIL CARD (When Searched)
   ========================================================================== */
.resident-lookup-card {
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
  animation: fadeIn 0.3s ease;
}

.resident-lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.resident-avatar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.resident-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-600);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.resident-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.month-status-pill {
  background: #ffffff;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
}

.month-status-pill .pill-title {
  font-weight: 700;
  color: var(--color-slate-700);
  margin-bottom: 4px;
}

.month-status-pill .pill-items {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ==========================================================================
   QRIS PAYMENT CARD
   ========================================================================== */
.qris-modal-body {
  text-align: center;
}

.qris-header-banner {
  background: #b91c1c;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.qris-card-container {
  background: #ffffff;
  border: 2px solid #b91c1c;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.qris-merchant-info {
  padding: 12px;
  background: var(--color-slate-50);
  border-bottom: 1px dashed var(--color-slate-300);
}

.qris-merchant-info h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-slate-900);
}

.qris-merchant-info p {
  font-size: 12px;
  color: var(--color-slate-500);
}

.qris-image-wrapper {
  padding: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qris-image-wrapper img {
  width: 240px;
  height: 240px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.qris-footer-details {
  padding: 14px;
  background: var(--color-slate-50);
  border-top: 1px dashed var(--color-slate-300);
}

.qris-amount-large {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary-700);
  margin-bottom: 4px;
}

.countdown-clock {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-amber-600);
  background: var(--color-amber-50);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  margin: 6px 0;
}

.qris-status-box {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin: 10px 0;
}

.qris-status-box.pending {
  background-color: var(--color-amber-50);
  color: var(--color-amber-700);
}

.qris-status-box.lunas {
  background-color: var(--color-primary-100);
  color: var(--color-primary-800);
}

.qris-status-box.expired {
  background-color: var(--color-rose-50);
  color: var(--color-rose-700);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--color-slate-100);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  font-size: 12.5px;
  color: var(--color-slate-500);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-slate-300);
  background: #ffffff;
  color: var(--color-slate-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--color-slate-100);
  border-color: var(--color-slate-400);
}

.page-btn.active {
  background: var(--color-primary-600);
  color: #ffffff;
  border-color: var(--color-primary-600);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-slate-900);
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-slate-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--color-slate-700);
  background: var(--color-slate-100);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-slate-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  min-width: 260px;
}

.toast.success { background-color: var(--color-primary-600); }
.toast.error { background-color: var(--color-rose-600); }
.toast.info { background-color: var(--color-slate-800); }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tab Section Routing (Strict: only active tab is visible) */
.tab-section {
  display: none !important;
}

.tab-section.active {
  display: block !important;
  animation: fadeInTab 0.25s ease-out;
}

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

/* Admin visibility toggles (for inline buttons, badges, controls) */
.admin-only {
  display: none !important;
}

body.is-admin .admin-only {
  display: block !important;
}

body.is-admin button.admin-only,
body.is-admin .admin-only-inline {
  display: inline-flex !important;
}

body.is-admin .admin-only-flex {
  display: flex !important;
}

/* Prevent .admin-only from unintentionally forcing tab-sections to show */
.tab-section.admin-only {
  display: none !important;
}

body.is-admin .tab-section.admin-only {
  display: none !important;
}

.tab-section.active.admin-only,
body.is-admin .tab-section.active.admin-only {
  display: block !important;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 35;
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-modal);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 1280px) and (min-width: 641px) {
  .stats-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }
}

@media (max-width: 640px) {
  .content-body {
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 10px;
    border-radius: var(--radius-md);
  }

  .stat-content h3 {
    font-size: 9.5px;
    margin-bottom: 2px;
  }

  .stat-number {
    font-size: 17px;
  }

  .stat-meta {
    font-size: 10px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    margin-left: 4px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .topbar {
    padding: 0 14px;
    height: 60px;
  }

  .topbar-title h2 {
    font-size: 14.5px;
  }

  .topbar-title span {
    display: none;
  }

  .clock-badge,
  #liveClock {
    display: none !important;
  }

  .dash-filter-bar {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 8px !important;
  }

  .dash-filter-bar .search-wrapper {
    width: 100% !important;
    grid-column: 1 / -1 !important;
  }

  .dash-filter-bar select {
    width: 100% !important;
  }

  .dash-filter-bar button {
    width: 100% !important;
    grid-column: 1 / -1 !important;
    justify-content: center !important;
    padding: 10px 14px !important;
  }

  .mobile-table-hint {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #ecfdf5;
    border-bottom: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 11.5px;
    font-weight: 600;
  }

  #rekapModalSummaryCards {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  #rekapModalSummaryCards > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 12px !important;
    text-align: left !important;
  }

  #rekapModalSummaryCards > div > div:last-child {
    margin-top: 0 !important;
    font-size: 14px !important;
  }

  .pagination-wrapper {
    padding: 12px 14px !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  .pagination-info {
    text-align: center !important;
    font-size: 11.5px !important;
  }

  .pagination-buttons {
    display: flex !important;
    justify-content: center !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
  }

  .toast-container {
    right: 12px !important;
    left: 12px !important;
    bottom: 16px !important;
  }

  .toast {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-body {
    padding: 14px 16px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .custom-table th, .custom-table td {
    padding: 10px 10px;
    font-size: 11.5px;
  }

  .modal-dialog {
    max-width: 95%;
    margin: 10px;
    padding: 0;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }
}

/* ==========================================================================
   OFFICIAL INDONESIAN NATIONAL QRIS DESIGN (BANK INDONESIA / ASPI STANDARD)
   ========================================================================== */
.admin-nav-section {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.admin-lock-indicator {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  letter-spacing: 0.02em;
}

body.is-admin .admin-lock-indicator {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.qris-official-modal {
  width: 94% !important;
  max-width: 390px !important;
  text-align: center;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 18px;
  max-height: 94vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}

.qris-top-banner {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.qris-top-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qris-top-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.qris-top-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.qris-body-content {
  padding: 14px 16px 16px;
  overflow-y: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Compact Header (Total & Invoice) */
.qris-compact-header {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  text-align: left;
}

.qris-amount-col {
  display: flex;
  flex-direction: column;
}

.qris-amount-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.qris-amount-display {
  font-size: 22px;
  font-weight: 800;
  color: #047857;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.qris-order-tag-row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.qris-invoice-num {
  font-size: 11px;
  color: #334155;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}

.btn-copy-mini {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-mini:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Authentic National QRIS Standee / Card Frame */
.official-qris-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px 10px;
  width: 100%;
  max-width: 275px;
  margin: 0 auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.qris-accent-left {
  position: absolute;
  left: 0;
  top: 45%;
  transform: translateY(-50%);
  width: 8px;
  height: 60px;
  background: #dc2626;
  clip-path: polygon(0 0, 100% 25%, 100% 75%, 0 100%);
}

.qris-accent-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 26px 26px;
  border-color: transparent transparent #dc2626 transparent;
}

.qris-logos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.qris-brand-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qris-logo-text {
  font-weight: 900;
  font-size: 20px;
  color: #111827;
  letter-spacing: -0.8px;
  line-height: 1;
  font-family: 'Inter', -apple-system, sans-serif;
}

.qris-logo-desc {
  text-align: left;
  font-size: 6.5px;
  font-weight: 800;
  line-height: 1.1;
  color: #1f2937;
  text-transform: uppercase;
}

.qris-logo-desc span {
  display: block;
}

.qris-gpn-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.gpn-text {
  font-weight: 900;
  font-size: 14px;
  color: #1e3a8a;
  letter-spacing: -0.5px;
  font-family: 'Inter', sans-serif;
}

.qris-merchant-box {
  margin: 6px 0 4px;
  text-align: center;
}

.qris-merchant-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qris-merchant-meta {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  margin-top: 1px;
}

/* Viewfinder for QR Image */
.qris-code-image-wrap {
  background: #ffffff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qris-qr-viewfinder {
  position: relative;
  padding: 6px;
  background: #ffffff;
  border-radius: 6px;
}

.qris-qr-viewfinder img {
  width: 170px;
  height: 170px;
  max-width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
  border-radius: 4px;
}

.vf-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #dc2626;
  border-style: solid;
}

.vf-corner.tl { top: 1px; left: 1px; border-width: 2px 0 0 2px; border-top-left-radius: 3px; }
.vf-corner.tr { top: 1px; right: 1px; border-width: 2px 2px 0 0; border-top-right-radius: 3px; }
.vf-corner.bl { bottom: 1px; left: 1px; border-width: 0 0 2px 2px; border-bottom-left-radius: 3px; }
.vf-corner.br { bottom: 1px; right: 1px; border-width: 0 2px 2px 0; border-bottom-right-radius: 3px; }

/* Accepted methods footer */
.qris-methods-footer {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  text-align: center;
}

.qris-methods-title {
  font-size: 8px;
  font-weight: 800;
  color: #475569;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.qris-methods-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-bottom: 4px;
}

.qris-bank-pill {
  font-size: 7.5px;
  font-weight: 800;
  padding: 1.5px 4px;
  border-radius: 3px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.qris-bank-pill.bca { background: #0060af; }
.qris-bank-pill.mandiri { background: #003087; }
.qris-bank-pill.bri { background: #00529c; }
.qris-bank-pill.bni { background: #f15a24; }
.qris-bank-pill.gopay { background: #00aed6; }
.qris-bank-pill.ovo { background: #4c2a86; }
.qris-bank-pill.dana { background: #118eea; }
.qris-bank-pill.spay { background: #ee4d2d; }

.qris-printed-footer {
  font-size: 8.5px;
  color: #64748b;
  font-weight: 600;
}

/* Status & Countdown Row (Inline Compact) */
.qris-status-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 12px;
}

.qris-status-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #92400e;
}

.qris-status-banner.paid {
  color: #065f46;
}

.qris-status-banner.expired {
  color: #9f1239;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d97706;
  display: inline-block;
  animation: pulseAnimation 1.5s infinite;
  flex-shrink: 0;
}

.qris-status-banner.paid .pulse-dot {
  background: #059669;
  animation: none;
}

.qris-status-banner.expired .pulse-dot {
  background: #e11d48;
  animation: none;
}

.qris-timer-box {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

/* Action Buttons */
.qris-action-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-qris-action {
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  flex: 1 1 calc(50% - 6px);
  min-width: 130px;
}

.btn-qris-download {
  background: #047857;
  color: #ffffff;
}

.btn-qris-download:hover {
  background: #065f46;
}

.btn-qris-check {
  background: #0284c7;
  color: #ffffff;
}

.btn-qris-check:hover {
  background: #0369a1;
}

.btn-qris-simulate {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-qris-simulate:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-qris-kwitansi {
  background: #059669;
  color: #ffffff;
  animation: pulseAnimation 2s infinite;
  flex: 1 1 100%;
}

.btn-qris-kwitansi:hover {
  background: #047857;
}

/* Guide Accordion */
.qris-guide-accordion {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  margin-top: 2px;
}

.qris-guide-toggle {
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}

.qris-guide-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.toggle-arrow {
  font-size: 9px;
  transition: transform 0.2s;
}

.qris-guide-content {
  padding: 8px 14px 10px 24px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #475569;
  line-height: 1.5;
  text-align: left;
}

.qris-guide-content ol {
  margin: 0;
  padding: 0;
}

.qris-guide-content li {
  margin-bottom: 4px;
}

/* Mobile fine-tuning */
@media (max-width: 480px) {
  .qris-official-modal {
    width: 95% !important;
    max-height: 96vh;
    border-radius: 14px;
  }
  .qris-body-content {
    padding: 10px 12px 14px;
  }
  .official-qris-card {
    max-width: 250px;
    padding: 10px 10px 8px;
  }
  .qris-qr-viewfinder img {
    width: 155px;
    height: 155px;
  }
  .qris-amount-display {
    font-size: 20px;
  }
  .btn-qris-action {
    font-size: 11px;
    padding: 7px 10px;
  }
}
