/* =============================================================
   style-v2.css — UI/UX Overhaul Layer
   Surat Mandiri Desa Mekarmukti
   
   Loaded SETELAH style.css. Ini adalah augment layer:
   - Memperbaiki spacing, typography, micro-interaction
   - Menambah komponen modern (chat, stepper, mobile nav)
   - Tetap kompatibel dengan struktur HTML yang sudah ada
   - Tema warna BIRU sesuai web utama (tidak diubah)
   ============================================================= */

/* ── Design Tokens (extension) ───────────────────────────── */
:root {
  /* Sudah ada di style.css: --blue-50..900, --slate-*, --shadow-*, dll */
  /* Kita tambah token baru untuk komponen modern: */
  --primary:        var(--blue-600);
  --primary-dark:   var(--blue-700);
  --primary-light:  var(--blue-100);
  --surface:        #ffffff;
  --surface-2:      #f8fafc;
  --surface-3:      #f1f5f9;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-soft:      #94a3b8;
  --success:        #16a34a;
  --success-bg:     #dcfce7;
  --warning:        #d97706;
  --warning-bg:     #fef3c7;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --info:           #0284c7;
  --info-bg:        #e0f2fe;

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;

  --sh-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --sh-md: 0 2px 4px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.06);
  --sh-lg: 0 8px 16px rgba(15,23,42,.06), 0 20px 40px rgba(15,23,42,.08);
  --sh-blue:0 8px 24px rgba(37,99,235,.15);

  --tr-fast: 150ms cubic-bezier(.4,0,.2,1);
  --tr-base: 220ms cubic-bezier(.4,0,.2,1);
  --tr-slow: 320ms cubic-bezier(.4,0,.2,1);

  --container-max: 1140px;

  /* Bottom nav height untuk safe-area di mobile */
  --bottom-nav-h: 64px;
}

/* ── Body & global ── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Scrollbar tipis */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Container utility ── */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* =============================================================
   NAVBAR — Modern Glassmorphism
   ============================================================= */
.navbar {
  background: rgba(29, 78, 216, .92) !important;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 4px 20px rgba(15,23,42,.08);
  transition: background var(--tr-base);
}
.navbar-inner { max-width: var(--container-max) !important; padding: 0 20px; }
.navbar-brand { gap: 14px !important; }
.brand-icon {
  width: 42px !important; height: 42px !important;
  background: rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.18);
}
.brand-text strong { font-size: 16px !important; letter-spacing: .2px; }
.brand-text span { font-size: 11.5px !important; opacity: .85; }

/* Nav buttons — lebih elegant */
.nav-btn {
  padding: 9px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .1px;
  border-radius: 10px !important;
  transition: all var(--tr-fast) !important;
  position: relative;
  overflow: hidden;
}
.nav-btn-ghost {
  background: rgba(255,255,255,.08) !important;
  color: rgba(255,255,255,.95) !important;
  border: 1px solid rgba(255,255,255,.12);
}
.nav-btn-ghost:hover {
  background: rgba(255,255,255,.18) !important;
  transform: translateY(-1px);
}
.nav-btn-white {
  background: #fff !important;
  color: var(--blue-700) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.nav-btn-white:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* Mobile nav toggle — elegant pill button */
.nav-toggle {
  display: none;
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  width: 42px; height: 42px;
  border-radius: 12px !important;
  font-size: 18px !important;
  cursor: pointer;
  transition: all var(--tr-fast);
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: rgba(255,255,255,.22) !important; }
.nav-toggle:active { transform: scale(.95); }

@media (max-width: 880px) {
  .navbar-nav { display: none !important; }
  .nav-toggle { display: inline-flex !important; }
}

/* Mobile drawer — slide from right (sesuai request user) */
.nav-mobile-menu {
  position: fixed;
  top: 0; right: 0; left: auto !important;
  width: min(320px, 86vw);
  height: 100vh;
  background: linear-gradient(180deg, #1d4ed8 0%, #2563eb 100%);
  padding: 24px 22px;
  box-shadow: -10px 0 40px rgba(15,23,42,.3);
  transform: translateX(100%);
  transition: transform var(--tr-slow);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-mobile-menu.open { transform: translateX(0); }
.nav-mobile-menu .nav-close {
  position: absolute; top: 16px; left: 16px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-fast);
}
.nav-mobile-menu .nav-close:hover { background: rgba(255,255,255,.22); }
.nav-mobile-menu > a, .nav-mobile-menu > .nav-user {
  margin-top: 0;
  padding: 14px 16px;
  border-radius: 12px;
  color: rgba(255,255,255,.95);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: flex; align-items: center; gap: 12px;
  transition: background var(--tr-fast);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.nav-mobile-menu > a:hover { background: rgba(255,255,255,.14); }
.nav-mobile-menu > a i { font-size: 18px; opacity: .9; }
.nav-mobile-menu > a:first-of-type { margin-top: 64px; }

.nav-mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--tr-base);
  z-index: 1000;
}
.nav-mobile-overlay.visible { opacity: 1; pointer-events: auto; }

/* User chip dalam navbar */
.nav-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 100px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================================
   HERO — index.php
   ============================================================= */
.hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 60px 24px 80px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 36px 16px 56px; text-align: center; }
}
.hero-left { color: #fff; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 24px;
  letter-spacing: .2px;
}
.hero-left h1 {
  font-family: 'Playfair Display', 'Nunito', serif !important;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.5px;
  color: #fff;
  margin-bottom: 20px;
}
.hero-left h1 em {
  font-style: italic;
  background: linear-gradient(120deg, #fde68a 0%, #fbbf24 60%, #f59e0b 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.hero-left p {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,.92);
  margin-bottom: 32px;
  max-width: 540px;
}
@media (max-width: 880px) { .hero-left p { margin-left: auto; margin-right: auto; } }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 880px) { .hero-cta { justify-content: center; } }
.btn-hero-primary, .btn-hero-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
  transition: all var(--tr-fast);
  border: none;
  cursor: pointer;
  letter-spacing: .1px;
  font-family: inherit;
}
.btn-hero-primary {
  background: #fff;
  color: var(--blue-700);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,.24);
}
.btn-hero-secondary {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-hero-secondary:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-2px);
}

/* Hero visual — stat cards */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.stat-card, .hero-visual .stat-card {
  background: rgba(255,255,255,.16);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px !important;
  padding: 20px !important;
  display: flex !important;
  align-items: center;
  gap: 16px;
  color: #fff;
  transition: transform var(--tr-base);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card-sm {
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  text-align: center;
}
.stat-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.22);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.5px;
}
.stat-card-sm .stat-num { font-size: 22px; margin: 4px 0; }
.stat-label {
  font-size: 12px;
  font-weight: 600;
  opacity: .88;
  margin-top: 4px;
  letter-spacing: .2px;
}

/* =============================================================
   SECTION HEADERS
   ============================================================= */
.white-section, .bg-blue-section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .white-section, .bg-blue-section { padding: 56px 0; }
}
.white-section { background: #fff; }
.bg-blue-section { background: linear-gradient(180deg, #f0f7ff 0%, #dbeafe 100%); }

.section-header { text-align: center; margin-bottom: 48px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-50);
  color: var(--blue-700);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
  margin-bottom: 16px;
  text-transform: uppercase;
  border: 1px solid var(--blue-200);
}
.section-title {
  font-family: 'Playfair Display', 'Nunito', serif;
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  color: var(--slate-800);
  letter-spacing: -.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}
.section-sub {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* =============================================================
   TAB GROUP — Filter kategori surat
   ============================================================= */
.tab-group {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  color: var(--slate-700);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tr-fast);
  font-family: inherit;
}
.tab-btn:hover {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-700);
}
.tab-btn.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

/* =============================================================
   SURAT GRID — Card jenis surat
   ============================================================= */
.surat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
@media (max-width: 480px) {
  .surat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
.surat-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--slate-700);
  transition: all var(--tr-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.surat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--blue-50) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--tr-base);
}
.surat-card:hover {
  border-color: var(--blue-400);
  transform: translateY(-4px);
  box-shadow: var(--sh-blue);
}
.surat-card:hover::before { opacity: 1; }
.surat-card > * { position: relative; z-index: 1; }
.surat-icon {
  width: 56px; height: 56px;
  background: var(--blue-50);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-600);
  font-size: 26px;
  transition: all var(--tr-base);
}
.surat-card:hover .surat-icon {
  background: var(--blue-600);
  color: #fff;
  transform: scale(1.05);
}
.surat-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.35;
  min-height: 36px;
  display: flex;
  align-items: center;
  text-align: center;
}
.surat-cat {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.surat-cat.cat-kependudukan { background: #dbeafe; color: #1e40af; }
.surat-cat.cat-sosial       { background: #fef3c7; color: #92400e; }
.surat-cat.cat-usaha        { background: #dcfce7; color: #166534; }
.surat-cat.cat-keluarga     { background: #fce7f3; color: #9f1239; }
.surat-cat.cat-pertanian    { background: #d1fae5; color: #065f46; }
.surat-cat.cat-dinas        { background: #ede9fe; color: #5b21b6; }

/* =============================================================
   TRACK STATUS — Cek pengajuan
   ============================================================= */
.track-box {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--sh-md);
}
.track-input-group {
  display: flex; gap: 10px;
}
@media (max-width: 520px) {
  .track-input-group { flex-direction: column; }
}
.track-input {
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--slate-800);
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  background: var(--surface-2);
  text-transform: uppercase;
}
.track-input::placeholder { color: var(--text-soft); text-transform: none; letter-spacing: 0; }
.track-input:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.track-btn {
  background: var(--blue-600);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--tr-fast);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  white-space: nowrap;
}
.track-btn:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37,99,235,.3);
}
#track-result { margin-top: 18px; }

/* =============================================================
   STEPS — Cara pengajuan (timeline modern)
   ============================================================= */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 16px;
  position: relative;
}
.step-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 22px;
  text-align: center;
  position: relative;
  transition: all var(--tr-base);
}
.step-card:hover {
  border-color: var(--blue-300);
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}
.step-num {
  position: absolute;
  top: -18px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 36px;
  background: var(--blue-600);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}
.step-icon {
  font-size: 36px;
  color: var(--blue-500);
  margin: 14px 0 16px;
}
.step-card h3, .step-card h4 {
  font-size: 16px; font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 8px;
}
.step-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =============================================================
   FOOTER
   ============================================================= */
.footer-section {
  background: var(--slate-800);
  color: rgba(255,255,255,.75);
  padding: 48px 24px 28px;
  margin-top: auto;
}
.footer-section .container { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.footer-section a { color: rgba(255,255,255,.85); text-decoration: none; transition: color var(--tr-fast); }
.footer-section a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 28px;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  opacity: .6;
}

/* =============================================================
   AUTH PAGES — Login, Register, Forgot
   ============================================================= */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-2);
}
@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; }
}
.auth-illustration {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0ea5e9 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: #fff;
}
@media (max-width: 880px) {
  .auth-illustration { display: none; }
}
.auth-illustration::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.08) 0%, transparent 50%);
}
.auth-illustration-content {
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-illustration h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -.5px;
}
.auth-illustration p {
  font-size: 16px;
  line-height: 1.7;
  opacity: .92;
  margin-bottom: 28px;
}
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 13.5px;
  font-weight: 600;
}
.auth-feature i { font-size: 20px; color: #fbbf24; flex-shrink: 0; }

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-form {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--sh-md);
}
@media (max-width: 480px) {
  .auth-form { padding: 32px 24px; box-shadow: none; border: none; background: transparent; }
  .auth-form-wrap { padding: 20px 16px; }
}
.auth-form-header { text-align: center; margin-bottom: 28px; }
.auth-form-header .logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(37,99,235,.3);
}
.auth-form-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.auth-form-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Tab login warga / staf */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 11px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--tr-fast);
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.auth-tab.active {
  background: #fff;
  color: var(--blue-700);
  box-shadow: var(--sh-sm);
}

/* Form fields modern */
.fg2 { margin-bottom: 16px; }
.fg2 label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 6px;
}
.fg2 .req { color: var(--danger); margin-left: 2px; }
.fg2 input, .fg2 select, .fg2 textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--slate-800);
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.fg2 input:focus, .fg2 select:focus, .fg2 textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.fg2 .input-with-icon { position: relative; }
.fg2 .input-with-icon input { padding-left: 42px; }
.fg2 .input-with-icon i {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}
.fg2 .hint { font-size: 12px; color: var(--text-soft); margin-top: 5px; }

.btn-auth {
  width: 100%;
  padding: 14px;
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--tr-fast);
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: .3px;
  margin-top: 8px;
}
.btn-auth:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.3);
}
.btn-auth:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  transform: none;
}

.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 24px 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

.auth-link-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-link-row a { color: var(--blue-600); font-weight: 700; text-decoration: none; }
.auth-link-row a:hover { text-decoration: underline; }

.auth-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 18px;
  font-weight: 600;
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.5;
}
.auth-alert.error { background: var(--danger-bg); color: #991b1b; border-left: 3px solid var(--danger); }
.auth-alert.success { background: var(--success-bg); color: #14532d; border-left: 3px solid var(--success); }
.auth-alert.info { background: var(--info-bg); color: #075985; border-left: 3px solid var(--info); }
.auth-alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* =============================================================
   DASHBOARD WARGA — Cards & list
   ============================================================= */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.dash-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex; align-items: center; gap: 16px;
  transition: all var(--tr-fast);
}
.dash-stat:hover {
  border-color: var(--blue-300);
  box-shadow: var(--sh-sm);
}
.dash-stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.dash-stat-icon.blue   { background: var(--blue-50);   color: var(--blue-600); }
.dash-stat-icon.amber  { background: var(--warning-bg); color: var(--warning); }
.dash-stat-icon.green  { background: var(--success-bg); color: var(--success); }
.dash-stat-icon.red    { background: var(--danger-bg);  color: var(--danger);  }
.dash-stat-num {
  font-size: 26px; font-weight: 800;
  color: var(--slate-800); line-height: 1;
}
.dash-stat-label {
  font-size: 13px; color: var(--text-muted);
  font-weight: 600; margin-top: 4px;
}

/* List pengajuan — card-style yang scannable */
.pgj-list { display: flex; flex-direction: column; gap: 12px; }
.pgj-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  transition: all var(--tr-fast);
  text-decoration: none;
  color: inherit;
}
.pgj-card:hover {
  border-color: var(--blue-300);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .pgj-card { grid-template-columns: auto 1fr; row-gap: 12px; }
  .pgj-card .pgj-action { grid-column: 1 / -1; }
}
.pgj-icon {
  width: 48px; height: 48px;
  background: var(--blue-50);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--blue-600);
  flex-shrink: 0;
}
.pgj-info h4 {
  font-size: 14.5px; font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 4px;
}
.pgj-info .meta {
  font-size: 12.5px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-weight: 600;
}
.pgj-info .meta span { display: inline-flex; align-items: center; gap: 4px; }

.badge-status {
  font-size: 11px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge-status.menunggu { background: var(--warning-bg); color: var(--warning); }
.badge-status.diproses { background: var(--info-bg);    color: var(--info);    }
.badge-status.selesai  { background: var(--success-bg); color: var(--success); }
.badge-status.ditolak  { background: var(--danger-bg);  color: var(--danger);  }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: #fff;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-xl);
  color: var(--text-muted);
}
.empty-state .ico {
  font-size: 56px;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 18px;
  color: var(--slate-700);
  margin-bottom: 8px;
  font-weight: 800;
}
.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* =============================================================
   FORM SURAT — Stepper & sections
   ============================================================= */
.form-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.form-stepper::-webkit-scrollbar { display: none; }
.fs-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--tr-fast);
}
.fs-step.active {
  background: var(--blue-50);
  border-color: var(--blue-300);
  color: var(--blue-700);
}
.fs-step.done { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.fs-step .fs-num {
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.fs-divider {
  flex: 0 0 24px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--sh-sm);
}
@media (max-width: 480px) {
  .form-section { padding: 22px 18px; border-radius: 16px; }
}
.form-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.form-section-title i {
  width: 32px; height: 32px;
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* =============================================================
   CHAT COMPONENT — Warga ↔ Petugas
   ============================================================= */
.chat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  max-height: 560px;
}
.chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #fff;
  display: flex; align-items: center; gap: 12px;
}
.chat-header-avatar {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-header h4 { font-size: 14.5px; font-weight: 800; margin-bottom: 2px; }
.chat-header p { font-size: 12px; opacity: .85; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: #f8fafc;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 280px;
}
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 80%;
  animation: msgIn .3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.warga { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  overflow: hidden;
}
.chat-msg.warga .chat-msg-avatar { background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); }
.chat-msg.petugas .chat-msg-avatar { background: linear-gradient(135deg, #16a34a, #14532d); }
.chat-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
}
.chat-msg.warga .chat-bubble {
  background: var(--blue-600);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.petugas .chat-bubble {
  background: #fff;
  color: var(--slate-800);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-time {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: .65;
  font-weight: 600;
}
.chat-msg.warga .chat-time { text-align: right; color: rgba(255,255,255,.85); }
.chat-msg.petugas .chat-time { color: var(--text-muted); }

.chat-input-wrap {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 42px;
  line-height: 1.4;
  transition: border-color var(--tr-fast);
}
.chat-input:focus {
  outline: none;
  border-color: var(--blue-500);
}
.chat-send {
  background: var(--blue-600);
  color: #fff;
  border: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--tr-fast);
  flex-shrink: 0;
}
.chat-send:hover { background: var(--blue-700); transform: scale(1.05); }
.chat-send:disabled { background: var(--border-strong); cursor: not-allowed; }

.chat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 20px;
  font-size: 14px;
}
.chat-empty i { font-size: 36px; color: var(--text-soft); margin-bottom: 10px; display: block; }

/* =============================================================
   RESPONSIVE UTILITIES
   ============================================================= */
.hide-mobile { display: initial; }
.show-mobile { display: none; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: initial; }
}

/* Smooth scroll & focus */
html { scroll-behavior: smooth; }
:focus-visible {
  outline: 3px solid rgba(59,130,246,.4);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(59,130,246,.4);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================
   FADE-UP animation (sudah dipakai di index.php)
   ============================================================= */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================================
   ELEVATED LANDING BG (v2.1)
   Memperbaiki: konten yang menyatu dengan background
   Strategi: 
   1. Background lebih gelap & high contrast
   2. Setiap section punya elevation/shadow yang jelas
   3. Hero pakai overlay gradient yg tegas
   ============================================================= */

/* Override background base — lebih warm putih bersih */
body { background: #f1f5f9 !important; }

/* Override hero background — lebih dramatic, tinggi 600px */
body.page-index::before {
  height: 680px !important;
  background: 
    linear-gradient(135deg, 
      rgba(15, 23, 42, .15) 0%, 
      transparent 100%),
    linear-gradient(135deg, 
      #0c2d72 0%, 
      #1d4ed8 30%, 
      #2563eb 60%, 
      #0284c7 100%) !important;
  clip-path: ellipse(140% 100% at 50% 0%) !important;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .3);
}

/* Tambah overlay pattern halus di hero */
body.page-index::after {
  background: 
    radial-gradient(circle at 12% 25%, rgba(96, 165, 250, .25) 0%, transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(56, 189, 248, .2) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.04) 0%, transparent 60%) !important;
  height: 680px !important;
  bottom: auto !important;
}

/* Hero kontras maksimal */
.hero {
  padding: 80px 24px 100px !important;
  position: relative;
  z-index: 2;
}

.hero h1 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, .25),
               0 1px 2px rgba(0, 0, 0, .2) !important;
  color: #fff !important;
}
.hero h1 em {
  background: linear-gradient(120deg, #fde68a 0%, #fcd34d 50%, #fbbf24 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, .3));
}
.hero p {
  color: rgba(255, 255, 255, .95) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .2);
}

.hero-badge {
  background: rgba(255, 255, 255, .15) !important;
  border-color: rgba(255, 255, 255, .3) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12) !important;
}

.btn-hero-primary {
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, .25),
    0 4px 8px rgba(0, 0, 0, .15) !important;
  font-weight: 800 !important;
}
.btn-hero-secondary {
  background: rgba(255, 255, 255, .18) !important;
  border: 1.5px solid rgba(255, 255, 255, .45) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1) !important;
}

/* Stat cards di hero — kontras lebih kuat */
.hero-visual .stat-card,
.hero-visual .stat-card-sm,
.stat-card, .stat-card-sm {
  background: rgba(255, 255, 255, .18) !important;
  border: 1.5px solid rgba(255, 255, 255, .35) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, .15),
    inset 0 1px 0 rgba(255, 255, 255, .25) !important;
}

/* Wave divider antara hero & content section */
.white-section,
.bg-blue-section,
section.section-pad {
  position: relative;
  z-index: 3;
}

/* White section kontras tegas: angkat ke atas dengan shadow */
.white-section {
  background: #ffffff !important;
  margin-top: -40px;
  border-radius: 32px 32px 0 0;
  box-shadow: 
    0 -20px 40px rgba(15, 23, 42, .08),
    0 -8px 20px rgba(15, 23, 42, .04);
  position: relative;
  z-index: 4;
}
.white-section + .white-section {
  margin-top: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Bg blue section: pakai gradient bold yg jelas beda dari putih */
.bg-blue-section {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%) !important;
  border-top: 1px solid rgba(37, 99, 235, .08);
  position: relative;
}
.bg-blue-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.15), transparent);
}

/* Surat card lebih tegas elevation */
.surat-card {
  background: #fff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 
    0 1px 3px rgba(15, 23, 42, .05),
    0 4px 12px rgba(15, 23, 42, .04) !important;
}
.surat-card:hover {
  border-color: #2563eb !important;
  box-shadow: 
    0 10px 25px rgba(37, 99, 235, .15),
    0 4px 10px rgba(37, 99, 235, .1) !important;
}

/* Track box lebih elevated */
.track-box {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 
    0 20px 50px rgba(15, 23, 42, .1),
    0 8px 16px rgba(15, 23, 42, .06) !important;
  position: relative;
}
.track-box::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(37,99,235,.1), transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* Step cards lebih elevated */
.step-card {
  background: #fff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04) !important;
}
.step-card:hover {
  border-color: #93c5fd !important;
  box-shadow: 
    0 12px 24px rgba(37, 99, 235, .1),
    0 4px 8px rgba(37, 99, 235, .05) !important;
}

/* Section title lebih kuat */
.section-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}
.chip {
  background: linear-gradient(135deg, #eff6ff, #dbeafe) !important;
  border: 1px solid #93c5fd !important;
  color: #1d4ed8 !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, .08);
}

/* Tab button kontras */
.tab-btn {
  background: #fff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #475569 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.tab-btn:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
}
.tab-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35) !important;
}

/* Footer lebih dramatic */
.footer-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  position: relative;
  z-index: 5;
}
.footer-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1d4ed8, #2563eb, #0284c7);
}

/* Mobile fix hero */
@media (max-width: 880px) {
  body.page-index::before { 
    height: 640px !important; 
  }
  body.page-index::after {
    height: 640px !important;
  }
  .hero { padding: 40px 16px 70px !important; }
  .white-section { margin-top: -32px; border-radius: 24px 24px 0 0; }
}

/* Dark mode hint untuk konten utama yang putih */
.surat-grid > .surat-card .surat-name { color: #0f172a !important; }
.pgj-info h4, .form-section-title { color: #0f172a !important; }

/* =============================================================
   ADMIN DASHBOARD — RESPONSIVE FIX (v2.1)
   Memperbaiki: dashboard admin kepotong di mobile, hanya cocok desktop
   ============================================================= */

/* Tablet & smaller — sidebar otomatis collapse */
@media (max-width: 1024px) {
  .layout {
    display: block !important;
  }
  .menu-toggle {
    display: flex !important;
  }
  .main-content {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

/* Sidebar mobile — slide dari kiri, full smooth */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    z-index: 1001 !important;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 30px rgba(15, 23, 42, .25);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, .55) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    display: block !important;
  }
  .sidebar-overlay.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Topbar mobile fix */
@media (max-width: 768px) {
  .topbar {
    padding: 0 14px !important;
    height: 56px !important;
    gap: 10px !important;
  }
  .topbar-title {
    font-size: 14px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-date {
    font-size: 11px !important;
    display: none !important;
  }
}
@media (max-width: 480px) {
  .topbar { padding: 0 10px !important; }
  .menu-toggle { width: 32px !important; height: 32px !important; }
}

/* Content padding lebih ringan di mobile */
@media (max-width: 768px) {
  .content { 
    padding: 14px 12px !important; 
  }
  .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .page-header > * {
    width: 100%;
  }
}

/* Stats grid — pastikan minmax tidak overflow */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .stat-card {
    padding: 12px 14px !important;
  }
  .stat-value {
    font-size: 22px !important;
    word-break: break-all;
  }
  .stat-label {
    font-size: 11px !important;
    line-height: 1.3;
  }
}
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Charts container mobile fix - hapus overflow */
@media (max-width: 768px) {
  .charts-grid,
  .chart-row,
  .chart-card,
  .chart-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* Filter bar mobile */
@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .filter-bar > * {
    width: 100% !important;
  }
  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
  }
}

/* Tabel responsive — pastikan card-style work properly */
@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: visible !important;
    border: none !important;
    background: transparent !important;
  }
  table { 
    min-width: 0 !important; 
    width: 100% !important;
    background: transparent !important;
  }
  table, thead, tbody, th, td, tr {
    display: block !important;
  }
  thead {
    display: none !important;
  }
  tbody tr {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    padding: 14px 16px !important;
    box-shadow: 0 1px 3px rgba(15,23,42,.04) !important;
  }
  tbody tr:hover {
    border-color: #93c5fd !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .1) !important;
  }
  td {
    padding: 6px 0 !important;
    border: none !important;
    font-size: 13px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 8px !important;
    line-height: 1.45;
  }
  td::before {
    content: attr(data-label);
    flex-shrink: 0;
    min-width: 80px;
    max-width: 80px;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #64748b !important;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding-top: 1px;
  }
  td.actions {
    margin-top: 8px !important;
    padding-top: 10px !important;
    border-top: 1px solid #f1f5f9 !important;
    flex-wrap: wrap;
  }
  td.actions::before {
    display: none;
  }
}

/* Sidebar brand tampak penuh saat open di mobile */
@media (max-width: 1024px) {
  .sidebar-brand {
    padding: 18px 18px 14px !important;
  }
  .sidebar-nav {
    padding: 8px !important;
  }
  .sidebar-nav a {
    padding: 11px 14px !important;
    font-size: 13.5px !important;
  }
}

/* Body admin pakai bg yang clean */
.layout, body:has(.layout) {
  background: #f1f5f9 !important;
}

/* Detail/profil cards di admin lebih elevated di mobile */
@media (max-width: 768px) {
  .info-card,
  .detail-card,
  .form-card {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  .info-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* Action buttons mobile-friendly tap target */
@media (max-width: 768px) {
  .btn, .btn-aksi, .btn-detail, .btn-aksi-sm {
    min-height: 38px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
  td.actions .btn-aksi,
  td.actions .btn-detail {
    flex: 1 1 auto;
    min-width: max-content;
  }
}

/* Modal fullscreen di mobile */
@media (max-width: 640px) {
  .modal-content,
  .modal-dialog {
    margin: 10px !important;
    max-width: calc(100% - 20px) !important;
    width: calc(100% - 20px) !important;
  }
}

/* =============================================================
   ADMIN DASHBOARD FIXES (v2.2) — 08 Mei 2026
   1. Stat cards: angka kontras dengan bg
   2. Logout button selalu prominent  
   3. Sidebar footer padding cukup
   ============================================================= */

/* ── Stat cards angka kontras ── */
.stat-card .stat-value,
.stat-card-dash .stat-num-dash,
.stats-grid .stat-card .stat-value {
  color: #0f172a !important;          /* hitam kontras */
  font-weight: 800 !important;
  text-shadow: none !important;
}

/* Per-color stat cards: angka pakai warna border yang sesuai */
.stat-card.c-hari .stat-value     { color: #6d28d9 !important; }   /* purple */
.stat-card.c-tunggu .stat-value   { color: #b45309 !important; }   /* amber-darker */
.stat-card.c-proses .stat-value   { color: #1d4ed8 !important; }   /* blue */
.stat-card.c-selesai .stat-value  { color: #047857 !important; }   /* emerald */
.stat-card.c-tolak .stat-value    { color: #b91c1c !important; }   /* red */
.stat-card.c-ditolak .stat-value  { color: #b91c1c !important; }   /* red */

/* Pastikan stat label readable */
.stat-card .stat-label,
.stat-card-dash .stat-lbl {
  color: #475569 !important;
  font-weight: 700 !important;
}

/* ── Tombol logout — selalu kelihatan jelas ── */
.logout-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .25);
  color: #fca5a5 !important;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
}
.logout-btn i {
  font-size: 16px;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, .25) !important;
  color: #fff !important;
  border-color: rgba(239, 68, 68, .5);
  transform: translateX(2px);
}
.logout-btn:active {
  transform: scale(.98);
}

/* ── Sidebar footer padding-bottom cukup di mobile ── */
.sidebar-footer {
  padding-bottom: 24px !important;
  margin-top: auto;
}

@media (max-width: 1024px) {
  .sidebar {
    overflow-y: auto;
  }
  .sidebar-footer {
    padding-bottom: 32px !important;
  }
}

/* ── Bell notification icon — pastikan selalu ada hover ── */
.notif-bell-wrap {
  position: relative;
  cursor: pointer;
}
.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--surface, #fff);
}

/* =============================================================
   HAMBURGER BADGE (v2.3) — 09 Mei 2026
   Badge merah di hamburger button untuk indicator notif unread
   Berlaku di:
   - Admin dashboard: #menuToggle (button class .menu-toggle)
   - Warga header:    .nav-toggle-dash button
   ============================================================= */

/* ── Admin: menu-toggle ── */
.menu-toggle {
  position: relative !important;
}
.menu-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.menu-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: -.2px;
  border: 2px solid var(--surface, #ffffff);
  box-shadow: 0 2px 6px rgba(220, 38, 38, .45);
  animation: badgePulse 2s ease-in-out infinite;
  pointer-events: none;
}

/* ── Warga: nav-toggle-dash ── */
.nav-toggle-dash {
  position: relative !important;
}
.nav-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.nav-toggle-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: -.2px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, .45);
  animation: badgePulse 2s ease-in-out infinite;
  pointer-events: none;
}

/* Animasi pulse halus — perhatian tanpa annoying */
@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 2px 6px rgba(220, 38, 38, .45),
                0 0 0 0 rgba(239, 68, 68, .55);
  }
  50% {
    box-shadow: 0 2px 6px rgba(220, 38, 38, .45),
                0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* Hormati prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .menu-toggle-badge, .nav-toggle-badge { animation: none; }
}
