/* ============================================================
   WEBSITE RESMI DESA NGEMBE
   Design System - CSS3
   Tema: Hijau, Putih, Coklat (Alam & Kehidupan Desa)
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Primary - Hijau Alam */
  --primary: #2d6a4f;
  --primary-light: #40916c;
  --primary-lighter: #52b788;
  --primary-lightest: #b7e4c7;
  --primary-bg: #d8f3dc;
  --primary-dark: #1b4332;
  --primary-darker: #081c15;

  /* Secondary - Coklat Tanah */
  --secondary: #8B6914;
  --secondary-light: #a67c00;
  --secondary-lighter: #c49102;
  --secondary-lightest: #fce4a8;
  --secondary-bg: #fef9e7;
  --secondary-dark: #6b4f10;
  --secondary-darker: #4a3509;

  /* Neutral */
  --white: #ffffff;
  --gray-50: #fafaf9;
  --gray-100: #f5f5f4;
  --gray-200: #e7e5e4;
  --gray-300: #d6d3d1;
  --gray-400: #a8a29e;
  --gray-500: #78716c;
  --gray-600: #57534e;
  --gray-700: #44403c;
  --gray-800: #292524;
  --gray-900: #1c1917;

  /* Semantic */
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;

  /* Theme */
  --bg: var(--white);
  --bg-alt: var(--gray-50);
  --text: var(--gray-800);
  --text-secondary: var(--gray-500);
  --text-heading: var(--gray-900);
  --border: var(--gray-200);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);

  /* Layout */
  --nav-height: 76px;
  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DARK THEME VARIABLES OVERRIDE
   ============================================================ */
[data-theme="dark"] {
  --bg: #121212;
  --bg-alt: #1a1a1a;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-heading: #f8fafc;
  --border: #292524;
  --white: #1c1917; /* Card background is now dark gray */
  --gray-50: #1c1917;
  --gray-100: #292524;
  --gray-200: #44403c;
  --gray-600: #d6d3d1;
  --gray-800: #fafaf9;
  --gray-900: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.7);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.8);
}

/* Custom dark mode adjustments */
[data-theme="dark"] .navbar {
  background: rgba(28, 25, 23, 0.92);
}
[data-theme="dark"] .navbar.scrolled {
  background: rgba(28, 25, 23, 0.98);
}
[data-theme="dark"] .navbar-brand {
  color: var(--white);
}
[data-theme="dark"] .navbar-brand span {
  background: linear-gradient(135deg, var(--white), var(--primary-lighter));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="dark"] .navbar-menu a {
  color: var(--gray-300);
}
[data-theme="dark"] .navbar-menu a:hover,
[data-theme="dark"] .navbar-menu a.active {
  background: rgba(82, 183, 136, 0.15);
  color: var(--primary-lighter);
}
[data-theme="dark"] .hamburger span {
  background: var(--gray-300);
}
[data-theme="dark"] .theme-toggle {
  color: var(--gray-300);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Poppins', 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.3;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--primary-lighter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

.navbar.scrolled {
  background: rgba(255,255,255,0.98);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
  height: 66px;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.2rem;
}

.navbar-brand .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--white);
  font-weight: 800;
  transition: transform var(--transition);
}

.navbar-brand:hover .logo-icon {
  transform: rotate(-5deg) scale(1.05);
}

.navbar-brand span {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Menu */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.navbar-menu a {
  display: block;
  padding: 10px 18px;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}

.navbar-menu a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.navbar-menu a:hover,
.navbar-menu a.active {
  color: var(--primary);
  background: var(--primary-bg);
}

.navbar-menu a:hover::after,
.navbar-menu a.active::after {
  width: 24px;
}

/* Theme Switcher */
.theme-switch {
  display: inline-block;
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .slider {
  position: absolute;
  inset: 0;
  background-color: var(--gray-300);
  border-radius: var(--radius-full);
  transition: background-color var(--transition);
}

.theme-switch .slider::before {
  content: "☀️";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform var(--transition), background-color var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.theme-switch input:checked + .slider {
  background-color: var(--primary-light);
}

.theme-switch input:checked + .slider::before {
  transform: translateX(24px);
  content: "🌙";
  background-color: var(--primary-dark);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: all var(--transition);
  transform-origin: center;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .navbar {
    height: 72px !important;
  }

  .navbar.scrolled {
    height: 64px !important;
  }

  .navbar-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
  }

  .navbar-menu.open {
    display: flex;
  }

  .navbar-menu a {
    font-size: 1rem;
    padding: 12px 20px;
    text-align: center;
    width: 100%;
  }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 12s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(27, 67, 50, 0.3) 0%,
    rgba(27, 67, 50, 0.6) 50%,
    rgba(8, 28, 21, 0.85) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-content {
  color: var(--white);
  max-width: 750px;
  padding: 0 24px;
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.2;
  text-shadow: 0 4px 20px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s ease 0.3s forwards;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0;
  line-height: 1.8;
  color: rgba(255,255,255,0.9);
  margin-bottom: 32px;
  transform: translateY(20px);
  animation: fadeUp 1s ease 0.6s forwards;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease 0.9s forwards;
}

/* Hero Dots */
.hero-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: 2px solid rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all var(--transition);
}

.hero-dot.active {
  background: var(--white);
  border-color: var(--white);
  transform: scale(1.3);
}

/* Hero Arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.25);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hero-arrow:hover {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.8);
  transform: translateY(-50%) scale(1.1);
}

.hero-arrow-prev { left: 24px; }
.hero-arrow-next { right: 24px; }

@media (max-width: 768px) {
  .hero { min-height: 500px; }
  .hero-content h1 { font-size: 2rem; }
  .hero-content p { font-size: 0.95rem; }
  .hero-arrow {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .hero-arrow-prev { left: 12px; }
  .hero-arrow-next { right: 12px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(45, 106, 79, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  box-shadow: 0 6px 25px rgba(45, 106, 79, 0.5);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}

.btn-outline-white:hover {
  background: var(--white);
  color: var(--primary-dark);
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(139, 105, 20, 0.3);
}

.btn-secondary:hover {
  box-shadow: 0 6px 25px rgba(139, 105, 20, 0.45);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.82rem;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 80px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-green {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .section-tag {
  display: inline-block;
  padding: 6px 20px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.section-green .section-tag {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
}

.section-green .section-header h2 { color: var(--white); }

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  margin: 16px auto 0;
}

.section-green .section-header h2::after {
  background: linear-gradient(90deg, var(--secondary-lighter), var(--white));
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-green .section-header p {
  color: rgba(255,255,255,0.8);
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .section-header h2 { font-size: 1.75rem; }
  .section-header { margin-bottom: 40px; }
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.about-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.about-image:hover img {
  transform: scale(1.03);
}

.about-image::after {
  content: '';
  position: absolute;
  bottom: -12px;
  right: -12px;
  width: 100%;
  height: 100%;
  border: 3px solid var(--primary-lighter);
  border-radius: var(--radius-lg);
  z-index: -1;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
  text-align: justify;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.stat-item {
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-lightest);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.demografi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-image::after { display: none; }
  .about-image img { height: 280px; }
  .demografi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* ============================================================
   POTENSI / FEATURE CARDS
   ============================================================ */
.potensi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.potensi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.potensi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.potensi-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-lightest);
}

.potensi-card:hover::before {
  transform: scaleX(1);
}

.potensi-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
  transition: transform var(--transition);
}

.potensi-card:hover .potensi-icon {
  transform: scale(1.1) rotate(-5deg);
}

.potensi-icon.green { background: var(--primary-bg); }
.potensi-icon.gold { background: var(--secondary-bg); }
.potensi-icon.brown { background: #fef3c7; }

.potensi-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.potensi-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 768px) {
  .potensi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   GALERI
   ============================================================ */
.galeri-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.galeri-item {
  flex: 0 1 calc(33.333% - 13.4px);
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.galeri-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.galeri-item:hover img {
  transform: scale(1.1);
}

.galeri-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 28, 21, 0.8) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.galeri-item:hover .galeri-overlay {
  opacity: 1;
}

.galeri-overlay p {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
}

@media (max-width: 992px) and (min-width: 769px) {
  .galeri-grid .galeri-item { flex: 0 1 calc(50% - 10px); }
}

@media (max-width: 768px) {
  .galeri-grid { gap: 24px; }
  .galeri-grid .galeri-item { flex: 0 1 100%; }
}

/* ============================================================
   BERITA / NEWS CARDS
   ============================================================ */
.berita-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.berita-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.berita-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-lightest);
}

.berita-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.berita-card:hover .berita-card-img {
  transform: scale(1.05);
}

.berita-card-img-wrapper {
  overflow: hidden;
}

.berita-card-body {
  padding: 20px;
}

.berita-card-date {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.berita-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.berita-card h3 a {
  color: var(--text-heading);
  transition: color var(--transition);
}

.berita-card h3 a:hover { color: var(--primary); }

.berita-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: justify;
}

/* Berita Detail Modal */
.berita-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.berita-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.berita-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.berita-modal-overlay.active .berita-modal {
  transform: translateY(0) scale(1);
}

.berita-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.berita-modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: rotate(90deg);
}

.berita-modal-img-wrap {
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.berita-modal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.berita-modal-body {
  padding: 28px 32px 32px;
}

.berita-modal-date {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.berita-modal-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.berita-modal-isi {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  text-align: justify;
  white-space: pre-line;
}

/* Berita Modal scrollbar */
.berita-modal::-webkit-scrollbar { width: 6px; }
.berita-modal::-webkit-scrollbar-track { background: transparent; }
.berita-modal::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

@media (max-width: 768px) {
  .berita-modal-overlay { padding: 16px; }
  .berita-modal { max-height: 90vh; }
  .berita-modal-img-wrap { height: 200px; }
  .berita-modal-body { padding: 20px 24px 24px; }
  .berita-modal-body h2 { font-size: 1.2rem; }
}

/* Info Card List Layout */
.info-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 200px;
}

.info-card .berita-card-img-wrapper {
  width: 30%;
  flex-shrink: 0;
}

.info-card .berita-card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-card .berita-card-body {
  width: 70%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-card .berita-card-body .btn {
  align-self: flex-start;
}

.sambutan-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .sambutan-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .info-card {
    flex-direction: column;
  }
  
  .info-card .berita-card-img-wrapper {
    width: 100%;
    height: 200px;
  }
  
  .info-card .berita-card-body {
    width: 100%;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .berita-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--primary-darker);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 20px;
  position: relative;
}

.footer h4::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--primary-lighter);
  border-radius: 2px;
  margin-top: 10px;
}

.footer p,
.footer li {
  font-size: 0.88rem;
  line-height: 1.8;
}

.footer ul { list-style: none; }

.footer ul li { margin-bottom: 6px; }

.footer a {
  color: rgba(255,255,255,0.7);
  transition: all var(--transition);
}

.footer a:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-contact-item {
  display: flex;
  align-items: start;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-contact-item .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
  padding-left: 0;
}

.footer-social a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 0.8s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(9) { transition-delay: 0.9s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(10) { transition-delay: 1.0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(11) { transition-delay: 1.1s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(12) { transition-delay: 1.2s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(13) { transition-delay: 1.3s; opacity: 1; transform: translateY(0); }
/* Catch-all for 14th child and beyond */
.reveal-stagger.visible > *:nth-child(n+14) { transition-delay: 1.4s; opacity: 1; transform: translateY(0); }

/* ============================================================
   PAGE HEADER (Internal Pages)
   ============================================================ */
.page-header {
  padding: 140px 0 60px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.page-header h1 {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 12px;
}

.page-header p {
  color: rgba(255,255,255,0.8);
  font-size: 1.05rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

.breadcrumb a { color: rgba(255,255,255,0.8); }
.breadcrumb a:hover { color: var(--white); }

/* ============================================================
   ALERT / FLASH
   ============================================================ */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeUp 0.4s ease;
}

.alert-success { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid var(--primary-lightest); }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--secondary-bg); color: var(--secondary-dark); border: 1px solid var(--secondary-lightest); }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================================
   ADMIN LOGIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 40%, var(--primary) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(82,183,136,0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139,105,20,0.1) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  border-radius: 50%;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s ease;
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-card .login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-lighter));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--white);
  margin: 0 auto 16px;
}

.login-card h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 4px;
}

.login-card .login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
}

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

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
.admin-wrap {
  min-height: 100vh;
  background: var(--bg-alt);
}

.admin-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.admin-nav h1 {
  font-size: 1.2rem;
  color: var(--primary-dark);
}

.admin-body {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
}

.admin-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.admin-stat-card .stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.admin-stat-card .stat-icon-wrap.green { background: var(--primary-bg); }
.admin-stat-card .stat-icon-wrap.gold { background: var(--secondary-bg); }
.admin-stat-card .stat-icon-wrap.blue { background: #dbeafe; }
.admin-stat-card .stat-icon-wrap.red { background: #fee2e2; }

.admin-stat-card h3 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.admin-stat-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-body { padding: 20px; }
}

@media (max-width: 480px) {
  .admin-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   APARATUR DESA
   ============================================================ */
.aparatur-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  justify-content: center;
}

.aparatur-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 calc(33.333% - 14px);
  box-sizing: border-box;
}

.aparatur-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.aparatur-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-lightest);
}

.aparatur-card:hover::before {
  transform: scaleX(1);
}

.aparatur-photo-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--white) 100%);
  border: 3px solid var(--primary-lightest);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
  overflow: hidden;
}

.aparatur-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-theme="dark"] .aparatur-photo-wrap {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--gray-100) 100%);
  border-color: var(--primary-light);
}

.aparatur-card:hover .aparatur-photo-wrap {
  transform: scale(1.08) rotate(-3deg);
}

.aparatur-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-heading);
}

.aparatur-role {
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding: 2px 10px;
  background: var(--primary-bg);
  border-radius: var(--radius-full);
  display: inline-block;
}

[data-theme="dark"] .aparatur-role {
  color: var(--primary-lightest);
  background: rgba(82, 183, 136, 0.15);
}

.aparatur-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: justify;
}

/* Kades sits on its own row, centered, same card size */
.aparatur-kades {
  flex: 0 0 100%;
  max-width: calc(33.333% - 14px);
}

.aparatur-pimpinan,
.aparatur-anggota {
  /* same size as all other cards */
}

/* Hide cards after the 7th by default */
.aparatur-grid > *:nth-child(n+8) {
  display: none;
}

.aparatur-grid.show-all > *:nth-child(n+8) {
  display: flex;
}

/* Toggle button */
.aparatur-toggle-wrap {
  text-align: center;
  margin-top: 32px;
}

.btn-toggle-aparatur {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-toggle-aparatur:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-toggle-aparatur .toggle-icon {
  transition: transform 0.3s ease;
}

.btn-toggle-aparatur.active .toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .aparatur-grid {
    flex-direction: column;
    gap: 24px;
  }
  
  .aparatur-kades {
    max-width: 100%;
  }

  .aparatur-card {
    padding: 32px 20px;
    flex: 0 0 100%;
    width: 100%;
    min-height: 260px;
  }
  
  .aparatur-photo-wrap {
    width: 100px;
    height: 100px;
  }
  
  .aparatur-card h3 {
    font-size: 0.95rem;
  }
  
  .aparatur-role {
    font-size: 0.7rem;
  }

  /* On mobile 1-col: show kades + 3 = 4 initially */
  .aparatur-grid > *:nth-child(n+5) {
    display: none;
  }
  .aparatur-grid.show-all > *:nth-child(n+5) {
    display: flex;
  }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* ============================================================
   ADMIN DASHBOARD LAYOUT & DESIGN SYSTEM
   ============================================================ */
.admin-layout-body {
  background: var(--bg-alt);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
}

[data-theme="dark"] .admin-layout-body {
  background: #0b0f19;
}

/* Sidebar Styling */
.admin-sidebar {
  width: 260px;
  background: #1b4332;
  color: var(--white);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 990;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #143527;
}

.sidebar-nav {
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.nav-item:hover, .nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.nav-item.active {
  background: var(--primary);
  box-shadow: 0 4px 10px rgba(45, 106, 79, 0.3);
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

.nav-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Admin Main Wrapper */
.admin-main {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  width: calc(100% - 260px);
}

/* Header Styling */
.admin-header {
  height: 70px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 980;
}

[data-theme="dark"] .admin-header {
  background: #111827;
  border-color: #1f2937;
}

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

.header-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.sidebar-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-heading);
  transition: all 0.3s ease;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

.admin-profile .avatar {
  font-size: 1.4rem;
  background: var(--primary-bg);
  padding: 6px;
  border-radius: 50%;
}

/* Content Container */
.admin-content {
  padding: 32px;
  flex-grow: 1;
}

/* Card Container */
.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

[data-theme="dark"] .admin-card {
  background: #111827;
  border-color: #1f2937;
}

.card-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Action Bar */
.admin-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0 16px;
  width: 350px;
  max-width: 100%;
}

[data-theme="dark"] .search-box-wrapper {
  background: #1f2937;
  border-color: #374151;
}

.search-input {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 10px 8px !important;
  width: 100%;
}

/* Tables Formatting */
.table-card {
  padding: 0;
  overflow: hidden;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

[data-theme="dark"] .admin-table th, [data-theme="dark"] .admin-table td {
  border-color: #1f2937;
}

.admin-table th {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .admin-table th {
  background: #1f2937;
}

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

.admin-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Buttons */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-light { background: var(--bg-alt); color: var(--text-secondary); }
[data-theme="dark"] .badge-light { background: #1f2937; color: var(--text-secondary); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .btn-outline {
  border-color: #374151;
}

.btn-outline:hover {
  background: var(--bg-alt);
  transform: none;
}

[data-theme="dark"] .btn-outline:hover {
  background: #1f2937;
}

/* Modals */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.admin-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  overflow: hidden;
}

[data-theme="dark"] .modal-content {
  background: #111827;
}

.admin-modal.open .modal-content {
  transform: scale(1);
}

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

[data-theme="dark"] .modal-header {
  border-color: #1f2937;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.admin-form {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-heading);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: inherit;
}

[data-theme="dark"] .form-input {
  background: #1f2937;
  border-color: #374151;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.col-span-2 {
  grid-column: span 2;
}

.form-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0 16px 0;
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 8px;
}

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

/* Dashboard Stats layout */
.admin-dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-welcome-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .admin-welcome-section {
  background: #111827;
  border-color: #1f2937;
}

.admin-welcome-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.admin-welcome-section p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 800px;
  margin-bottom: 24px;
}

.quick-actions h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-recent-activity {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .admin-recent-activity {
  background: #111827;
  border-color: #1f2937;
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  font-size: 0.85rem;
  border-left: 2px solid var(--primary-light);
  padding-left: 14px;
}

.activity-time {
  color: var(--text-secondary);
  margin-right: 8px;
}

/* Settings Form Grid Layout */
.settings-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.system-info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sys-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .sys-item {
  border-color: #1f2937;
}

.sys-item:last-child {
  border-bottom: none;
}

.sys-label {
  color: var(--text-secondary);
}

.sys-val code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .sys-val code {
  background: #1f2937;
}

/* Admin Gallery Grid */
.galeri-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.galeri-admin-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: transform var(--transition);
}

[data-theme="dark"] .galeri-admin-card {
  background: #1f2937;
  border-color: #374151;
}

.galeri-img-wrap {
  aspect-ratio: 4/3;
  width: 100%;
  overflow: hidden;
}

.galeri-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.galeri-info-wrap {
  padding: 16px;
}

.galeri-cap {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6rem;
}

/* Pagination container spacing */
.admin-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

/* Mobile Responsive Sidebar Rules */
@media (max-width: 992px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
  }
  
  .admin-main {
    margin-left: 0;
    width: 100%;
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .admin-header {
    padding: 0 20px;
  }
  
  .admin-content {
    padding: 20px;
  }
}

/* ============================================================
   ANGGARAN DESA (APBDesa) SECTION
   ============================================================ */
.anggaran-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.anggaran-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.anggaran-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.anggaran-icon {
  font-size: 2.2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-income .anggaran-icon {
  background: rgba(5, 150, 105, 0.1);
}

.card-spending .anggaran-icon {
  background: rgba(139, 105, 20, 0.1);
}

.card-surplus .anggaran-icon {
  background: rgba(2, 132, 199, 0.1);
}

.anggaran-info {
  display: flex;
  flex-direction: column;
}

.anggaran-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.anggaran-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}

.anggaran-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.anggaran-detail-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.box-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.box-icon {
  font-size: 1.4rem;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
}

.progress-name {
  color: var(--text);
}

.progress-amount {
  color: var(--text-secondary);
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

[data-theme="dark"] .progress-track {
  background: #2d2a29;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
}

/* Color Fills */
.fill-dd { background: var(--primary); }
.fill-add { background: var(--primary-light); }
.fill-pades { background: var(--primary-lighter); }
.fill-bhpr { background: var(--primary-lightest); }

.fill-pembangunan { background: var(--secondary); }
.fill-pemerintahan { background: var(--secondary-light); }
.fill-pembinaan { background: var(--secondary-lighter); }
.fill-pemberdayaan { background: var(--secondary-lightest); }
.fill-bencana { background: var(--danger); }

/* Responsive adjustments */
@media (max-width: 992px) {
  .anggaran-overview {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .anggaran-details-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================================
   VISI & MISI GRID (Profil Page)
   ============================================================ */
.visi-misi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .visi-misi-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .visi-misi-grid > div {
    padding: 24px !important;
  }
}

/* ============================================================
   PROFIL PAGE MOBILE FIXES
   ============================================================ */
@media (max-width: 768px) {
  /* Anggaran cards: prevent value overflow */
  .anggaran-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 20px 16px;
  }

  .anggaran-value {
    font-size: 1.1rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .anggaran-label {
    font-size: 0.78rem;
  }

  /* Anggaran detail boxes */
  .anggaran-detail-box {
    padding: 20px 16px;
  }

  .box-title {
    font-size: 1.05rem;
  }

  /* Progress header: stack name and amount vertically on small screens */
  .progress-header {
    flex-direction: column;
    gap: 2px;
  }

  .progress-amount {
    font-size: 0.82rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .progress-name {
    font-size: 0.85rem;
  }

  /* Page header */
  .page-header h1 {
    font-size: 1.8rem;
  }

  /* Sambutan blockquote */
  .section blockquote {
    padding: 20px !important;
  }
}

