/* ===================================================
   भारत पेयजल - मास्टर एडमिन ऐप स्टाइलशीट
   File: style.css
   =================================================== */

/* 1. Global Resets & Native Mobile App Feel */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #f1f5f9;
  font-family: 'Poppins', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

input, select, textarea, button {
  font-family: inherit;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

button:active {
  opacity: 0.88;
}

/* 2. Top Master Header */
header#masterHeader {
  box-shadow: 0 2px 10px rgba(0, 34, 68, 0.22);
}

/* 3. Tab Views Fade-In Animation */
.tab-view {
  animation: tabFadeIn 0.22s ease-out forwards;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 4. Bottom Navigation Bar (4 Tabs) */
#bottomNav {
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
  border: none;
  background: transparent;
  outline: none;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-tab.active {
  color: #002855 !important;
}

.nav-tab.active i {
  color: #0284c7;
  transform: translateY(-2px) scale(1.12);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab.active span {
  color: #002855;
  font-weight: 800;
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  top: 0px;
  width: 28px;
  height: 3px;
  background-color: #0284c7;
  border-radius: 0 0 4px 4px;
}

/* 5. Sidebar Drawer & Backdrop */
#masterSidebar.active {
  transform: translateX(0) !important;
}

#sidebarBackdrop.active {
  display: block !important;
}

/* 6. Toast Notification Animation */
#toastBox.show {
  display: flex !important;
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideDown {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* 7. Modal Pop-In Animations */
#adminLoginModal > div,
#staffDetailModal > div,
#addLogModal > div,
#editSalaryModal > div,
#bookingFormModal > div,
#staffFormModal > div,
#changePinModal > div {
  animation: modalPop 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 8. Refresh Spin Animation */
@keyframes masterSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-fast {
  animation: masterSpin 0.8s linear infinite;
}

/* 9. Increment Progress Bar Fill */
.inc-progress-fill {
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 10. Custom Slim Scrollbars */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===================================================
   11. OFFICIAL 2-COLUMN SALARY SLIP & PRINT PDF STYLES
   =================================================== */
.payslip-sheet {
  box-shadow: 0 22px 45px -12px rgba(0, 35, 80, 0.38);
  background-color: #ffffff;
}

.payslip-capturing {
  box-shadow: none !important;
  border-radius: 16px !important;
  transform: none !important;
}

.payslip-capturing > div:nth-child(2) {
  padding: 24px !important;
}

.payslip-capturing .payslip-col-heading {
  font-size: 11px !important;
}

.payslip-capturing .payslip-col-text {
  font-size: 11.5px !important;
}

.payslip-capturing .payslip-col-text span {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.payslip-capturing .payslip-net-val {
  font-size: 24px !important;
}

.payslip-capturing *,
.payslip-capturing *::before,
.payslip-capturing *::after {
  animation: none !important;
  transition: none !important;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body.printing-payslip {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-payslip > *:not(#staffDetailModal) {
    display: none !important;
  }

  body.printing-payslip #staffDetailModal {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.printing-payslip #staffDetailModal > div {
    max-width: 650px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    animation: none !important;
    transform: none !important;
  }

  body.printing-payslip #staffDetailModal > div > *:not(#sdPayslipWrap) {
    display: none !important;
  }

  body.printing-payslip #sdPayslipWrap {
    display: block !important;
  }

  body.printing-payslip #sdPayslipWrap > *:not(#salarySlipCapture) {
    display: none !important;
  }

  body.printing-payslip #salarySlipCapture {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 16px !important;
  }

  body.printing-payslip #salarySlipCapture > div:nth-child(2) {
    padding: 24px !important;
  }

  body.printing-payslip .payslip-col-heading {
    font-size: 11.5px !important;
  }

  body.printing-payslip .payslip-col-text {
    font-size: 12px !important;
  }

  body.printing-payslip .payslip-col-text span {
    overflow: visible !important;
    text-overflow: clip !important;
  }

  body.printing-payslip .payslip-net-val {
    font-size: 26px !important;
  }
}

/* ===================================================
   12. MASTER PROFESSIONAL SPLASH SCREEN
   =================================================== */
.master-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(180deg, #eff8ff 0%, #ffffff 48%, #edf7ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.master-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.master-splash-img {
  width: 100%;
  height: 100%;
  max-width: 520px;
  object-fit: contain;
  animation: masterSplashZoom 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes masterSplashZoom {
  0% {
    opacity: 0.4;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.master-splash-loader {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  pointer-events: none;
}

.master-splash-track {
  width: 100%;
  height: 5px;
  background: rgba(0, 51, 102, 0.14);
  border-radius: 9999px;
  overflow: hidden;
}

.master-splash-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #003366 0%, #0284c7 60%, #ff9933 100%);
  border-radius: 9999px;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}