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

:root {
  /* Colors based on Boltshift layout but Green/Red themed */
  --bg-app: #f4f7f6; /* Soft grayish green */
  --bg-card: #ffffff;
  
  /* Primary Green */
  --primary: #10b981; 
  --primary-light: #d1fae5;
  --primary-dark: #059669;
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
  
  /* Accent Red */
  --accent: #e11d48;
  --accent-light: #ffe4e6;
  --accent-dark: #be123c;
  
  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Border & Shadows */
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.04);
  --shadow-lg: 0 15px 30px rgba(16, 185, 129, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  padding: 1.5rem;
  min-height: 100vh;
}

/* App Container */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 32px;
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-md);
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.nav-pills {
  display: flex;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.35rem;
  border-radius: 50px;
}

.nav-pills a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  border-radius: 50px;
  transition: all 0.3s;
}

.nav-pills a:hover {
  color: var(--text-main);
}

.nav-pills a.active {
  background: #0f172a;
  color: white;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}

.icon-btn:hover {
  color: var(--text-main);
}

.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-light);
}

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

.user-info .name {
  font-size: 0.85rem;
  font-weight: 700;
}

.user-info .email {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.page-title h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.btn:hover {
  background: #f8fafc;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

/* Stats Row 1 (4 columns) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card.primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card.primary .stat-title {
  color: rgba(255,255,255,0.9);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-card.primary .stat-icon { background: rgba(255,255,255,0.2); color: white; }
.stat-icon.green { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon.red { background: var(--accent-light); color: var(--accent-dark); }
.stat-icon.dark { background: var(--text-main); color: white; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.stat-badge.up { background: rgba(255,255,255,0.2); color: white; }
.stat-badge.green { background: var(--primary-light); color: var(--primary-dark); }
.stat-badge.red { background: var(--accent-light); color: var(--accent-dark); }

.stat-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}

.stat-card.primary .stat-footer {
  color: rgba(255,255,255,0.8);
}

/* Stats Row 2 (3 columns) */
.stats-grid-small {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Charts Area */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.dropdown-select {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  cursor: pointer;
}

.chart-container {
  height: 250px;
  width: 100%;
}

.gauge-container {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 1rem;
}

.gauge-value {
  position: absolute;
  top: 50%;
  text-align: center;
}

.gauge-value h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.gauge-value p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gauge-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-app);
}

.gauge-footer .label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.gauge-footer .val { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.gauge-footer .badge-inline {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  vertical-align: middle;
  margin-left: 4px;
}

/* Map & Countries Area */
.map-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.map-placeholder {
  flex: 1;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted);
  min-height: 250px;
  margin-top: 1rem;
}

.map-placeholder i {
  font-size: 2.5rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.countries-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 250px;
  padding-right: 0.5rem;
}

.country-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.country-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.country-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.country-stat {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .top-nav { flex-direction: column; gap: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .stats-grid-small { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .leaderboard-row { grid-template-columns: 1fr; }
}

/* Leaderboard Area */
.leaderboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.leaderboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.tab-nav {
  display: flex;
  gap: 0.25rem;
  background: #f8fafc;
  padding: 0.25rem;
  border-radius: 50px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.leaderboard-item:hover {
  background: #f1f5f9;
}

.opz-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.rank-badge.top-1 {
  background: #fef3c7;
  color: #d97706;
}
.rank-badge.top-2 {
  background: #f1f5f9;
  color: #475569;
}
.rank-badge.top-3 {
  background: #ffedd5;
  color: #c2410c;
}

.opz-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.opz-stat {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary-dark);
}

/* Insight Data Section */
.insight-section {
  margin-top: 2.5rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #fef9f0 100%);
  border: 1px solid #d1fae5;
  border-radius: 20px;
  padding: 2rem;
}

.insight-header {
  margin-bottom: 1.5rem;
}

.insight-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.insight-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.insight-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.1);
}

.insight-icon-sm {
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.insight-body {
  flex: 1;
}

.insight-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.insight-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.insight-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.insight-desc strong {
  color: var(--text-main);
}

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

/* Logos Marquee Section */
.logos-section {
  padding: 2rem 1.5rem;
  margin-top: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.logos-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
}

.marquee-container {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 2rem;
  width: 100%;
}

.marquee-content {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  gap: 2.5rem;
  min-width: 100%;
  animation: scrollMarquee 25s linear infinite;
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

.marquee-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 90px;
}

.marquee-item img {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: white;
  padding: 3px;
  border: none;
}

.marquee-item img:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.marquee-item span {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

@keyframes scrollMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100% - 2rem)); }
}

@media (max-width: 768px) {
  .marquee-item { width: 70px; }
  .marquee-item img { width: 50px; height: 50px; }
  .marquee-content { animation-duration: 20s; }
}

.mobile-rotate-notice {
  display: none;
}

/* Prevent Google Map tap flicker on mobile */
#regions_div, #modal-regions_div, #regions_div *, #modal-regions_div * {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
  outline: none;
}

/* Fullscreen Map Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

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

.modal-content {
  background: var(--bg-card);
  width: 95%;
  max-width: 1300px;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal-header h2 {
  font-size: 1.3rem;
  color: var(--text-dark);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close:hover {
  color: #e11d48;
}

/* Deep Mobile Responsiveness Fixes */
@media (max-width: 768px) {
  body { 
    padding: 0.5rem; 
  }
  .app-container {
    padding: 1.5rem 1rem;
    border-radius: 20px;
  }
  .page-title h1 {
    font-size: 1.4rem;
  }
  .stat-value {
    font-size: 1.5rem !important;
  }
  .stat-card {
    padding: 1.2rem;
  }
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  .modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  #modal-regions_div {
    height: 85vh !important;
  }
  .leaderboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .tab-nav {
    width: 100%;
    justify-content: space-between;
  }
  .insight-section {
    padding: 1.5rem 1rem;
  }
  .insight-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .stats-grid, .stats-grid-small {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .stats-grid::-webkit-scrollbar,
  .stats-grid-small::-webkit-scrollbar,
  .leaderboard-row::-webkit-scrollbar {
    display: none;
  }
  .stats-grid .stat-card {
    min-width: 70vw;
    scroll-snap-align: center;
  }
  .stats-grid-small .stat-card {
    min-width: 70vw;
    scroll-snap-align: center;
  }
  .leaderboard-row {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding-bottom: 10px;
    gap: 1rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .leaderboard-row .leaderboard-card {
    min-width: 85vw !important;
    scroll-snap-align: center !important;
  }
  .chart-container {
    overflow-x: auto;
  }
  .leaderboard-list {
    overflow-x: auto;
  }
  .leaderboard-list .leaderboard-item {
    min-width: 300px;
  }
  .logos-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.5rem;
  }
  .logo-item img {
    width: 100% !important;
    max-width: 75px !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }
  .mobile-rotate-notice {
    display: block;
    background: #fff3cd;
    color: #856404;
    text-align: center;
    padding: 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-radius: 10px;
    border: 1px solid #ffeeba;
  }
}

@media (max-width: 480px) {
  .top-nav {
    align-items: flex-start;
  }
  .nav-pills {
    flex-wrap: wrap;
  }
}

/* Static Logos Grid */
.logos-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem; /* Lebih rapat */
  padding: 1rem 0;
}

.logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.logo-item img {
  width: 90px;
  height: 52px;
  object-fit: contain;
  background: white;
  border: none;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.logo-item span {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.2;
}


/* Dark Mode Overrides */
body.dark-mode {
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #f1f5f9;
  --border-color: #334155;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.4);
}
body.dark-mode .nav-pills { background: #334155; }
body.dark-mode .nav-btn { color: #cbd5e1; }
body.dark-mode .tab-nav { background: #334155; }
body.dark-mode .modal-header { background: #1e293b; border-bottom: 1px solid #334155;}
/* logo filter removed */
body.dark-mode .stat-label { color: #cbd5e1; }
body.dark-mode .logos-section { background: #1e293b; }
body.dark-mode .country-item,
body.dark-mode .leaderboard-item,
body.dark-mode .map-placeholder {
  background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .insight-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
}
body.dark-mode .btn:hover { background: rgba(255, 255, 255, 0.1); }

body.dark-mode .stat-icon.dark { background: rgba(255, 255, 255, 0.1); color: #f8fafc; }


/* Toggle Buttons */
.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}
.action-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}
body.dark-mode .action-btn:hover {
  background: var(--primary-dark);
  color: white;
}

/* Footer Credit */
.footer-credit {
  text-align: center;
  margin-top: 3rem;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  border-top: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.footer-credit i {
  color: var(--primary);
  font-size: 1.1rem;
}

/* Sembunyikan Header Actions di Mobile */
@media (max-width: 768px) {
  .header-actions {
    display: none !important;
  }
}

/* Insight POV Tags */
.insight-pov {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  background: var(--primary-light);
  color: var(--primary-dark);
}
.insight-pov.pov-lembaga {
  background: #dbeafe;
  color: #1e40af;
}
.insight-pov.pov-publik {
  background: #fef3c7;
  color: #92400e;
}
body.dark-mode .insight-pov {
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
}
body.dark-mode .insight-pov.pov-lembaga {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
}
body.dark-mode .insight-pov.pov-publik {
  background: rgba(245,158,11,0.2);
  color: #fcd34d;
}

/* Data Table Section */
.data-table-section {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
}
.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}
.table-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.table-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.table-search {
  position: relative;
  display: flex;
  align-items: center;
}
.table-search i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.table-search input {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--bg-app);
  color: var(--text-main);
  width: 200px;
  transition: border-color 0.2s;
}
.table-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}
.table-filter select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--bg-app);
  color: var(--text-main);
  cursor: pointer;
}
.table-filter select:focus {
  outline: none;
  border-color: var(--primary);
}
.table-wrapper {
  overflow-x: auto;
}
#opz-data-table {
  width: 100%;
  border-collapse: collapse;
}
#opz-data-table thead {
  background: var(--bg-app);
}
#opz-data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}
#opz-data-table th.sortable {
  cursor: pointer;
  transition: color 0.2s;
}
#opz-data-table th.sortable:hover {
  color: var(--primary-dark);
}
#opz-data-table th i {
  margin-left: 0.25rem;
  font-size: 0.65rem;
}
#opz-data-table td {
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}
#opz-data-table tbody tr:hover {
  background: rgba(16,185,129,0.04);
}
.col-nama {
  font-weight: 600;
  min-width: 200px;
}
.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.skala-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.skala-nasional {
  background: #dbeafe;
  color: #1e40af;
}
.skala-provinsi {
  background: #fef3c7;
  color: #92400e;
}
.skala-kabkota {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.table-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-app);
}

/* Dark mode table */
body.dark-mode .table-search input,
body.dark-mode .table-filter select {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}
body.dark-mode #opz-data-table thead {
  background: #1e293b;
}
body.dark-mode #opz-data-table tbody tr:hover {
  background: rgba(16,185,129,0.08);
}
body.dark-mode .skala-nasional {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
}
body.dark-mode .skala-provinsi {
  background: rgba(245,158,11,0.2);
  color: #fcd34d;
}
body.dark-mode .skala-kabkota {
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
}
body.dark-mode .table-footer {
  background: #1e293b;
}

/* Mobile table */
@media (max-width: 768px) {
  .table-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .table-controls {
    width: 100%;
  }
  .table-search input {
    width: 100%;
  }
  .table-search {
    flex: 1;
  }
  #opz-data-table th, #opz-data-table td {
    padding: 0.5rem 0.6rem;
    font-size: 0.72rem;
  }
  .col-nama { min-width: 150px; }
}

/* AI Assistant Widget */
.ai-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(16,185,129,0.4);
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.3s, box-shadow 0.3s;
}
.ai-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(16,185,129,0.6);
}
.ai-chat-window {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 350px;
  height: 500px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  border: 1px solid var(--border-color);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}
.ai-chat-window.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.ai-header {
  background: var(--primary);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.ai-header .close-btn {
  cursor: pointer;
  font-size: 1.2rem;
}
.ai-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-app);
}
.chat-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.chat-msg.bot {
  background: var(--bg-card);
  align-self: flex-start;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 0;
  color: var(--text-main);
}
.chat-msg.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 0;
}
.ai-input-area {
  display: flex;
  padding: 0.75rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}
.ai-input-area input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-app);
  color: var(--text-main);
  outline: none;
}
.ai-input-area input:focus {
  border-color: var(--primary);
}
.ai-input-area button {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}
body.dark-mode .ai-chat-window {
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
  .ai-chat-window {
    width: calc(100% - 2rem);
    right: 1rem;
    left: 1rem;
    height: 400px;
  }
}

/* Efek Animasi "Berdenyut" layaknya Radar / Jantung */
@keyframes ai-pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Posisi, Warna, dan Bentuk Tombol */
.ai-fab {
    background: #f59e0b !important; /* Warna Emas/Amber Nujum */
    color: white !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5); /* Hapus !important agar bisa di-animasikan */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: ai-pulse 2s infinite; /* Memanggil efek denyut */
}

/* Efek saat Kursor Disorot ke Tombol (Hover) */
.ai-fab:hover {
    transform: scale(1.1) rotate(5deg) !important; /* Membesar 10% dan sedikit miring */
    background: #d97706 !important; /* Berubah menjadi warna emas yang lebih gelap */
}
.ai-header {
  background: #f59e0b !important;
}
.ai-input-area button {
  background: #f59e0b !important;
}
.chat-msg.user {
  background: #f59e0b !important;
}

/* Table Pagination controls */
.table-limit select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-color);
  font-size: 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.table-pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-page {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

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

#page-indicator {
  font-weight: 600;
  color: var(--text-color);
}

/* Contact Buttons */
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.contact-btn:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.contact-btn.wa-btn {
  background: #25D366;
  color: white;
  border-color: #25D366;
}
.contact-btn.wa-btn:hover {
  background: #20bd5a;
}


/* Dashboard Layout & Sidebar */
body {
  margin: 0;
  padding: 0;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-body);
  position: relative;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: linear-gradient(135deg, #1fb56b 0%, #10854d 100%);
  color: white;
  transition: width 0.3s ease 0.15s, transform 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  padding-top: 1.5rem;
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  z-index: 1000;
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.menu-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  margin-right: 15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-logo .logo-icon {
  background: white; 
  color: #10854d; 
  width: 36px; 
  height: 36px; 
  border-radius: 10px; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  font-weight: 900; 
  font-size: 20px; 
  flex-shrink: 0;
}

.sidebar-logo span {
  margin-left: 12px;
  font-weight: 800;
  font-size: 1.1rem;
  opacity: 1;
  transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .sidebar-logo .logo-icon {
  opacity: 0;
}

.sidebar.collapsed .sidebar-logo {
  padding-left: 16px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0 24px 24px 0;
  margin-right: 16px;
}

.sidebar.collapsed .sidebar-menu li a {
  border-radius: 50%;
  margin-right: 20px;
  padding: 12px 0;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 18px;
}

.sidebar-menu li a i {
  width: 40px;
  font-size: 1.15rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu li a i {
  width: auto;
}

.sidebar-menu li a span {
  margin-left: 5px;
  font-weight: 600;
  opacity: 1;
  transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-menu li a span {
  opacity: 0;
  display: none;
}

.sidebar-menu li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Hover overlay behavior for collapsed sidebar on desktop */
@media (min-width: 769px) {
  .sidebar.collapsed:hover {
    width: 250px;
    box-shadow: 4px 0 25px rgba(0,0,0,0.2);
    transition: width 0.3s ease 0s, transform 0.3s ease;
  }
  
  .sidebar.collapsed:hover .sidebar-logo span,
  .sidebar.collapsed:hover .sidebar-logo .logo-icon {
    opacity: 1;
  }
  
  .sidebar.collapsed:hover .sidebar-logo {
    padding-left: 20px;
  }
  
  .sidebar.collapsed:hover .sidebar-menu li a {
    border-radius: 0 24px 24px 0;
    margin-right: 16px;
    padding: 12px 20px;
    justify-content: flex-start;
    width: auto;
    height: auto;
    margin-left: 0;
  }
  
  .sidebar.collapsed:hover .sidebar-menu li a i {
    width: 40px;
  }
  
  .sidebar.collapsed:hover .sidebar-menu li a span {
    opacity: 1;
    display: inline;
  }
}

.sidebar-menu li.active a {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 2rem;
  overflow-y: auto;
  height: 100vh;
  box-sizing: border-box;
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 72px;
}

.mobile-header {
  display: none;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.mobile-header .menu-btn {
  color: #10854d;
  margin-right: 10px;
}

.mobile-header .mobile-logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: #10854d;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 250px !important;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar .menu-btn {
    display: none;
  }
  .main-content {
    margin-left: 0 !important;
    padding-top: 80px;
  }
  .mobile-header {
    display: flex;
  }
}

.app-container {
  /* Reset max-width if necessary, or let it center within main */
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}
