/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { 
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #1a202c;
  line-height: 1.6;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

/* Mobile App Layout */
.app-shell { 
  min-height: 100vh; 
  display: flex; 
  flex-direction: column; 
  position: relative;
}

/* Mobile Header - Enhanced Design */
.mobile-header {
  background: linear-gradient(135deg, rgba(102,126,234,0.85) 0%, rgba(118,75,162,0.85) 100%), url('/img/header') center/cover no-repeat;
  backdrop-filter: blur(20px);
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 
    0 4px 30px rgba(102,126,234,0.3),
    0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}

.mobile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="1"/></g></svg>') repeat;
  pointer-events: none;
}

.header-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.app-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  margin-top: 0.5rem;
  font-weight: 500;
  text-shadow: 0 1px 5px rgba(0,0,0,0.2);
  line-height: 1.3;
}

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.5rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Mobile Content */
.mobile-content {
  flex: 1;
  padding: 1rem;
  padding-bottom: 130px; /* Extra space for bottom nav + safe area */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Safe area spacer utility */
.safe-bottom-space { height: 120px; width:100%; flex-shrink:0; }

/* Bottom Navigation - Modern Design */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(30px);
  border-top: 1px solid rgba(102,126,234,0.1);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 1rem 0.5rem;
  z-index: 1000;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
  border-radius: 25px 25px 0 0;
  height: 85px;
}

/* Regular Nav Items */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #9ca3af;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0.75rem 0.5rem 0.5rem;
  border-radius: 20px;
  min-width: 65px;
  position: relative;
}

.nav-item:hover {
  color: #667eea;
  transform: translateY(-3px);
}

.nav-item.active {
  color: #667eea;
  transform: translateY(-5px);
}

.nav-icon {
  margin-bottom: 0.4rem;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Center Floating Button - Gallery (Half Floating) */
.nav-item.center-item {
  position: relative;
  top: -15px; /* Reduced from -25px to only show half floating */
  padding: 0;
  margin: 0 0.5rem;
}

.nav-item.center-item .nav-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  width: 60px; /* Slightly smaller */
  height: 60px; /* Slightly smaller */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 0.5rem;
  box-shadow: 
    0 6px 20px rgba(102,126,234,0.4),
    0 3px 10px rgba(102,126,234,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.9); /* Thinner border */
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item.center-item .nav-icon svg {
  width: 26px; /* Slightly smaller icon */
  height: 26px;
  color: white;
}

.nav-item.center-item:hover .nav-icon {
  transform: scale(1.08) translateY(-2px); /* Less aggressive scaling */
  box-shadow: 
    0 10px 30px rgba(102,126,234,0.5),
    0 5px 12px rgba(102,126,234,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.nav-item.center-item.active .nav-icon {
  transform: scale(1.12) translateY(-3px); /* Less aggressive scaling */
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 
    0 12px 35px rgba(102,126,234,0.6),
    0 6px 15px rgba(102,126,234,0.5),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

.nav-item.center-item .nav-label {
  color: #667eea;
  font-weight: 700;
  font-size: 0.7rem;
  margin-top: 0.2rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Add subtle animations */
.nav-item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
}

.nav-item.active::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Center item doesn't need the dot indicator */
.nav-item.center-item::before {
  display: none;
}

/* Ripple effect on tap */
.nav-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(102,126,234,0.2) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.6s ease;
}

.nav-item:active::after {
  width: 120px;
  height: 120px;
  opacity: 1;
  transition: all 0.1s ease;
}

/* Special glow effect for active state */
.nav-item.active {
  background: radial-gradient(circle at center, rgba(102,126,234,0.08) 0%, transparent 70%);
}

/* Enhanced hover effects */
.nav-item:hover .nav-icon svg {
  transform: scale(1.1);
}

.nav-item.active .nav-icon svg {
  transform: scale(1.15);
}

/* Login Page Styles */
.login-container {
  min-height: calc(100vh - 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
}

.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 
    0 20px 60px rgba(102,126,234,0.15),
    0 8px 25px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  box-shadow: 0 8px 25px rgba(102,126,234,0.3);
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: #718096;
  font-size: 0.9rem;
}

.alert {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-form {
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group svg {
  position: absolute;
  left: 1rem;
  color: #9ca3af;
  z-index: 1;
}

.input-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.8);
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
  background: white;
}

.input-group input::placeholder {
  color: #9ca3af;
}

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.login-btn:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
}

.back-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.back-link:hover {
  color: #764ba2;
  transform: translateX(-2px);
}

/* Admin Dashboard Styles */
.admin-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(102,126,234,0.3);
}

.admin-welcome {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-avatar {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.admin-info h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.admin-info p {
  opacity: 0.9;
  font-size: 0.9rem;
}

.logout-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.3);
}

.logout-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Admin Statistics */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card.admin-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.admin-secondary {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.stat-card.admin-info {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.stat-card.admin-success {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.stat-card.admin-warning {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 16px;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card.large {
  padding: 2rem;
  flex-direction: column;
  text-align: center;
  gap: 1.5rem;
}

.stat-icon {
  font-size: 2rem;
  opacity: 0.9;
}

.stat-content h3 {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-content .number {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stat-content .subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* RT Statistics for RW Admin */
.rt-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.rt-admin-card {
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.rt-admin-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.1);
}

.rt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.rt-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2d3748;
}

.rt-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.rt-details {
  display: flex;
  gap: 1rem;
}

.rt-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rt-detail .label {
  font-size: 0.8rem;
  color: #718096;
  font-weight: 500;
}

.rt-detail .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2d3748;
}

/* RT Main Stats */
.rt-main-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Quick Actions */
.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.admin-action-card {
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-action-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102,126,234,0.15);
}

.admin-action-card .action-icon {
  font-size: 2.5rem;
  opacity: 0.8;
}

.admin-action-card .action-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.admin-action-card .action-content p {
  font-size: 0.85rem;
  color: #718096;
}

/* Activities */
.admin-activities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.activity-section {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.activity-section h3 {
  color: #2d3748;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  padding: 1rem;
  background: rgba(102,126,234,0.05);
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.activity-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.activity-item p {
  font-size: 0.8rem;
  color: #718096;
}

.no-data {
  text-align: center;
  color: #718096;
  font-style: italic;
  padding: 2rem;
}

/* Households Grid */
.households-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.household-card {
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.household-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.1);
}

.household-header {
  margin-bottom: 1rem;
}

.household-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.kk-badge {
  background: #f7fafc;
  color: #2d3748;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}

.household-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-item .label {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 500;
}

.detail-item .value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3748;
}

/* Stats Dashboard */
.stats-overview {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.stats-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1.5rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  box-shadow: 0 8px 25px rgba(102,126,234,0.3);
  transition: transform 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
}
.stat-card.total {
  grid-column: span 2;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}
.stat-card h3 { 
  color: rgba(255,255,255,0.9); 
  font-size: 0.8rem; 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
  margin-bottom: 0.5rem;
}
.stat-card .number { 
  font-size: 2rem; 
  font-weight: 700; 
  margin: 0.5rem 0; 
}
.stat-card .subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* RT Stats */
.rt-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}
.rt-card {
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}
.rt-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
}
.rt-card .rt-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 0.5rem;
}
.rt-card .rt-main-stats {
  margin-bottom: 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rt-card .warga-count {
  margin-bottom: 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rt-card .kk-count {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rt-card .warga-count .stat-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
}
.rt-card .kk-count .stat-number {
  font-size: 0.85rem;
  color: #718096;
  font-weight: 600;
}
.rt-card .stat-label {
  font-size: 0.7rem;
  color: #a0aec0;
  font-weight: 500;
  display: block;
  margin-top: 0.125rem;
  text-align: center;
}
.rt-card .rt-additional-stats {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}
.rt-card .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.rt-card .stat-icon {
  font-size: 1rem;
  opacity: 0.8;
}
.rt-card .stat-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
}
.rt-card .stat-text {
  font-size: 0.65rem;
  color: #718096;
  font-weight: 500;
}

/* Cards & Sections */
.card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.card h2, .card h3 {
  color: #2d3748;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card h2 {
  font-size: 1.4rem;
  text-align: center;
  border-bottom: 2px solid #667eea;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.action-card {
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}
.action-card:hover {
  transform: translateY(-3px);
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102,126,234,0.2);
}
.action-card .action-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.action-card .action-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
}
.action-card .action-desc {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 0.25rem;
}

/* Gallery Grid */
.gallery { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 
  gap: 0.75rem; 
}
.gallery figure { 
  margin: 0; 
  border-radius: 12px; 
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}
.gallery figure:hover { transform: scale(1.05); }
.gallery img { 
  width: 100%; 
  height: 100px; 
  object-fit: cover; 
  display: block;
}
.gallery figcaption { 
  padding: 0.5rem; 
  font-size: 0.7rem; 
  background: rgba(255,255,255,0.95);
  color: #4a5568;
  text-align: center;
}

/* Forms */
form {
  background: rgba(255,255,255,0.95);
  padding: 1.5rem;
  border-radius: 16px;
  margin: 1rem 0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
input, textarea, select, button {
  width: 100%;
  padding: 0.875rem;
  margin: 0.5rem 0;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

/* Lists */
ul {
  list-style: none;
}
li {
  background: rgba(255,255,255,0.9);
  margin: 0.75rem 0;
  padding: 1rem;
  border-radius: 12px;
  border-left: 4px solid #667eea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}
li:hover { transform: translateX(4px); }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  font-size: 0.85rem;
}
th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
}
td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}
tr:hover { background: rgba(102,126,234,0.05); }

/* Mobile Optimizations */
@media (max-width: 480px) {
  .mobile-content { padding: 0.75rem; }
  .stats-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .stat-card.total { grid-column: span 1; }
  .rt-stats { 
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
  }
  .rt-card { 
    padding: 0.75rem 0.5rem;
    min-width: 100px;
  }
  .rt-card .rt-number { font-size: 1rem; text-align: center; }
  .rt-card .warga-count { 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .rt-card .kk-count { 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .rt-card .warga-count .stat-number { font-size: 1rem; }
  .rt-card .kk-count .stat-number { font-size: 0.75rem; }
  .rt-card .rt-additional-stats { 
    gap: 0.25rem; 
    flex-direction: column;
    align-items: stretch;
  }
  .rt-card .stat-item { 
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }
  .rt-card .stat-icon { font-size: 0.9rem; }
  .rt-card .stat-number { font-size: 0.8rem; }
  .rt-card .stat-text { font-size: 0.65rem; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery img { height: 80px; }
  .quick-actions { grid-template-columns: 1fr; }
  
  table { font-size: 0.75rem; }
  th, td { padding: 0.5rem 0.25rem; }
  
  .card { padding: 1rem; }
  .card h2 { font-size: 1.2rem; }
  
  /* Enhanced bottom nav for small screens */
  .bottom-nav {
    padding: 0.75rem 0.25rem;
    height: 80px;
  }
  
  .nav-item {
    min-width: 55px;
    padding: 0.5rem 0.25rem 0.5rem;
  }
  
  .nav-item.center-item {
    top: -12px; /* Even less floating on mobile */
  }
  
  .nav-item.center-item .nav-icon {
    width: 55px; /* Smaller on mobile */
    height: 55px;
    border: 2px solid rgba(255,255,255,0.9);
  }
  
  .nav-item.center-item .nav-icon svg {
    width: 24px; /* Smaller icon on mobile */
    height: 24px;
  }
  
  .nav-label {
    font-size: 0.6rem;
  }
}

/* Extra small screens - Optimize RT cards for very narrow displays */
@media (max-width: 320px) {
  .rt-stats { 
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .rt-card { 
    padding: 0.5rem 0.25rem;
    min-width: auto;
  }
  .rt-card .rt-number { font-size: 0.9rem; text-align: center; }
  .rt-card .warga-count { 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .rt-card .kk-count { 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .rt-card .warga-count .stat-number { font-size: 0.9rem; }
  .rt-card .kk-count .stat-number { font-size: 0.7rem; }
  .rt-card .rt-additional-stats { 
    gap: 0.125rem;
  }
  .rt-card .stat-item { 
    gap: 0.25rem;
  }
  .rt-card .stat-icon { font-size: 0.8rem; }
  .rt-card .stat-number { font-size: 0.7rem; }
  .rt-card .stat-text { font-size: 0.6rem; }
}

/* Loading animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
  40%, 43% { transform: translate3d(0,-8px,0); }
  70% { transform: translate3d(0,-4px,0); }
  90% { transform: translate3d(0,-2px,0); }
}

.nav-item.center-item.active .nav-icon {
  animation: bounce 0.6s ease-in-out;
}

/* Smooth transitions for better UX */
* {
  -webkit-tap-highlight-color: transparent;
}

.nav-item {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
