@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar Styling */
.header-brand {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.brand-icon-wrapper-sm {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.subnav-bar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.nav-pills-custom .nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 12px;
  padding: 10px 22px;
  transition: all 0.2s ease;
}

.nav-pills-custom .nav-link.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.nav-pills-custom .nav-link:hover:not(.active) {
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--primary-color);
}

/* Card & Content Styling */
.card-custom {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

.table thead th {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid var(--border-color);
}

/* Desktop Lock Overlay (< 992px) */
.desktop-lock-overlay {
  display: none !important;
}

@media (max-width: 991.98px) {
  .desktop-lock-overlay {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 9999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    text-align: center !important;
    color: #0f172a !important;
  }
  .desktop-lock-overlay .lock-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 40px 30px !important;
    max-width: 420px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
  }
  .desktop-lock-overlay .lock-icon {
    font-size: 3rem !important;
    color: #4f46e5 !important;
    margin-bottom: 16px !important;
  }
}

/* Progress Overlay for Email Dispatch */
.progress-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}
.progress-backdrop.active {
  display: flex;
}
.progress-box {
  max-width: 400px;
  width: 90%;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

/* Login Page Light Theme Styling */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(79, 70, 229, 0.15);
  color: #0f172a;
}

.brand-icon-wrapper {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 32px;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

.letter-spacing-lg {
  letter-spacing: 8px;
  font-size: 20px;
}

/* Native Pixel-Matched Sticky Freeze for Checkbox (col 1) & Action (col 2) */
.dataTables_scrollHead th:nth-child(1),
.dataTables_scrollBody td:nth-child(1),
.dataTables_scrollBody th:nth-child(1),
#leaveTable th:nth-child(1),
#leaveTable td:nth-child(1),
#sendEmailTable th:nth-child(1),
#sendEmailTable td:nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  z-index: 2 !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  background-color: var(--card-bg) !important;
  border-right: 1px solid var(--border-color) !important;
  text-align: center !important;
}

.dataTables_scrollHead th:nth-child(2),
.dataTables_scrollBody td:nth-child(2),
.dataTables_scrollBody th:nth-child(2),
#leaveTable th:nth-child(2),
#leaveTable td:nth-child(2),
#sendEmailTable th:nth-child(2),
#sendEmailTable td:nth-child(2) {
  position: sticky !important;
  left: 40px !important;
  z-index: 2 !important;
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
  background-color: var(--card-bg) !important;
  border-right: 2px solid var(--border-color) !important;
  text-align: center !important;
}

.dataTables_scrollHead th:nth-child(1),
.dataTables_scrollHead th:nth-child(2) {
  z-index: 5 !important;
  background-color: #f8fafc !important;
}
