:root { 
  --bg-color: #F8FAFC; 
  --primary: #2563EB; 
  --secondary: #475569; 
  --danger: #EF4444; 
  --sidebar-width: 260px; 
}

body { 
  background: var(--bg-color); 
  color: #0F172A; 
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
  overflow-x: hidden; 
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

input, select, textarea { 
  font-size: 16px !important; 
}

#splash-screen { 
  position: fixed; 
  inset: 0; 
  background: var(--bg-color); 
  z-index: 99999; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center; 
  transition: opacity 0.4s ease, visibility 0.4s; 
}

.splash-logo { 
  width: 100px; 
  height: 100px; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  animation: pulse 1.5s infinite; 
  margin-bottom: 1rem; 
}

.splash-logo img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
}

@keyframes pulse { 
  0% { transform: scale(0.95); } 
  70% { transform: scale(1.05); } 
  100% { transform: scale(0.95); } 
}

#global-loader { 
  position: fixed; 
  inset: 0; 
  background: rgba(255,255,255,0.85); 
  backdrop-filter: blur(4px); 
  z-index: 9999; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center; 
}

.sidebar { 
  width: var(--sidebar-width); 
  background: white; 
  border-right: 1px solid #E2E8F0; 
  position: fixed; 
  top: 0; 
  bottom: 0; 
  left: 0; 
  z-index: 1040; 
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  display: flex; 
  flex-direction: column;
}

.sidebar-menu-container { 
  flex-grow: 1; 
  overflow-y: auto; 
  padding-bottom: 2rem; 
}

.main-wrapper { 
  margin-left: var(--sidebar-width); 
  min-height: 100vh; 
  display: flex; 
  flex-direction: column; 
  transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.top-navbar { 
  background: rgba(255,255,255,0.95); 
  backdrop-filter: blur(8px); 
  height: 65px; 
  border-bottom: 1px solid #E2E8F0; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 0 1.5rem; 
  position: sticky; 
  top: 0; 
  z-index: 1030; 
}

.nav-item-menu { 
  padding: 12px 20px; 
  margin: 4px 12px; 
  border-radius: 10px; 
  display: flex; 
  align-items: center; 
  color: var(--secondary); 
  text-decoration: none; 
  font-weight: 600; 
  transition: all 0.2s; 
  cursor: pointer; 
}

.nav-item-menu:hover, .nav-item-menu.active { 
  background: #EFF6FF; 
  color: var(--primary); 
}

.nav-item-menu i { 
  width: 28px; 
  font-size: 1.1rem; 
  margin-right: 0.5rem; 
}

.card-box { 
  background: white; 
  border-radius: 16px; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.02); 
  border: 1px solid #E2E8F0; 
  padding: 1.5rem; 
  margin-bottom: 1.5rem; 
}

.stat-box { 
  display: flex; 
  align-items: center; 
  padding: 1.2rem; 
  border-radius: 16px; 
  background: white; 
  border: 1px solid #E2E8F0; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

.stat-icon { 
  width: 52px; 
  height: 52px; 
  border-radius: 14px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 1.6rem; 
  margin-right: 1.2rem; 
  color: white; 
}

.d-none { display: none !important; }

.bg-hadir { background-color: #10B981 !important; color: white !important; border-color: #10B981 !important; }
.bg-sakit-izin { background-color: #F59E0B !important; color: white !important; border-color: #F59E0B !important;}
.bg-alpa { background-color: #EF4444 !important; color: white !important; border-color: #EF4444 !important;}

.sel-status { 
  -webkit-appearance: none !important; 
  -moz-appearance: none !important; 
  appearance: none !important; 
  background-image: none !important; 
  padding: 0 !important; 
  font-size: 1.05rem !important; 
  font-weight: 700 !important; 
  text-align: center !important; 
  text-align-last: center !important; 
  border-radius: 8px !important; 
  width: 38px !important; 
  height: 38px !important; 
  margin: 0 auto; 
  cursor: pointer; 
}

.sel-status::-ms-expand { display: none; } 

.chart-container { 
  position: relative; 
  height: 250px; 
  width: 100%; 
  cursor: pointer; 
  transition: transform 0.2s;
}

.chart-container:hover { transform: scale(1.02); }

.hover-card { 
  transition: transform 0.2s, box-shadow: 0.2s; 
  cursor: pointer; 
  border-radius: 16px; 
}

.hover-card:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 16px rgba(0,0,0,0.06); 
  border-color: #CBD5E1; 
}

.table-responsive { 
  border-radius: 12px; 
  border: 1px solid #E2E8F0; 
  background: white; 
  -webkit-overflow-scrolling: touch; 
}

.table { margin-bottom: 0; font-size: 0.95rem; }
.table th { background-color: #F8FAFC; font-weight: 600; color: #475569; }

.input-date-clean::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }

.input-group-text { 
  border-right: none; 
  background-color: #F8FAFC; 
  border-radius: 14px 0 0 14px; 
  border-color: #E2E8F0; 
}

.form-control, .form-select { 
  border-radius: 14px; 
  border-color: #E2E8F0; 
  padding: 10px 15px; 
  min-height: 44px; 
  line-height: 1.4; 
}

.form-select { 
  padding-right: 40px !important; 
  background-position: right 15px center !important; 
}

.input-group > .form-control { 
  border-left: none; 
  border-radius: 0 14px 14px 0; 
}

.form-control:focus, .form-select:focus { 
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1); 
  border-color: var(--primary); 
}

.btn { 
  border-radius: 12px; 
  padding: 10px 16px; 
  font-weight: 600; 
}

.btn-login { 
  padding: 14px; 
  font-size: 1.1rem; 
  letter-spacing: 0.5px; 
  transition: all 0.3s; 
  border-radius: 14px; 
}

.btn-login:active { transform: scale(0.98); }

#crud-filter-hari { 
  min-height: 44px; 
  height: auto !important; 
  padding: 10px 30px 10px 15px !important; 
  line-height: 1.2; 
  text-align: left !important; 
}

/* =========================================
   MEDIA QUERY UNTUK HP (RESPONSIVE)
   ========================================= */
@media (max-width: 768px) { 
  .top-navbar { height: 60px; padding: 0 1rem; }
  .page-padding { padding: 1rem; }
  .card-box { padding: 1.2rem; margin-bottom: 1.2rem; border-radius: 14px; }
  .stat-box { padding: 1rem; }
  .stat-icon { width: 44px; height: 44px; font-size: 1.3rem; margin-right: 1rem; }
  h5 { font-size: 1.15rem; }
  .table td, .table th { padding: 0.75rem 0.5rem; }
  
  /* Sembunyikan sidebar bawaan di HP agar tidak bertabrakan dengan menu bawah */
  .sidebar { display: none !important; }
  
  /* Hilangkan margin kiri konten karena sidebar disembunyikan */
  .main-wrapper { margin-left: 0; }

  /* --- PERBAIKAN MENU BAWAH --- */
  #bottom-menu {
      display: flex !important;
      flex-direction: row !important; /* Memaksa berjajar ke samping (Kiri - Kanan) */
      justify-content: space-around !important;
      align-items: center !important;
      padding-bottom: env(safe-area-inset-bottom); 
      box-shadow: 0 -4px 15px rgba(0,0,0,0.05) !important;
      width: 100%;
  }
  
  #bottom-menu .nav-item-menu {
      display: flex !important;
      flex-direction: column !important; /* Memaksa Icon di atas, Teks di bawah */
      align-items: center !important;
      justify-content: center !important;
      margin: 0 !important;
      padding: 8px 0 !important;
      flex: 1; /* Membagi ruang menu sama besar */
      border-radius: 0;
      background: transparent !important;
  }
  
  #bottom-menu .nav-item-menu i {
      margin-right: 0 !important; 
      margin-bottom: 4px !important;
      font-size: 1.2rem !important;
  }

  #bottom-menu .nav-item-menu span {
      font-size: 0.65rem !important;
      font-weight: 700 !important;
  }
  
  /* Animasi Icon Menu Bawah */
  .bottom-nav-item i { transition: transform 0.2s ease, color 0.2s ease; }
  .bottom-nav-item.text-primary i { transform: translateY(-2px) scale(1.15); filter: drop-shadow(0 4px 4px rgba(37,99,235,0.2)); }
  .bottom-nav-item:active i { transform: scale(0.95); }
}