:root {
  --primary-color: #1e3a8a;
  --primary-dark: #172554;
  --secondary-color: #0284c7;
  --accent-color: #f59e0b;
  --bg-light: #f8fafc;
  --sidebar-width: 260px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-light);
  color: #1e293b;
  min-height: 100vh;
}

/* Sidebar & Main Layout styling */
.sidebar-wrapper {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-height: calc(100vh - 60px);
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.main-content {
  flex: 1 1 0%;
  min-width: 0;
}

@media (min-width: 768px) and (max-width: 991.98px) {
  :root {
    --sidebar-width: 225px;
  }
}

.sidebar-heading {
  font-size: 0.75rem;
  letter-spacing: 0.05rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0.75rem 1rem 0.25rem;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  color: #475569;
  text-decoration: none;
  border-radius: 0.5rem;
  margin: 0.15rem 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link i {
  font-size: 1.15rem;
  margin-right: 0.75rem;
}

.sidebar-link:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.sidebar-link.active {
  background-color: #e0e7ff;
  color: var(--primary-color);
  font-weight: 600;
}

/* Card Styling */
.card-stat {
  border: none;
  border-radius: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
}

.card-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Print styling for A4 Official Reports */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .no-print, header, nav, footer, .sidebar-wrapper, .btn {
    display: none !important;
  }
  .container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  .kop-surat {
    border-bottom: 3px double #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-align: center;
  }
  .page-break {
    page-break-after: always;
  }
}

/* Select2 Bootstrap 5 Enhancements */
.select2-container {
  width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
  border-radius: 0.375rem;
  border-color: #dee2e6;
  min-height: calc(2.25rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 0.95rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-left: 0;
  color: #212529;
  line-height: 1.5;
}

.select2-container--bootstrap-5 .select2-dropdown {
  border-color: #86b7fe;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  z-index: 1065 !important;
}

.select2-container--bootstrap-5 .select2-search__field {
  border-radius: 0.375rem;
  border-color: #cbd5e1;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
}

.select2-container--bootstrap-5 .select2-search__field:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  outline: 0;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary-color, #1e3a8a);
  color: #fff;
}

.select2-container--bootstrap-5 .select2-results__option {
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
}

/* ==========================================
   MOBILE-FIRST NATIVE APP STYLING (PWA)
   ========================================== */
@media (max-width: 767.98px) {
  body {
    padding-bottom: 78px; /* Ruang untuk Bottom Navigation Bar */
  }

  .main-content {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 1rem !important;
  }
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1040;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 0;
  transition: all 0.2s ease;
}

.mobile-bottom-nav-item i {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item:focus {
  color: var(--primary-color, #1e3a8a);
}

.mobile-bottom-nav-item.active {
  color: var(--primary-color, #1e3a8a);
  font-weight: 700;
}

.mobile-bottom-nav-item.active i {
  transform: translateY(-2px);
  color: var(--secondary-color, #0284c7);
}

/* Tombol Absen Utama Berdenyut (Pulse Button) */
.btn-pulse-attendance {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #1e3a8a 100%);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.btn-pulse-attendance:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 28px rgba(2, 132, 199, 0.5);
  color: #ffffff;
}

.btn-pulse-attendance:active {
  transform: scale(0.96);
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.4);
}

.btn-pulse-attendance::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid rgba(2, 132, 199, 0.5);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* PWA App Install Banner */
.pwa-install-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  color: white;
  border-radius: 1rem;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
}

/* Glassmorphism Badge & Pill */
.badge-glass {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}


