/* =============================================
   APPRT - Global CSS Design System
   Modern Dark + Mobile Responsive
   ============================================= */

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

:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 179, 237, 0.4);

  --text-primary: #f0f6ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;

  --gradient-main: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --gradient-hero: linear-gradient(135deg, #0a0f1e 0%, #1a2744 50%, #0d1b3e 100%);
  --gradient-card: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(6,182,212,0.05) 100%);

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --nav-height: 64px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 3px; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-blue); }

p { color: var(--text-secondary); }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section { padding: 4rem 0; }

.page-content {
  min-height: calc(100vh - var(--nav-height) - 80px);
  padding-top: calc(var(--nav-height) + 1.5rem);
  padding-bottom: 3rem;
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-main);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.navbar-brand .brand-name { display: flex; flex-direction: column; line-height: 1; }
.navbar-brand .brand-main { font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.navbar-brand .brand-sub { font-size: 0.65rem; font-weight: 500; color: var(--text-muted); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Logo RT / Perumahan di navbar */
.navbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: 0.25rem;
}
.navbar-logo:hover {
  border-color: var(--accent-blue);
  transform: scale(1.06);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}
.navbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.navbar-logo-placeholder {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.04em;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  transition: var(--transition);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 30, 0.98);
  backdrop-filter: blur(24px);
  z-index: 999;
  padding: 1.5rem;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }

.mobile-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}
.mobile-menu .nav-link:hover, .mobile-menu .nav-link.active {
  background: var(--gradient-card);
  border-color: var(--border-hover);
  color: var(--accent-blue);
}
.mobile-menu .nav-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.5rem 0;
}
.mobile-menu-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}
.btn-success:hover { background: rgba(16, 185, 129, 0.25); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.78rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-main);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.15); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); }

.stat-info .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-info .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-muted { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-secondary); color: var(--text-primary); }

textarea.form-control { resize: vertical; min-height: 120px; }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border-color);
}

th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

td {
  padding: 0.8rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

tbody tr {
  transition: var(--transition);
}
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* =============================================
   ALERTS / FLASH MESSAGES
   ============================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  border: 1px solid;
  animation: slideDown 0.3s ease;
}
.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); color: #4ade80; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.alert-info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); color: var(--accent-blue); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   HERO BANNER SLIDESHOW
   ============================================= */
.hero-banner {
  position: relative;
  width: 100%;
  height: 88vh;
  min-height: 480px;
  max-height: 780px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slides container */
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Individual slide */
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1s ease, transform 6s ease;
}
.hero-slide.active {
  opacity: 1;
  transform: scale(1.0);
}

/* Default gradient slide (no banners) */
.hero-slide-default {
  background: linear-gradient(135deg, #0a0f1e 0%, #1a2744 50%, #0d1b3e 100%);
  opacity: 1;
  transform: scale(1);
}

/* Dark overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(5, 10, 25, 0.65) 0%,
    rgba(5, 10, 25, 0.60) 40%,
    rgba(5, 10, 25, 0.82) 100%
  );
}

/* Content on top of overlay */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: var(--nav-height);
  width: 100%;
}

.hero-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Dots navigation */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}
.slider-dot.active,
.slider-dot:hover {
  background: white;
  border-color: white;
  transform: scale(1.2);
}

/* Arrows */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider-arrow:hover { background: rgba(59,130,246,0.5); border-color: var(--accent-blue); }
.slider-prev { left: 1.25rem; }
.slider-next { right: 1.25rem; }

@media (max-width: 768px) {
  .hero-banner { height: 70vh; max-height: 520px; }
  .hero-subtitle br { display: none; }
  .slider-arrow { width: 36px; height: 36px; font-size: 1.2rem; }
  .slider-prev { left: 0.6rem; }
  .slider-next { right: 0.6rem; }
}


/* =============================================
   NEWS CARDS
   ============================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}
.news-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: var(--transition);
}
.news-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.news-card:hover::before { opacity: 1; }

.news-card .news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.news-card .news-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

.news-card .news-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-read-more {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: auto;
}

/* =============================================
   WARGA CARDS / LIST
   ============================================= */
.warga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.warga-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
}
.warga-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.warga-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
  color: white;
}

.warga-nama { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.warga-blok { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Blok Group */
.blok-group { margin-bottom: 2rem; }
.blok-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.blok-label .blok-badge {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: white;
}
.blok-label .blok-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.page-header-right { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .sep { opacity: 0.4; }

/* =============================================
   IURAN TABLE STYLES
   ============================================= */
.status-lunas {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}
.status-belum {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

/* =============================================
   KIFAYAH
   ============================================= */
.kifayah-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}
.kifayah-item:last-child { border-bottom: none; }
.kifayah-amount {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}
.kifayah-amount.in { color: var(--accent-green); }
.kifayah-amount.out { color: var(--accent-red); }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(ellipse at 50% 50%, rgba(59,130,246,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.login-box {
  width: 100%;
  max-width: 420px;
  position: relative;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-glow);
}
.login-logo h1 { font-size: 1.5rem; font-weight: 800; }
.login-logo p { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; }

.login-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 1.5rem;
}
.login-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.login-tab.active {
  background: var(--gradient-main);
  color: white;
  box-shadow: 0 2px 10px rgba(59,130,246,0.3);
}
.login-form-wrap { display: none; }
.login-form-wrap.active { display: block; }

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 2.5rem; }

/* =============================================
   ADMIN SIDEBAR LAYOUT
   ============================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transform: translateX(0);
  transition: var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-brand .si { font-size: 1.4rem; }

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1.25rem 1.5rem 0.4rem;
}

.sidebar-nav { list-style: none; padding: 0 0.75rem; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}
.sidebar-nav a .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border-color);
}

.admin-main {
  flex: 1;
  margin-left: 240px;
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(10,15,30,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-content { padding: 1.5rem; }

/* Admin mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  font-size: 1.3rem;
}

/* =============================================
   SEARCH BAR
   ============================================= */
.search-wrap {
  position: relative;
  max-width: 340px;
}
.search-wrap .search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.search-wrap .form-control { padding-left: 2.4rem; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.pagination .active { background: var(--gradient-main); color: white; border-color: transparent; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.82rem; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.footer a { color: var(--accent-blue); }

/* =============================================
   UTILITIES
   ============================================= */
.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.ms-auto { margin-left: auto; }
.w-100 { width: 100%; }

/* =============================================
   RESPONSIVE - TABLET
   ============================================= */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.5); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; color: var(--text-secondary); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }
  .sidebar-overlay.open { display: block; }
}

/* =============================================
   RESPONSIVE - MOBILE
   ============================================= */
@media (max-width: 768px) {
  :root { --nav-height: 60px; }

  .navbar-nav { display: none; }
  .navbar-actions .btn-outline { display: none; }
  .hamburger { display: flex; }

  .hero { padding: calc(var(--nav-height) + 2rem) 0 2.5rem; }
  .hero-title { font-size: 1.9rem; }
  .hero-subtitle { font-size: 0.9rem; }

  .section { padding: 2.5rem 0; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .warga-grid { grid-template-columns: repeat(2, 1fr); }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-right { width: 100%; }
  .page-header-right .btn { flex: 1; justify-content: center; }

  .admin-topbar { padding: 0.75rem 1rem; }
  .admin-content { padding: 1rem; }

  .table-wrapper { font-size: 0.8rem; }
  th, td { padding: 0.65rem 0.75rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .warga-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 1.1rem; }
  .login-box { max-width: 100%; }
}

/* =============================================
   FOOTER — Premium Redesign
   ============================================= */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
}

/* ─── Top section ─── */
.footer-top {
  padding: 3rem 0 2rem;
}

.footer-top-inner {
  display: grid;
  grid-template-columns: 240px auto 1fr;
  gap: 2rem;
  align-items: start;
}

/* Brand column */
.footer-brand-col { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.2);
}
.footer-logo img { width: 100%; height: 100%; object-fit: cover; }

.footer-logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  border: 2px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-blue);
}

.footer-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.footer-brand-loc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-brand-loc i { color: var(--accent-blue); margin-right: 0.25rem; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  display:flex;
  align-items:center;
  gap:0.45rem;
  transition: var(--transition);
  padding: 0.1rem 0;
}
.footer-links a i { width: 14px; color: var(--accent-blue); }
.footer-links a:hover { color: var(--accent-blue); }

/* Vertical divider */
.footer-divider-v {
  width: 1px;
  background: var(--border-color);
  align-self: stretch;
  min-height: 140px;
}

/* Contacts column */
.footer-contacts-col { display: flex; flex-direction: column; gap: 1rem; }

.footer-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
  50%       { box-shadow: 0 0 16px rgba(16, 185, 129, 0.9); }
}

.footer-contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.footer-contact-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.footer-contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,.06) 0%, rgba(6,182,212,.04) 100%);
  opacity: 0;
  transition: var(--transition);
}
.footer-contact-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}
.footer-contact-card:hover::before { opacity: 1; }

.fcc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.footer-contact-card:hover .fcc-icon {
  background: rgba(16, 185, 129, 0.2);
}

.fcc-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  position: relative;
}
.fcc-nama {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcc-nomor {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-green);
  letter-spacing: 0.02em;
  font-feature-settings: 'tnum';
}

/* ─── Bottom / copyright ─── */
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.footer-bottom-inner strong { color: var(--text-secondary); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .footer-top-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .footer-divider-v { display: none; }
  .footer-contacts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .footer-contacts-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .footer-brand-col { align-items: center; text-align: center; }
  .footer-links { align-items: center; }
}
