/* ============================================
   MADIUN OS - Complete Stylesheet v2.0.2025
   Executive Command Center
   ============================================ */

/* --- CSS Variables --- */
:root {
  --midnight-blue: #0a1628;
  --deep-blue: #0d1b2a;
  --navy: #1b263b;
  --dark-navy: #152238;
  --emerald: #10b981;
  --emerald-glow: #34d399;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --gold-dim: rgba(245, 158, 11, 0.15);
  --neon-blue: #3b82f6;
  --neon-cyan: #06b6d4;
  --neon-purple: #8b5cf6;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --danger: #ef4444;
  --danger-glow: #f87171;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --warning: #eab308;
  --success: #22c55e;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --sidebar-width: 280px;
  --topbar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s ease;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--midnight-blue);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.sidebar-open { overflow: hidden; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--deep-blue); }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-blue); }

/* --- Selection --- */
::selection { background: var(--emerald); color: var(--white); }

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh;
  background: var(--midnight-blue);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 10000;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-brand {
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.loading-logo-img {
  width: 120px; height: auto; object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 8px 32px rgba(16, 185, 129, 0.25));
  animation: logoFloat 3s ease-in-out infinite alternate;
}
.loading-brand-text {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 6px;
  text-transform: uppercase; color: var(--gray-400);
}
.loading-bar {
  width: 200px; height: 3px;
  background: var(--navy); border-radius: 2px;
  margin-top: 2rem; overflow: hidden;
}
.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--neon-cyan));
  border-radius: 2px;
  animation: loading 2s ease-in-out infinite;
}
@keyframes loading {
  0% { width: 0; margin-left: 0; }
  50% { width: 100%; margin-left: 0; }
  100% { width: 0; margin-left: 100%; }
}
@keyframes glow {
  from { filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.5)); }
  to { filter: drop-shadow(0 0 40px rgba(6, 182, 212, 0.8)); }
}
@keyframes logoFloat {
  from { transform: translateY(0); filter: drop-shadow(0 8px 24px rgba(16, 185, 129, 0.2)); }
  to { transform: translateY(-6px); filter: drop-shadow(0 16px 40px rgba(6, 182, 212, 0.35)); }
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--midnight-blue) 0%, var(--deep-blue) 100%);
  display: flex; align-items: center; justify-content: center; z-index: 9998;
  transition: opacity 0.5s ease;
}
.login-screen.hidden { opacity: 0; pointer-events: none; }
.login-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl); padding: 3rem; width: 400px;
  backdrop-filter: blur(20px); text-align: center;
  animation: slideUp 0.5s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-logo { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; }
.login-subtitle { color: var(--gray-400); margin-bottom: 2rem; }
.login-form { text-align: left; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.5rem; font-weight: 500; }
.form-input {
  width: 100%; padding: 0.75rem 1rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); color: var(--white);
  font-size: 0.9rem; outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }
.login-btn {
  width: 100%; padding: 0.85rem;
  background: linear-gradient(135deg, var(--emerald), var(--neon-cyan));
  border: none; border-radius: var(--radius-sm); color: var(--white);
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3); }
.login-error { color: var(--danger); font-size: 0.8rem; margin-top: 1rem; text-align: center; display: none; }

/* ============================================
   LANDING SCREEN
   ============================================ */
.landing-screen {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100dvh;
  background: linear-gradient(135deg, var(--midnight-blue) 0%, var(--deep-blue) 50%, var(--navy) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity 1s ease, transform 1s ease;
  padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
           max(1rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.landing-screen.hidden { opacity: 0; transform: scale(1.1); pointer-events: none; }
.landing-content { text-align: center; z-index: 1; width: 100%; max-width: 520px; }
.landing-badge {
  display: inline-block; padding: 8px 24px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 50px; font-size: 0.85rem; color: var(--gray-300);
  margin-bottom: 1.5rem; backdrop-filter: blur(10px);
}
.landing-title {
  font-size: 5rem; font-weight: 900;
  background: linear-gradient(135deg, var(--white) 0%, var(--emerald) 50%, var(--neon-cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -2px; margin-bottom: 0.5rem;
}
.landing-subtitle { font-size: 1.5rem; color: var(--gray-400); font-weight: 300; margin-bottom: 0.5rem; }
.landing-tagline { font-size: 1rem; color: var(--gray-500); margin-bottom: 3rem; letter-spacing: 4px; text-transform: uppercase; }
.landing-score { display: flex; align-items: center; justify-content: center; gap: 3rem; margin-bottom: 2rem; }
.score-circle { position: relative; width: 180px; height: 180px; }
.score-circle svg { transform: rotate(-90deg); }
.score-circle .bg { stroke: var(--navy); fill: none; }
.score-circle .progress {
  stroke: url(#scoreGradient); fill: none;
  stroke-linecap: round; stroke-dasharray: 502; stroke-dashoffset: 502;
  transition: stroke-dashoffset 2s ease-out;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}
.score-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.score-value .number { font-size: 3rem; font-weight: 800; color: var(--emerald); font-family: 'JetBrains Mono', monospace; }
.score-value .label { font-size: 0.75rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 2px; }
.score-details { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.score-item { display: flex; align-items: center; gap: 1rem; }
.score-item .icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.score-item .info .value { font-size: 1.5rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.score-item .info .label { font-size: 0.75rem; color: var(--gray-400); }
.landing-status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 12px 32px; background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 50px;
  color: var(--success); font-weight: 600; font-size: 0.9rem; margin-top: 2rem;
}
.landing-status::before { content: ''; width: 8px; height: 8px; background: var(--success); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
.enter-btn {
  padding: 16px 48px; background: linear-gradient(135deg, var(--emerald), var(--neon-cyan));
  border: none; border-radius: var(--radius-md); color: var(--white);
  font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 2rem;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.enter-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3); }
.enter-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
.enter-btn:hover::after { left: 100%; }

/* ============================================
   PARTICLES
   ============================================ */
.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: hidden; }
.particle { position: absolute; width: 2px; height: 2px; background: var(--emerald); border-radius: 50%; opacity: 0.3; animation: float 20s infinite linear; }
@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container { display: none; min-height: 100vh; }
.app-container.active { display: flex; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px);
  z-index: 99; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { display: block; opacity: 1; }
.sidebar {
  width: var(--sidebar-width); height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, var(--deep-blue) 0%, var(--midnight-blue) 100%);
  border-right: 1px solid var(--glass-border);
  position: fixed; left: 0; top: 0; z-index: 100;
  display: flex; flex-direction: column; transition: transform 0.3s ease;
  -webkit-overflow-scrolling: touch;
}
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid var(--glass-border); }
.sidebar-logo { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-logo-img {
  width: 48px; height: 48px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35));
  transition: var(--transition);
}
.sidebar-logo:hover .sidebar-logo-img {
  filter: drop-shadow(0 4px 16px rgba(16, 185, 129, 0.3));
  transform: scale(1.04);
}
.sidebar-logo-text h3 {
  font-size: 1.1rem; font-weight: 800;
  background: linear-gradient(135deg, var(--white), var(--emerald));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-logo-text p { font-size: 0.65rem; color: var(--gray-500); letter-spacing: 1px; }
.sidebar-nav { flex: 1; padding: 1rem; overflow-y: auto; }
.nav-section { margin-bottom: 1.5rem; }
.nav-section-title { font-size: 0.65rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 2px; padding: 0.5rem 1rem; margin-bottom: 0.5rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  color: var(--gray-400); cursor: pointer; transition: var(--transition);
  margin-bottom: 0.25rem; position: relative;
}
.nav-item:hover { background: var(--glass-hover); color: var(--white); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), transparent);
  color: var(--emerald);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 24px; background: var(--emerald); border-radius: 0 2px 2px 0;
}
.nav-item-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--glass-bg); }
.nav-item-text { font-size: 0.85rem; font-weight: 500; flex: 1; }
.nav-item-badge { margin-left: auto; padding: 2px 8px; background: var(--danger); border-radius: 10px; font-size: 0.65rem; font-weight: 600; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--glass-border); }
.sidebar-footer-content { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 40px; height: 40px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--gold), var(--gold-light)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: var(--midnight-blue); }
.user-info .name { font-size: 0.85rem; font-weight: 600; }
.user-info .role { font-size: 0.7rem; color: var(--gray-500); }
.sidebar-user-menu { position: relative; }
.user-dropdown {
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--deep-blue); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 0.5rem; margin-bottom: 0.5rem;
  display: none; z-index: 200;
}
.sidebar-user-menu:hover .user-dropdown { display: block; }
.dropdown-item { padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; transition: var(--transition); }
.dropdown-item:hover { background: var(--glass-hover); }
.dropdown-item.danger { color: var(--danger); }

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

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  height: var(--topbar-height);
  background: rgba(10, 22, 40, 0.8); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.menu-toggle {
  display: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--white); cursor: pointer; font-size: 1.2rem;
  align-items: center; justify-content: center;
}
.datetime { display: flex; flex-direction: column; }
.datetime-date { font-size: 0.85rem; font-weight: 600; }
.datetime-time { font-size: 0.7rem; color: var(--gray-400); font-family: 'JetBrains Mono', monospace; }
.topbar-center { display: flex; align-items: center; gap: 1rem; }
.search-box {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1rem; background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  width: 300px;
}
.search-box input { flex: 1; background: transparent; border: none; outline: none; color: var(--white); font-size: 0.85rem; }
.search-box input::placeholder { color: var(--gray-500); }
.weather-widget { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.weather-icon { font-size: 1.2rem; }
.weather-temp { font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.weather-desc { font-size: 0.7rem; color: var(--gray-400); }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--white); cursor: pointer; font-size: 1rem;
  position: relative; transition: var(--transition);
}
.topbar-btn:hover { background: var(--glass-hover); border-color: var(--emerald); }
.topbar-btn .badge { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; background: var(--danger); border-radius: 50%; font-size: 0.6rem; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.topbar-btn.active { background: var(--emerald-dim); border-color: var(--emerald); }
.theme-toggle { font-size: 1.2rem; }
.ai-assistant-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
  border: none; border-radius: var(--radius-sm);
  color: var(--white); cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: var(--transition);
}
.ai-assistant-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4); }

/* ============================================
   PAGE
   ============================================ */
.page { display: none; padding: 2rem; animation: fadeIn 0.5s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.page-header { margin-bottom: 2rem; }
.page-header-brand {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); backdrop-filter: blur(12px);
}
.page-header-logo {
  width: 64px; height: 64px; object-fit: contain; flex-shrink: 0;
  opacity: 0.9;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.25));
}
.page-header h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.25rem; }
.page-header p { color: var(--gray-400); font-size: 0.9rem; }
.page-header-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid { display: grid; gap: 1.5rem; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  backdrop-filter: blur(10px); transition: var(--transition);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--emerald), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.card:hover { border-color: rgba(16, 185, 129, 0.3); transform: translateY(-2px); }
.card:hover::before { opacity: 1; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title { font-size: 0.85rem; color: var(--gray-400); font-weight: 500; }
.card-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.card-value { font-size: 2rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; margin-bottom: 0.5rem; }
.card-subtitle { font-size: 0.75rem; color: var(--gray-400); }
.card-footer { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.card-action { font-size: 0.8rem; color: var(--emerald); cursor: pointer; }
.card-action:hover { text-decoration: underline; }

/* Overview Card */
.overview-card { cursor: pointer; }
.overview-card .card-bg { position: absolute; top: 0; right: 0; width: 100px; height: 100px; opacity: 0.05; font-size: 5rem; }
.overview-card .trend { position: absolute; top: 1rem; right: 1rem; display: flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* Metric Card */
.metric-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 1.25rem 1rem;
}
.metric-card .metric-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin: 0 auto 0.75rem; flex-shrink: 0;
}
.metric-card .metric-body { width: 100%; }
.metric-card .metric-value {
  font-size: 1.65rem; font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.2rem; line-height: 1.2;
  word-break: break-word;
}
.metric-card .metric-label { font-size: 0.75rem; color: var(--gray-400); line-height: 1.3; }
.metric-card .metric-badge { margin-top: 0.4rem; display: inline-block; }

/* Alert Card */
.alert-card { background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1)); border: 1px solid rgba(139, 92, 246, 0.2); }
.alert-card .greeting { font-size: 0.85rem; color: var(--neon-purple); margin-bottom: 0.5rem; }
.alert-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.alert-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--glass-border); }
.alert-item:last-child { border-bottom: none; }
.alert-item .indicator { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.alert-item .indicator.green { background: var(--success); }
.alert-item .indicator.yellow { background: var(--warning); }
.alert-item .indicator.red { background: var(--danger); }
.alert-item .content { flex: 1; }
.alert-item .title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.alert-item .desc { font-size: 0.75rem; color: var(--gray-400); }

/* Scoreboard */
.scoreboard { background: linear-gradient(135deg, var(--navy), var(--dark-navy)); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 2rem; text-align: center; position: relative; overflow: hidden; }
.scoreboard::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 0deg, transparent, var(--emerald), transparent, var(--neon-cyan), transparent); animation: rotate 10s linear infinite; opacity: 0.1; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
.scoreboard-content { position: relative; z-index: 1; }
.scoreboard-label { font-size: 0.85rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 3px; margin-bottom: 0.5rem; }
.scoreboard-value { font-size: 5rem; font-weight: 900; font-family: 'JetBrains Mono', monospace; background: linear-gradient(135deg, var(--emerald), var(--neon-cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.scoreboard-target { margin-top: 1rem; font-size: 1rem; color: var(--gray-400); }
.scoreboard-target span { color: var(--gold); font-weight: 700; }

/* Stat Card */
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-content { flex: 1; }
.stat-value { font-size: 1.5rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.stat-label { font-size: 0.75rem; color: var(--gray-400); }

/* Program Card */
.program-card { cursor: default; }
.program-card .program-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.program-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.program-card .program-desc { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 1rem; }
.program-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.program-stat { text-align: center; padding: 0.5rem; background: var(--glass-bg); border-radius: var(--radius-sm); }
.program-stat .value { font-size: 1rem; font-weight: 700; color: var(--emerald); }
.program-stat .label { font-size: 0.65rem; color: var(--gray-500); }
.program-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--glass-border); }

/* Project Card */
.project-card { border-left: 3px solid var(--emerald); }
.project-card .project-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.project-card .project-name { font-size: 1rem; font-weight: 700; }
.project-card .project-location { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 1rem; }
.project-card .project-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.project-card .project-stat { text-align: center; }
.project-card .project-stat .value { font-size: 1.25rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.project-card .project-stat .label { font-size: 0.65rem; color: var(--gray-500); }
.project-card .risk-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; background: var(--glass-bg); border-radius: var(--radius-sm); font-size: 0.75rem; }

/* Finance Table */
.finance-table { width: 100%; border-collapse: collapse; }
.finance-table th { text-align: left; padding: 0.75rem; border-bottom: 1px solid var(--glass-border); font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }
.finance-table td { padding: 0.75rem; border-bottom: 1px solid var(--glass-border); font-size: 0.85rem; }
.finance-table tr:hover { background: var(--glass-hover); }
.finance-table .amount { font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* OPD Card */
.opd-card { padding: 1rem; }
.opd-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.opd-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.opd-name { font-size: 0.9rem; font-weight: 600; }
.opd-progress { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.opd-progress-bar { flex: 1; height: 6px; background: var(--navy); border-radius: 3px; overflow: hidden; }
.opd-progress-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; }
.status-badge.green { background: rgba(34, 197, 94, 0.15); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.3); }
.status-badge.yellow { background: rgba(234, 179, 8, 0.15); color: var(--warning); border: 1px solid rgba(234, 179, 8, 0.3); }
.status-badge.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.status-badge.blue { background: rgba(59, 130, 246, 0.15); color: var(--neon-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.status-badge.purple { background: rgba(139, 92, 246, 0.15); color: var(--neon-purple); border: 1px solid rgba(139, 92, 246, 0.3); }

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar { height: 6px; background: var(--navy); border-radius: 3px; overflow: hidden; margin-top: 0.75rem; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.progress-fill.green { background: linear-gradient(90deg, var(--emerald), var(--emerald-glow)); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--warning), var(--gold-light)); }
.progress-fill.red { background: linear-gradient(90deg, var(--danger), var(--danger-glow)); }
.progress-fill.blue { background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan)); }
.progress-fill.purple { background: linear-gradient(90deg, var(--neon-purple), #a78bfa); }

/* Mini Progress */
.mini-progress { display: flex; align-items: center; gap: 0.75rem; }
.mini-progress-bar { flex: 1; height: 4px; background: var(--navy); border-radius: 2px; overflow: hidden; }
.mini-progress-fill { height: 100%; border-radius: 2px; }
.mini-progress-value { font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; font-weight: 600; min-width: 40px; text-align: right; }

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-container { width: 100%; height: 250px; position: relative; }
.chart-container.tall { height: 350px; }
.chart-container.short { height: 180px; }

/* ============================================
   VILLAGE / KELURAHAN
   ============================================ */
.village-section-header {
  flex-wrap: wrap; gap: 0.75rem; align-items: flex-start;
}
.village-summary {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.village-summary-pill {
  font-size: 0.68rem; font-weight: 600; padding: 4px 10px;
  border-radius: 50px; background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.village-summary-pill.green { color: var(--success); border-color: rgba(34, 197, 94, 0.3); }
.village-summary-pill.yellow { color: var(--warning); border-color: rgba(234, 179, 8, 0.3); }
.village-summary-pill.red { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }

.district-tabs { flex-wrap: wrap; }
.district-blocks { display: flex; flex-direction: column; gap: 1.5rem; }
.district-block {
  padding: 1rem; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
}
.district-block-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 0.75rem; margin-bottom: 1rem;
}
.district-block-title {
  margin: 0; font-size: 1.05rem; color: var(--white);
}
.district-block-meta {
  margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--gray-400);
}
.district-grid { grid-template-columns: repeat(3, 1fr); }
.district-card-grid { margin-top: 0.75rem; }
.district-table-head {
  background: rgba(139, 92, 246, 0.12) !important;
  color: var(--neon-cyan) !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

/* Heatmap — desktop quick view */
.village-heatmap-desktop { margin-bottom: 1rem; }
.village-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 0.45rem; }
.village-item {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); position: relative;
}
.village-item.green { background: rgba(34, 197, 94, 0.18); border: 1px solid rgba(34, 197, 94, 0.35); }
.village-item.yellow { background: rgba(234, 179, 8, 0.18); border: 1px solid rgba(234, 179, 8, 0.35); }
.village-item.red { background: rgba(239, 68, 68, 0.18); border: 1px solid rgba(239, 68, 68, 0.35); }
.village-item:hover { transform: scale(1.08); z-index: 10; }
.village-item .name { font-size: 0.55rem; font-weight: 600; text-align: center; color: var(--gray-300); line-height: 1.1; }
.village-item .score { font-size: 0.72rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.village-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--deep-blue); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; width: 160px;
  font-size: 0.7rem; z-index: 100; pointer-events: none; opacity: 0;
  transition: opacity 0.2s ease; text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.village-item:hover .village-tooltip { opacity: 1; }

/* Village cards — modern list */
.village-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.village-card {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.village-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.village-card.green::before { background: linear-gradient(180deg, var(--success), rgba(34, 197, 94, 0.4)); }
.village-card.yellow::before { background: linear-gradient(180deg, var(--warning), rgba(234, 179, 8, 0.4)); }
.village-card.red::before { background: linear-gradient(180deg, var(--danger), rgba(239, 68, 68, 0.4)); }
.village-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--glass-hover);
  transform: translateY(-1px);
}
.village-card-score {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 800;
  font-size: 0.82rem; flex-shrink: 0;
}
.village-card.green .village-card-score {
  background: rgba(34, 197, 94, 0.12); color: var(--success);
  border: 2px solid rgba(34, 197, 94, 0.35);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.15);
}
.village-card.yellow .village-card-score {
  background: rgba(234, 179, 8, 0.12); color: var(--warning);
  border: 2px solid rgba(234, 179, 8, 0.35);
}
.village-card.red .village-card-score {
  background: rgba(239, 68, 68, 0.12); color: var(--danger);
  border: 2px solid rgba(239, 68, 68, 0.35);
}
.village-card-body { flex: 1; min-width: 0; }
.village-card-name {
  font-size: 0.88rem; font-weight: 700; margin-bottom: 0.2rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.village-card-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem;
  font-size: 0.62rem; color: var(--gray-500); margin-bottom: 0.35rem;
}
.village-card-bar {
  height: 3px; background: var(--navy); border-radius: 2px; overflow: hidden;
}
.village-card-bar-fill {
  height: 100%; border-radius: 2px; transition: width 0.6s ease;
}
.village-card-bar-fill.green { background: linear-gradient(90deg, var(--success), var(--emerald)); }
.village-card-bar-fill.yellow { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.village-card-bar-fill.red { background: linear-gradient(90deg, var(--danger), #f87171); }
.village-card-badge {
  flex-shrink: 0; font-size: 0.55rem !important;
  padding: 3px 7px !important; align-self: flex-start; margin-top: 2px;
}

.heatmap-legend {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 1.25rem;
  padding-top: 1rem; border-top: 1px solid var(--glass-border);
}
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; color: var(--gray-400); }
.legend-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-color.green { background: rgba(34, 197, 94, 0.5); }
.legend-color.yellow { background: rgba(234, 179, 8, 0.5); }
.legend-color.red { background: rgba(239, 68, 68, 0.5); }

/* ============================================
   COMMAND CENTER
   ============================================ */
.command-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; min-height: calc(100vh - 150px); }
.command-main { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1rem; }
.command-panel { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1rem; display: flex; flex-direction: column; }
.command-panel.full { grid-column: span 2; }
.command-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.command-panel-title { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.live-dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; animation: pulse 1s infinite; }
.cctv-placeholder { flex: 1; background: var(--navy); border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.cctv-placeholder::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.3) 2px, rgba(0, 0, 0, 0.3) 4px); pointer-events: none; }
.cctv-placeholder .cam-icon { font-size: 3rem; opacity: 0.5; }
.cctv-placeholder .cam-label { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.5rem; }
.emergency-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.emergency-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--glass-bg); border-radius: var(--radius-sm); }
.emergency-item .icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.emergency-item .info { flex: 1; }
.emergency-item .info .label { font-size: 0.7rem; color: var(--gray-400); }
.emergency-item .info .value { font-size: 0.85rem; font-weight: 600; }

/* ============================================
   AI ASSISTANT
   ============================================ */
.ai-container { max-width: 800px; margin: 0 auto; }
.ai-header { text-align: center; margin-bottom: 2rem; }
.ai-avatar { width: 80px; height: 80px; background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)); border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 1rem; animation: glow 3s ease-in-out infinite alternate; }
.ai-chat { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; max-height: min(60vh, 520px); overflow-y: auto; scroll-behavior: smooth; }
.chat-message { display: flex; gap: 1rem; margin-bottom: 1.5rem; align-items: flex-start; }
.chat-message.user { flex-direction: row-reverse; }
.chat-avatar { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.chat-message.ai .chat-avatar { background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)); }
.chat-message.user .chat-avatar { background: var(--gold); color: var(--midnight-blue); }
.chat-bubble { flex: 1; min-width: 0; padding: 1rem 1.15rem; border-radius: var(--radius-md); font-size: 0.9rem; line-height: 1.65; word-break: break-word; }
.chat-message.ai .chat-bubble { background: rgba(15, 23, 42, 0.55); border: 1px solid rgba(139, 92, 246, 0.25); }
.chat-message.user .chat-bubble { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2)); border: 1px solid rgba(16, 185, 129, 0.3); max-width: 85%; }
.chat-bubble.is-loading { display: flex; align-items: center; gap: 0.75rem; color: var(--gray-400); }
.ai-loading-text { font-size: 0.85rem; }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--neon-purple); animation: aiTyping 1.2s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTyping { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
.ai-md { display: flex; flex-direction: column; gap: 0.65rem; }
.ai-md .ai-h { margin: 0.35rem 0 0.15rem; font-weight: 700; line-height: 1.35; color: var(--white); }
.ai-md h2.ai-h { font-size: 1.05rem; color: var(--emerald); border-bottom: 1px solid rgba(16, 185, 129, 0.25); padding-bottom: 0.35rem; }
.ai-md h3.ai-h { font-size: 0.95rem; color: var(--neon-cyan); }
.ai-md h4.ai-h { font-size: 0.88rem; color: var(--gray-200); }
.ai-md .ai-p { margin: 0; color: var(--gray-200); }
.ai-md .ai-list { margin: 0.15rem 0 0.25rem; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; }
.ai-md .ai-list li { color: var(--gray-200); }
.ai-md .ai-list li::marker { color: var(--emerald); }
.ai-md strong { color: var(--white); font-weight: 600; }
.ai-md em { color: var(--gray-400); font-style: italic; }
.ai-md .ai-hr { border: none; border-top: 1px solid var(--glass-border); margin: 0.25rem 0; }
.ai-table-wrap { overflow-x: auto; margin: 0.15rem 0; border-radius: var(--radius-sm); border: 1px solid var(--glass-border); }
.ai-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ai-table th { background: rgba(139, 92, 246, 0.15); color: var(--white); font-weight: 600; text-align: left; padding: 0.55rem 0.75rem; white-space: nowrap; }
.ai-table td { padding: 0.5rem 0.75rem; border-top: 1px solid var(--glass-border); color: var(--gray-200); }
.ai-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.village-card-district { font-size: 0.72rem; color: var(--neon-cyan); margin-bottom: 0.35rem; }
.chat-timestamp { font-size: 0.65rem; color: var(--gray-500); margin-top: 0.25rem; }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.ai-action-btn { padding: 0.75rem 1.25rem; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); color: var(--white); font-size: 0.8rem; cursor: pointer; transition: var(--transition); }
.ai-action-btn:hover { background: rgba(139, 92, 246, 0.2); border-color: var(--neon-purple); }
.ai-input-container { display: flex; gap: 0.75rem; }
.ai-input { flex: 1; padding: 1rem 1.25rem; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md); color: var(--white); font-size: 0.9rem; outline: none; }
.ai-input:focus { border-color: var(--neon-purple); }
.ai-send-btn { padding: 0 1.5rem; background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)); border: none; border-radius: var(--radius-md); color: var(--white); cursor: pointer; font-size: 1.2rem; transition: var(--transition); }
.ai-send-btn:hover { transform: scale(1.05); }

/* ============================================
   TABS
   ============================================ */
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 0.5rem; flex-wrap: wrap; }
.tab { padding: 0.5rem 1rem; background: transparent; border: none; color: var(--gray-400); font-size: 0.85rem; cursor: pointer; transition: var(--transition); position: relative; }
.tab:hover { color: var(--white); }
.tab.active { color: var(--emerald); }
.tab.active::after { content: ''; position: absolute; bottom: -0.5rem; left: 0; right: 0; height: 2px; background: var(--emerald); }

/* ============================================
   EVENT CARDS
   ============================================ */
.event-card { padding: 1rem; }
.event-date { font-size: 0.7rem; color: var(--gray-400); margin-bottom: 0.25rem; }
.event-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; }
.event-visitors { font-size: 0.75rem; color: var(--gray-400); }
.event-revenue { font-size: 0.8rem; font-weight: 600; color: var(--emerald); margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; }

/* ============================================
   INVESTMENT CARDS
   ============================================ */
.investment-card { padding: 1rem; }
.investment-sector { font-size: 0.65rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.25rem; }
.investment-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; }
.investment-company { font-size: 0.75rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.investment-value { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--emerald); }
.investment-progress { margin-top: 0.75rem; }

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow-green { text-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
.glow-gold { text-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
.glow-cyan { text-shadow: 0 0 20px rgba(6, 182, 212, 0.5); }
.glow-red { text-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
.glow-purple { text-shadow: 0 0 20px rgba(139, 92, 246, 0.5); }

/* ============================================
   BUTTONS
   ============================================ */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; }
.btn-primary { background: linear-gradient(135deg, var(--emerald), var(--neon-cyan)); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3); }
.btn-secondary { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--white); }
.btn-secondary:hover { background: var(--glass-hover); }
.btn-danger { background: var(--danger-dim); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: var(--transition); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--deep-blue); border: 1px solid var(--glass-border); border-radius: var(--radius-xl); padding: 2rem; width: 500px; max-width: 90%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.25rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--white); cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--glass-hover); }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

/* ============================================
   NOTIFICATION PANEL
   ============================================ */
.notification-panel { position: fixed; top: var(--topbar-height); right: 2rem; width: 360px; background: var(--deep-blue); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 1rem; z-index: 200; display: none; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.notification-panel.active { display: block; }
.notification-header { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--glass-border); }
.notification-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--glass-border); cursor: pointer; }
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--glass-hover); margin: 0 -1rem; padding: 0.75rem 1rem; }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notification-dot.info { background: var(--neon-blue); }
.notification-dot.success { background: var(--success); }
.notification-dot.warning { background: var(--warning); }
.notification-dot.danger { background: var(--danger); }
.notification-content { flex: 1; }
.notification-title { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; }
.notification-desc { font-size: 0.7rem; color: var(--gray-400); }
.notification-time { font-size: 0.65rem; color: var(--gray-500); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { text-align: center; padding: 3rem; }
.empty-icon { font-size: 4rem; opacity: 0.5; margin-bottom: 1rem; }
.empty-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-desc { font-size: 0.85rem; color: var(--gray-400); }

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton { background: linear-gradient(90deg, var(--navy) 25%, var(--glass-hover) 50%, var(--navy) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-value { height: 2.5rem; width: 40%; margin-bottom: 0.5rem; }

/* ============================================
   TOAST / SNACKBAR
   ============================================ */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 1rem 1.5rem; background: var(--deep-blue); border: 1px solid var(--glass-border); border-radius: var(--radius-md); display: flex; align-items: center; gap: 0.75rem; animation: slideInRight 0.3s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-color: rgba(34, 197, 94, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }
.toast.warning { border-color: rgba(234, 179, 8, 0.3); }
.toast-icon { font-size: 1.2rem; }
.toast-message { font-size: 0.85rem; }
.toast-close { margin-left: auto; cursor: pointer; opacity: 0.5; }
.toast-close:hover { opacity: 1; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(4, 1fr); }
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .village-grid { grid-template-columns: repeat(6, 1fr); }
  .district-grid { grid-template-columns: repeat(3, 1fr); }
  .command-grid { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
  .village-card-grid { display: none; }
}

@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); width: min(var(--sidebar-width), 86vw); box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; }
  .app-container.active { flex-direction: column; }
  .menu-toggle { display: flex; min-width: 44px; min-height: 44px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 200px; }
  .weather-widget { display: none; }
  .village-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 768px) {
  html { font-size: 13px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
  .topbar {
    height: auto; min-height: 56px;
    padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left));
    gap: 0.5rem; flex-wrap: nowrap;
  }
  .topbar-left { flex: 1; min-width: 0; gap: 0.5rem; }
  .topbar-center { display: none; }
  .topbar-right { flex-shrink: 0; gap: 0.4rem; }
  .datetime { min-width: 0; }
  .datetime-date {
    font-size: 0.65rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 38vw;
  }
  .datetime-time { font-size: 0.65rem; }
  .topbar-btn { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
  .ai-assistant-btn {
    min-width: 44px; min-height: 44px; width: 44px; height: 44px;
    padding: 0; justify-content: center;
  }
  .ai-assistant-label { display: none; }
  .ai-assistant-icon { font-size: 1.1rem; }
  .page {
    padding: 1rem max(0.75rem, env(safe-area-inset-right)) 1.25rem max(0.75rem, env(safe-area-inset-left));
  }
  .page-header { margin-bottom: 1.25rem; }
  .page-header h1 { font-size: 1.35rem; }
  .page-header p { font-size: 0.8rem; }
  .page-header-brand { flex-direction: row; text-align: left; padding: 1rem; gap: 0.85rem; }
  .page-header-logo { width: 48px; height: 48px; }
  .card { padding: 1rem; border-radius: var(--radius-md); }
  .card-value { font-size: 1.5rem; }
  .card-header { flex-wrap: wrap; gap: 0.5rem; }
  .overview-card .card-bg { font-size: 3.5rem; width: 70px; height: 70px; }
  /* Metric cards — 2 kolom kompak, bukan stack penuh */
  .grid-4:has(.metric-card),
  .grid-5:has(.metric-card) {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .metric-card {
    flex-direction: row; align-items: center; text-align: left;
    padding: 0.75rem 0.85rem; gap: 0.7rem;
  }
  .metric-card:hover { transform: none; }
  .metric-card .metric-icon {
    width: 38px; height: 38px; font-size: 1rem;
    margin: 0; border-radius: 10px;
  }
  .metric-card .metric-body { flex: 1; min-width: 0; }
  .metric-card .metric-value { font-size: 0.95rem; margin-bottom: 0.1rem; }
  .metric-card .metric-label { font-size: 0.62rem; color: var(--gray-500); }
  .metric-card .metric-badge {
    margin-top: 0.2rem; font-size: 0.55rem;
    padding: 2px 6px; line-height: 1.3;
  }
  .scoreboard { padding: 1.25rem 1rem; border-radius: var(--radius-lg); }
  .scoreboard-value { font-size: 2.75rem; }
  .scoreboard-label { font-size: 0.7rem; letter-spacing: 1.5px; }
  .scoreboard-compact { display: none; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.25rem; }
  .chart-container { height: 220px; }
  .chart-container.tall { height: 260px; }
  .finance-table { min-width: 540px; }
  .card:has(.finance-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .search-box { display: none; }
  .loading-logo-img { width: 88px; }
  .loading-brand-text { letter-spacing: 4px; font-size: 0.75rem; }
  .landing-title { font-size: 2.75rem; letter-spacing: -1px; }
  .landing-subtitle { font-size: 1.1rem; }
  .landing-tagline { font-size: 0.7rem; letter-spacing: 2px; margin-bottom: 2rem; }
  .landing-badge { font-size: 0.75rem; padding: 6px 16px; }
  .score-circle { width: 140px; height: 140px; }
  .score-circle svg { width: 140px; height: 140px; }
  .score-value .number { font-size: 2.25rem; }
  .score-details { width: 100%; max-width: 280px; margin: 0 auto; }
  .landing-score { flex-direction: column; gap: 1.5rem; }
  .enter-btn { width: 100%; max-width: 320px; padding: 14px 24px; }
  .village-heatmap-desktop { display: none; }
  .village-card-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .village-card { padding: 0.8rem 0.9rem; gap: 0.65rem; }
  .village-card-score { width: 42px; height: 42px; font-size: 0.78rem; }
  .village-card-name { font-size: 0.85rem; }
  .village-card-meta { font-size: 0.6rem; }
  .village-section-header { flex-direction: column; }
  .village-summary { width: 100%; }
  .heatmap-legend { justify-content: flex-start; gap: 0.6rem; margin-top: 1rem; }
  .grid-4:has(.stat-card) { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .stat-card { flex-direction: column; text-align: center; padding: 0.75rem; gap: 0.4rem; }
  .stat-card .stat-icon { width: 36px; height: 36px; font-size: 1.1rem; }
  .stat-card .stat-value { font-size: 0.9rem; }
  .stat-card .stat-label { font-size: 0.6rem; }
  .village-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .command-grid { min-height: auto; }
  .command-main { grid-template-columns: 1fr; }
  .command-panel.full { grid-column: span 1; }
  .cctv-placeholder { min-height: 160px; }
  .ai-actions { flex-direction: column; }
  .ai-input-container { flex-direction: column; }
  .ai-send-btn { padding: 0.85rem; width: 100%; min-height: 48px; }
  .ai-action-btn { width: 100%; min-height: 44px; }
  .login-card { width: min(400px, 92vw); padding: 1.75rem; }
  .notification-panel {
    width: calc(100vw - 1.5rem); right: 0.75rem; left: 0.75rem;
    top: calc(var(--topbar-height) + 0.5rem); max-height: 70dvh; overflow-y: auto;
  }
  .toast-container {
    left: 0.75rem; right: 0.75rem; bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .toast { width: 100%; }
  .project-card .project-stats { grid-template-columns: repeat(2, 1fr); }
  .project-card .project-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .sidebar-header { padding: 1rem; }
  .sidebar-logo-text h3 { font-size: 1rem; }
  .nav-item { min-height: 44px; padding: 0.65rem 0.85rem; }
  .sidebar-user-menu:hover .user-dropdown { display: none; }
  .sidebar-user-menu .user-dropdown.active { display: block; }
}

@media (max-width: 480px) {
  html { font-size: 12px; }
  .metric-card .metric-value { font-size: 0.88rem; }
  .metric-card .metric-icon { width: 34px; height: 34px; font-size: 0.9rem; }
  .grid-4:has(.metric-card),
  .grid-5:has(.metric-card) { gap: 0.5rem; }
  .landing-title { font-size: 2.2rem; }
  .landing-subtitle { font-size: 1rem; }
  .landing-tagline { letter-spacing: 1px; font-size: 0.62rem; }
  .scoreboard-value { font-size: 2.75rem; }
  .village-card-score { width: 38px; height: 38px; font-size: 0.72rem; }
  .village-card-badge { font-size: 0.5rem !important; padding: 2px 5px !important; }
  .village-grid { grid-template-columns: repeat(2, 1fr); }
  .datetime-date { display: none; }
  .topbar-btn[title="Import Data"] { display: none; }
  .page-header-brand { flex-direction: column; text-align: center; }
  .alert-card h2 { font-size: 1.2rem; }
  .emergency-grid { grid-template-columns: 1fr; }
  .program-stats { grid-template-columns: 1fr; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar, .topbar, .ai-assistant-btn, .btn { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; background: white; }
}
