/* Argus Technologies Custom Theme */
:root {
  --argus-yellow: #ffd166;
  --argus-yellow-hover: #fcc438;
  --argus-sidebar-bg: #3d6078;
  --argus-sidebar-active: #ffd166;
  --argus-sidebar-text: #ffffff;
  --argus-main-bg: #f4f6f9;
  --argus-card-total: #2c3e50;
  --argus-card-present: #198754;
  --argus-card-absent: #dc3545;
  --argus-card-pct: #0d6efd;
  --argus-card-timeout: #ffc107;
  --argus-btn-back: #ef4444;
  --argus-dark-btn: #314b5e;
  --argus-border: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--argus-main-bg);
  color: #333333;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Sidebar never scrolls with the page */
}

body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

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

/* ---------------- Top Navbar ---------------- */
.top-navbar {
  height: 52px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 100;
  border-bottom: 1px solid #e2e8f0;
  margin-left: 220px;
  transition: margin-left 0.25s ease;
}

.nav-left {
  display: flex;
  align-items: center;
}

.hamburger-btn {
  background-color: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hamburger-btn:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background-color: #334155;
  border-radius: 1px;
}

.nav-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 101;
  max-width: 50vw;
}

.nav-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  line-height: 1.2;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  height: 100%;
}

/* ---------------- Layout Wrapper ---------------- */
.app-container {
  display: flex;
  flex: 1;
  position: relative;
  height: calc(100vh - 52px - 36px);
  overflow: hidden;
  margin-left: 220px;
  transition: margin-left 0.25s ease;
  background-color: #f1f5f9;
}

/* ---------------- Left Sidebar ---------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  max-height: 100vh;
  background-color: #102a45;
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.top-navbar,
.app-container {
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-footer {
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= DESKTOP MINI (COLLAPSED) SIDEBAR ================= */
@media (min-width: 993px) {
  body.sidebar-mini .sidebar {
    width: 68px !important;
    padding: 14px 6px !important;
    transform: none !important;
    overflow: visible;
  }

  body.sidebar-mini .top-navbar,
  body.sidebar-mini .app-container {
    margin-left: 68px !important;
  }

  body.sidebar-mini .app-footer {
    left: 68px !important;
  }

  /* Header adjustments in mini mode */
  body.sidebar-mini .sidebar-header {
    padding: 0;
    margin-bottom: 14px;
    display: flex;
    justify-content: center;
  }

  body.sidebar-mini .sidebar-brand-box {
    justify-content: center;
    margin-bottom: 0;
  }

  body.sidebar-mini .sidebar-logo-circle {
    width: 40px;
    height: 40px;
    padding: 3px;
  }

  body.sidebar-mini .sidebar-brand-text,
  body.sidebar-mini .admin-subtitle {
    display: none !important;
  }

  /* Nav items adjustments in mini mode */
  body.sidebar-mini .sidebar-nav {
    overflow-x: hidden;
    padding: 0 2px;
    gap: 6px;
    align-items: center;
  }

  body.sidebar-mini .nav-item-btn {
    width: 46px;
    height: 42px;
    padding: 0 !important;
    margin: 0 auto;
    justify-content: center !important;
    align-items: center;
    position: relative;
    border-radius: 8px;
    gap: 0 !important;
  }

  body.sidebar-mini .nav-item-btn .nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.9;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease;
  }

  body.sidebar-mini .nav-item-btn:hover .nav-icon {
    transform: scale(1.18);
    opacity: 1;
  }

  body.sidebar-mini .nav-item-btn span {
    display: none !important;
  }

  /* Badge counts in mini mode: neat floating notification dot / compact pill */
  body.sidebar-mini .nav-count-badge {
    position: absolute;
    top: 3px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    font-size: 8.5px;
    padding: 0 3px;
    border-radius: 9999px;
    margin: 0;
    border: 1.5px solid #102a45;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    display: inline-flex !important;
  }

  /* Footer / Logout in mini mode */
  body.sidebar-mini .sidebar-footer {
    padding: 10px 0 max(6px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  body.sidebar-mini .sidebar-fw-card {
    width: 46px;
    height: 42px;
    padding: 0 !important;
    justify-content: center;
    align-items: center;
    margin: 0 auto 6px auto;
    position: relative;
    border-radius: 8px;
  }

  body.sidebar-mini .sidebar-fw-text-group,
  body.sidebar-mini .sidebar-fw-ext-box,
  body.sidebar-mini .sidebar-fw-divider {
    display: none !important;
  }

  body.sidebar-mini .sidebar-fw-icon-box svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  body.sidebar-mini .sidebar-fw-card:hover .sidebar-fw-icon-box svg {
    transform: scale(1.18);
  }

  body.sidebar-mini .sidebar-logout-card {
    width: 46px;
    height: 42px;
    padding: 0 !important;
    justify-content: center;
    margin: 0 auto;
    position: relative;
  }

  body.sidebar-mini .sidebar-logout-card span {
    display: none !important;
  }

  body.sidebar-mini .sidebar-logout-card svg {
    width: 17px;
    height: 17px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  body.sidebar-mini .sidebar-logout-card:hover svg {
    transform: scale(1.18);
  }
}

/* Floating Tooltip for Desktop Mini-Sidebar */
.sidebar-mini-tooltip {
  position: fixed;
  background-color: #0f172a;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-mini-tooltip.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-mini-tooltip::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px 5px 5px 0;
  border-style: solid;
  border-color: transparent #0f172a transparent transparent;
}

.sidebar-header {
  text-align: left;
  padding: 0 4px;
  margin-bottom: 16px;
}

.sidebar-brand-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.sidebar-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

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

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.brand-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.6px;
  line-height: 1.1;
}

.brand-subtitle {
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.admin-subtitle {
  color: #ffd166 !important;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 6px;
  text-align: left;
  padding-left: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  margin-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background-color: transparent;
  color: #e2e8f0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.nav-item-btn .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.88;
  shape-rendering: geometricPrecision;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}

.nav-item-btn:hover .nav-icon {
  opacity: 1;
  transform: scale(1.08);
}

.nav-item-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.nav-item-btn.active .nav-icon {
  opacity: 1;
}

.nav-count-badge {
  background-color: #ef4444;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  line-height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  text-align: center;
  box-sizing: border-box;
  margin-left: auto;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logout-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.sidebar-logout-card svg {
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-logout-card:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #ff8080;
  border-color: #ef4444;
}

.sidebar-logout-card:hover svg {
  transform: translateX(2px);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Redesigned Field Worker Module Card Matching Reference Image */
.sidebar-fw-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: #232c25;
  background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(35, 44, 37, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.sidebar-fw-card:hover {
  background-color: #2b382d;
  background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.24) 0%, rgba(43, 56, 45, 0.95) 100%);
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.20);
}

.sidebar-fw-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f59e0b;
}

.sidebar-fw-text-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.sidebar-fw-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.sidebar-fw-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  opacity: 0.88;
  margin-top: 2px;
  line-height: 1.2;
}

.sidebar-fw-ext-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #f59e0b;
  opacity: 0.9;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-fw-card:hover .sidebar-fw-ext-box {
  opacity: 1;
  transform: translate(1px, -1px);
}

.sidebar-fw-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  margin: 6px 0 8px 0;
  width: 100%;
}

.btn-back {
  display: inline-block;
  background-color: var(--argus-btn-back);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-back:hover {
  background-color: #dc2626;
}

/* ---------------- Main Content ---------------- */
.main-wrapper {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* ONLY the right side scrolls! */
  overflow-x: hidden;
  background-color: var(--argus-main-bg);
}

.main-content {
  flex: 1;
  padding: 20px 24px 85px 24px;
}

/* Top Banner Card & Universal Page Controls (Matching Image 2 Reference UI) */
.content-banner-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #eef2f6;
  margin-bottom: 18px;
  gap: 16px;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.banner-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-text-group {
  display: flex;
  flex-direction: column;
}

.banner-title,
.content-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.banner-subtitle {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-clock {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.btn-primary-action,
.btn-new-entry {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.btn-primary-action:hover,
.btn-new-entry:hover {
  background-color: #1d4ed8;
  color: #ffffff;
}

.banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.btn-secondary-action {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* Universal Actions Column Buttons (Image 2) */
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background-color: transparent;
  text-decoration: none;
}

.btn-action-view {
  background-color: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-action-view:hover {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.btn-action-edit {
  background-color: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.btn-action-edit:hover {
  background-color: #fef3c7;
  color: #b45309;
}

.btn-action-delete {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-action-delete:hover {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Status & Basis Pill Badges (Image 2) */
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap !important;
}

.status-active,
.badge-day {
  background-color: #dcfce7;
  color: #166534;
}

.status-inactive,
.badge-absent {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-pending,
.badge-half,
.badge-timeout {
  background-color: #fef3c7;
  color: #92400e;
}

.status-blue,
.badge-hourly {
  background-color: #e0f2fe;
  color: #0369a1;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11.5px;
  background: #0f172a;
  color: #ffffff;
  flex-shrink: 0;
}

/* ---------------- Dashboard UI ---------------- */
.stats-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 105px;
}

.stat-card-total {
  background-color: var(--argus-card-total);
}

.stat-card-present {
  background-color: var(--argus-card-present);
}

.stat-card-absent {
  background-color: var(--argus-card-absent);
}

.stat-card-pct {
  background-color: var(--argus-card-pct);
}

.stat-card-timeout {
  background-color: var(--argus-card-timeout);
  color: #000000;
}

.stat-card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}

/* Charts Section */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chart-header-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #111111;
  margin-bottom: 12px;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* ---------------- Employee Details Table ---------------- */
.table-card {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-toolbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #333333;
  width: 100%;
  flex-wrap: nowrap !important;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}

.table-toolbar::-webkit-scrollbar {
  display: none;
}

.table-toolbar > * {
  flex-shrink: 0;
}

.entries-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.entries-select {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 12px;
  background-color: #ffffff;
  outline: none;
  flex-shrink: 0;
}

.search-box-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-input {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
  width: 140px;
  min-width: 100px;
  max-width: 170px;
  flex-shrink: 1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.table-responsive {
  overflow-x: auto !important;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin-bottom: 15px;
  background-color: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.employee-table {
  min-width: 880px;
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  empty-cells: show !important;
  font-size: 11px;
  text-align: left;
  table-layout: auto;
  border: 1px solid #e2e8f0;
}

#employeeDataTable { min-width: 960px; }
#attendanceDataTable,
#attendanceStandardTable { min-width: 980px; }
#simpleDataTable,
#attendanceSimpleTable,
.employee-table-simple { min-width: 860px; }
#liveDataTable,
#liveReportTable { min-width: 960px; }
#manualDataTable,
#manualEntryTable { min-width: 900px; }
#paymentDataTable,
#paymentTable { min-width: 900px; }
#advanceDataTable,
#advanceTable { min-width: 900px; }
#balanceDataTable,
#balanceTable { min-width: 900px; }
#salaryReportsTable,
#salaryReportTable { min-width: 950px; }
#companyDataTable { min-width: 1360px; }
.dash-table { min-width: 520px; }
.payslip-info-table,
.payslip-document-wrapper table { min-width: 540px; }

.employee-table thead tr {
  height: 38px;
}

.employee-table thead tr:not(:last-child) th {
  border-bottom: 1px solid #cbd5e1 !important;
}

.employee-table thead tr:last-child th {
  border-bottom: 2px solid #cbd5e1 !important;
}

.employee-table th {
  display: table-cell !important;
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 700;
  padding: 9px 10px;
  border-top: none !important;
  border-left: none !important;
  border-bottom: 2px solid #cbd5e1 !important;
  border-right: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
  word-break: normal !important;
  word-wrap: normal !important;
  vertical-align: middle !important;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  line-height: 1.25;
  box-sizing: border-box !important;
  height: 38px !important;
}

.employee-table th:last-child {
  border-right: none !important;
}

.employee-table th .sort-icon {
  color: #94a3b8;
  margin-left: 3px;
  font-size: 10px;
}

.employee-table td {
  display: table-cell !important;
  padding: 8px 10px;
  border-top: none !important;
  border-left: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  color: #334155;
  vertical-align: middle !important;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  box-sizing: border-box !important;
}

.employee-table td:last-child {
  border-right: none !important;
}

/* Table Filters Row (Image 4 Alignment Fix) */
.table-filters-row th {
  display: table-cell !important;
  background-color: #f1f5f9 !important;
  padding: 4px 6px !important;
  border-top: none !important;
  border-left: none !important;
  border-bottom: 2px solid #cbd5e1 !important;
  border-right: 1px solid #e2e8f0 !important;
  height: 36px !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
}

.table-filters-row th:last-child {
  border-right: none !important;
}

.table-filter-select,
.table-filter-date,
.table-filters-row input {
  width: 100%;
  height: 26px !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  box-sizing: border-box !important;
}

.table-date-stacked {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.table-date-stacked input {
  height: 22px !important;
  font-size: 10px !important;
}

/* Allow location, address, reason, and multi-line cells to wrap nicely across all tables */
.employee-table td.col-location,
.employee-table td.col-address,
.employee-table td.col-wrap,
.employee-table td.col-reason,
.employee-table td.col-notes,
.employee-table td[data-col="entry_location"],
.employee-table td[data-col="exit_location"],
.employee-table td[data-col="site_name"],
.employee-table td[data-col="reason"],
.employee-table td[data-col="designation"],
#liveReportTable td:nth-child(4),
#attendanceStandardTable td:nth-child(4),
#attendanceStandardTable td:nth-child(8),
#portalAttendanceTable td:nth-child(2),
#paymentTable td:nth-child(7) {
  min-width: 220px !important;
  max-width: 320px !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  line-height: 1.4 !important;
  vertical-align: middle !important;
}

/* Specific columns that must stay single-line without clipping */
.employee-table td.col-nowrap,
.employee-table td[data-col="entry_distance"],
.employee-table td[data-col="exit_distance"],
.employee-table td[data-col="entry_status"],
.employee-table td[data-col="exit_status"],
#liveReportTable td:nth-child(5),
#attendanceStandardTable td:nth-child(3),
#attendanceStandardTable td:nth-child(5),
#attendanceStandardTable td:nth-child(7),
#attendanceStandardTable td:nth-child(9) {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.employee-table tr:hover {
  background-color: #f8fafc;
}

/* Manage Companies Custom Table Beautification */
#companyDataTable {
  min-width: 1360px;
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: auto;
  border: 1px solid #e2e8f0;
}

#companyDataTable th,
#companyDataTable td {
  word-break: normal;
  word-wrap: normal;
}

#companyDataTable thead th {
  display: table-cell !important;
  background-color: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-top: none !important;
  border-left: none !important;
  border-bottom: 2px solid #cbd5e1 !important;
  border-right: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  height: 38px !important;
}

#companyDataTable thead th:last-child {
  border-right: none !important;
}

#companyDataTable tbody td {
  display: table-cell !important;
  padding: 10px 12px;
  vertical-align: middle !important;
  border-top: none !important;
  border-left: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  font-size: 12px;
  color: #1e293b;
  box-sizing: border-box !important;
}

#companyDataTable tbody td:last-child {
  border-right: none !important;
}

#companyDataTable tbody tr:hover td {
  background-color: #f8fafc;
}

#companyDataTable .table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.photo-link {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.photo-link:hover {
  color: #0056b3;
}

/* Action Icon Buttons */
.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-action-view {
  border-color: #007bff;
  color: #007bff;
}

.btn-action-view:hover {
  background-color: #007bff;
  color: #ffffff;
}

.btn-action-edit {
  border-color: #ffc107;
  color: #ffc107;
}

.btn-action-edit:hover {
  background-color: #ffc107;
  color: #111111;
}

.btn-action-delete {
  border-color: #dc3545;
  color: #dc3545;
}

.btn-action-delete:hover {
  background-color: #dc3545;
  color: #ffffff;
}

/* Table Pagination Footer */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #6c757d;
  padding-top: 5px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0;
}

.pagination-btn {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  padding: 6px 12px;
  font-size: 13px;
  color: #007bff;
  cursor: pointer;
  text-decoration: none;
}

.pagination-btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  color: #6c757d;
}

.pagination-btn:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.pagination-btn.active {
  background-color: #007bff;
  border-color: #007bff;
  color: #ffffff;
  font-weight: 600;
}

.pagination-btn.disabled {
  color: #6c757d;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------------- Modals ---------------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.2s ease-out;
}

.modal-box-large {
  max-width: 740px;
}

.modal-box form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f8fafc;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.modal-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #2c3e50;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Form 3-Column Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.form-label .required {
  color: #ef4444;
}

.form-input {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  color: #1e293b;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.form-file-input {
  font-size: 11px;
  color: #475569;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #edf2f7;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  background-color: #ffffff;
}

.modal-footer-left {
  justify-content: flex-start;
}

.modal-footer-right {
  justify-content: flex-end;
}

.btn-submit {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-submit:hover {
  background-color: #0069d9;
}

.btn-reset {
  background-color: #6c757d;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reset:hover {
  background-color: #5a6268;
}

/* View Details Modal Styling */
.view-emp-heading {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.info-table th {
  background-color: #edf1f5;
  color: #2c3e50;
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid #dce1e7;
  text-align: left;
  text-transform: uppercase;
}

.info-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.info-table td.info-label {
  font-weight: 700;
  width: 35%;
  background-color: #fbfbfd;
  color: #2c3e50;
}

.btn-print {
  background-color: #546e7a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-print:hover {
  background-color: #455a64;
}

.btn-pdf {
  background-color: #dc3545;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-pdf:hover {
  background-color: #c82333;
}

/* Photo Preview Modal */
.photo-preview-img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* ---------------- Bottom Footer ---------------- */
.app-footer {
  height: 36px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-top: 1px solid #e2e8f0;
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  z-index: 95;
  transition: left 0.25s ease;
}

.app-footer .footer-left {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.app-footer .footer-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.app-footer .footer-logo {
  height: 22px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.app-footer .footer-brand-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .stats-cards-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stats-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Live Report & Attendance Report Subtab Toggles ---------------- */
.tab-toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0 !important;
  white-space: nowrap;
}

.btn-toggle-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 14px;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
  background-color: transparent;
  color: #64748b;
}

.btn-toggle-tab:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.btn-toggle-tab.active {
  background-color: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-toggle-tab.inactive {
  background-color: transparent;
  color: #64748b;
  border: 1px solid transparent;
}

.btn-toggle-tab.inactive:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* Attendance Report, Live Report, and Leave & Permission Toggle Button Colors */
/* Blue: #0060FF */
#btnAllEntries,
#btnReqAll {
  background-color: #0060ff !important;
  color: #ffffff !important;
  border: 1px solid #0050d8 !important;
}

/* Green: #00C194 */
#btnProperEntries,
#btnLiveEntries,
#btnReqApproved {
  background-color: #00c194 !important;
  color: #ffffff !important;
  border: 1px solid #00a880 !important;
}

/* Red: #FC4C61 */
#btnImproperEntries,
#btnReqRejected {
  background-color: #fc4c61 !important;
  color: #ffffff !important;
  border: 1px solid #e03b50 !important;
}

/* Purple: #8A31FB */
#btnManualEntries {
  background-color: #8a31fb !important;
  color: #ffffff !important;
  border: 1px solid #7522e8 !important;
}

/* Yellow: #FABD02 */
#btnCompactView,
#btnTimeoutEntries,
#btnReqPending {
  background-color: #fabd02 !important;
  color: #1e293b !important;
  border: 1px solid #dca400 !important;
}

#btnAllEntries.btn-toggle-tab,
#btnProperEntries.btn-toggle-tab,
#btnImproperEntries.btn-toggle-tab,
#btnManualEntries.btn-toggle-tab,
#btnCompactView.btn-toggle-tab,
#btnLiveEntries.btn-toggle-tab,
#btnTimeoutEntries.btn-toggle-tab,
#btnReqAll.btn-toggle-tab,
#btnReqPending.btn-toggle-tab,
#btnReqApproved.btn-toggle-tab,
#btnReqRejected.btn-toggle-tab {
  font-weight: 700;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease-in-out;
}

#btnAllEntries.btn-toggle-tab:hover,
#btnProperEntries.btn-toggle-tab:hover,
#btnImproperEntries.btn-toggle-tab:hover,
#btnManualEntries.btn-toggle-tab:hover,
#btnCompactView.btn-toggle-tab:hover,
#btnLiveEntries.btn-toggle-tab:hover,
#btnTimeoutEntries.btn-toggle-tab:hover,
#btnReqAll.btn-toggle-tab:hover,
#btnReqPending.btn-toggle-tab:hover,
#btnReqApproved.btn-toggle-tab:hover,
#btnReqRejected.btn-toggle-tab:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.16);
}

#btnAllEntries.btn-toggle-tab.active,
#btnProperEntries.btn-toggle-tab.active,
#btnImproperEntries.btn-toggle-tab.active,
#btnManualEntries.btn-toggle-tab.active,
#btnLiveEntries.btn-toggle-tab.active,
#btnReqAll.btn-toggle-tab.active,
#btnReqApproved.btn-toggle-tab.active,
#btnReqRejected.btn-toggle-tab.active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 0 0 1.5px rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

#btnCompactView.btn-toggle-tab.active,
#btnTimeoutEntries.btn-toggle-tab.active,
#btnReqPending.btn-toggle-tab.active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 0 0 1.5px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

#btnAllEntries.btn-toggle-tab.inactive,
#btnProperEntries.btn-toggle-tab.inactive,
#btnImproperEntries.btn-toggle-tab.inactive,
#btnManualEntries.btn-toggle-tab.inactive,
#btnCompactView.btn-toggle-tab.inactive,
#btnLiveEntries.btn-toggle-tab.inactive,
#btnTimeoutEntries.btn-toggle-tab.inactive,
#btnReqAll.btn-toggle-tab.inactive,
#btnReqPending.btn-toggle-tab.inactive,
#btnReqApproved.btn-toggle-tab.inactive,
#btnReqRejected.btn-toggle-tab.inactive {
  opacity: 0.92;
}

#btnAllEntries.btn-toggle-tab.inactive:hover,
#btnProperEntries.btn-toggle-tab.inactive:hover,
#btnImproperEntries.btn-toggle-tab.inactive:hover,
#btnManualEntries.btn-toggle-tab.inactive:hover,
#btnCompactView.btn-toggle-tab.inactive:hover,
#btnLiveEntries.btn-toggle-tab.inactive:hover,
#btnTimeoutEntries.btn-toggle-tab.inactive:hover,
#btnReqAll.btn-toggle-tab.inactive:hover,
#btnReqPending.btn-toggle-tab.inactive:hover,
#btnReqApproved.btn-toggle-tab.inactive:hover,
#btnReqRejected.btn-toggle-tab.inactive:hover {
  opacity: 1;
}

/* Custom Count Badges for colored tabs */
#btnReqAll .tab-count-badge,
#btnReqApproved .tab-count-badge,
#btnReqRejected .tab-count-badge {
  background-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

#btnReqPending .tab-count-badge {
  background-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

/* Tab Count Badges */
.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

/* Inactive button badge variants */
.tab-count-badge.badge-all {
  background-color: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.tab-count-badge.badge-pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.tab-count-badge.badge-approved {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.tab-count-badge.badge-rejected {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Active tab badge appearance - crisp pill with soft translucent glow */
.btn-toggle-tab.active .tab-count-badge {
  background-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

/* Leave & Permission Status and Type Badges (Aligned with Application Text Size: 11px) */
.badge-status-approved {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px !important;
  font-weight: 700;
  display: inline-block;
  line-height: 1.3;
}

.badge-status-rejected {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px !important;
  font-weight: 700;
  display: inline-block;
  line-height: 1.3;
}

.badge-status-pending {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px !important;
  font-weight: 700;
  display: inline-block;
  line-height: 1.3;
}

.badge-type-perm {
  background-color: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge-type-leave {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}


.report-subtitle {
  font-size: 12px;
  color: #555555;
  margin-top: -10px;
  margin-bottom: 16px;
  padding-left: 2px;
}

.filter-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333333;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-input {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  background-color: #ffffff;
  width: 140px;
}

.filter-input:focus {
  border-color: #3b82f6;
}

.btn-filter {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-filter:hover {
  background-color: #1d4ed8;
}

.btn-clear {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.table-toolbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  min-width: 0;
  white-space: nowrap;
}

.table-toolbar-left > * {
  flex-shrink: 0 !important;
}

.table-toolbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  white-space: nowrap;
}

.table-toolbar-right > * {
  flex-shrink: 0 !important;
}

.export-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-export {
  background-color: #ffffff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #333333;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-export:hover {
  background-color: #f8fafc;
  border-color: #adb5bd;
}

.btn-export.btn-excel {
  color: #198754;
}

.btn-export.btn-pdf {
  color: #dc3545;
}

.status-filter-pills {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  background: #f1f5f9;
  padding: 2px 3px !important;
  border-radius: 6px;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.btn-status-filter {
  padding: 3px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#quotaUsageBadge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border-radius: 12px !important;
}

.toolbar-right-controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: auto;
  white-space: nowrap;
}

.view-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f1f5f9;
  padding: 2px;
  border-radius: 6px;
  flex-shrink: 0;
}

.btn-icon-view {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.btn-icon-view:hover {
  color: #0f172a;
}

.btn-icon-view.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pagination-arrow-btn {
  background: none;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 15px;
  font-weight: bold;
  color: #555555;
  cursor: pointer;
  padding: 4px 10px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-arrow-btn:hover {
  color: #111111;
  background-color: #f1f5f9;
}

.pagination-arrow-btn.disabled {
  color: #cccccc;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* Balance Summary Bar */
.balance-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  padding: 10px 14px;
  background-color: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* ---------------- Attendance Report Custom Styles ---------------- */
.btn-update {
  background-color: #ffffff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-update:hover {
  background-color: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.simple-table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.employee-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #111111;
  flex-shrink: 0;
  white-space: nowrap;
}

.employee-dropdown {
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 13px;
  outline: none;
  background-color: #ffffff;
  min-width: 170px;
}

.simple-export-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}

.btn-simple-excel {
  background-color: #198754;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-simple-excel:hover {
  background-color: #157347;
}

.btn-simple-pdf {
  background-color: #dc3545;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-simple-pdf:hover {
  background-color: #bb2d3b;
}

.btn-simple-print {
  background-color: #546e7a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-simple-print:hover {
  background-color: #455a64;
}

/* Simple Table Elements */
.employee-table-simple th {
  background-color: #212529 !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #000000;
}

.employee-table-simple tr.row-total td {
  background-color: #e9ecef;
  font-weight: 800;
  color: #000000;
  border-top: 2px solid #ced4da;
  border-bottom: 2px solid #ced4da;
}

.text-time-blue {
  color: #0d6efd;
  font-weight: 600;
}

.text-status-manual {
  color: #f59e0b;
  font-weight: 700;
}

/* ---------------- Manual Entry Tab Styles ---------------- */
.btn-action-manual-edit {
  background-color: #ffc107;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
}

.btn-action-manual-edit:hover {
  background-color: #e0a800;
}

.btn-action-manual-del {
  background-color: #dc3545;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-action-manual-del:hover {
  background-color: #c82333;
}

.salary-positive {
  color: #198754;
  font-weight: 700;
}

.salary-negative {
  color: #dc3545;
  font-weight: 700;
}

.modal-box-manual {
  max-width: 460px;
}

.modal-form-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-submit-full {
  width: 100%;
  background-color: #007bff;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-submit-full:hover {
  background-color: #0069d9;
}

/* ---------------- Payment Management & Advance Styles ---------------- */
.payment-banner-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-yellow-action {
  background-color: #ffc107;
  color: #111111;
  border: 1px solid #d39e00;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-yellow-action:hover {
  background-color: #e0a800;
  color: #000000;
}

.table-date-stacked {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.table-filter-date {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 11px;
  background-color: #ffffff;
  outline: none;
  min-width: 105px;
}

.table-filter-select {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 11px;
  background-color: #ffffff;
  outline: none;
  min-width: 80px;
}

.table-empty-message {
  text-align: center;
  color: #6c757d;
  font-size: 13px;
  padding: 18px 10px !important;
  background-color: #ffffff;
}

/* Payment Modal Matching Images 2, 3, 4 */
.modal-box-payment {
  background-color: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
  padding: 16px 22px 20px 22px;
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-close-icon-corner {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #333333;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.modal-close-icon-corner:hover {
  color: #000000;
}

.payment-form-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 12px;
  column-gap: 16px;
  align-items: center;
}

.payment-form-label {
  font-size: 12px;
  font-weight: 600;
  color: #212529;
}

.payment-form-control {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  background-color: #ffffff;
  box-sizing: border-box;
}

.payment-form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.payment-form-file {
  font-size: 12px;
  color: #333333;
}

.payment-modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.btn-std-save {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid #767676;
  border-radius: 2px;
  padding: 3px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-std-save:hover {
  background-color: #e9ecef;
}

/* Advance Management Top Form Matching Image 5 */
.advance-form-container {
  background-color: #ffffff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.advance-form-row {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.advance-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.advance-field-label {
  font-size: 12px;
  font-weight: 700;
  color: #333333;
}

.advance-field-input {
  border: 1px solid #767676;
  border-radius: 2px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
  background-color: #ffffff;
}

.advance-field-input:focus {
  border-color: #000000;
}

.btn-save-advance-std {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid #767676;
  border-radius: 2px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  height: 29px;
  display: inline-flex;
  align-items: center;
}

.btn-save-advance-std:hover {
  background-color: #e9ecef;
}

/* ==================================================== */
/* MOBILE & TABLET RESPONSIVENESS                        */
/* ==================================================== */

/* Drawer Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.drawer-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open {
  overflow: hidden !important;
}

@media (max-width: 992px) {
  .top-navbar {
    margin-left: 0 !important;
    height: 50px;
    padding: 0 12px;
  }

  .nav-center {
    position: static;
    transform: none;
    flex: 1;
    text-align: center;
    min-width: 0;
    padding: 0 8px;
  }

  .nav-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .nav-branch-toggle-btn {
    height: 32px;
    padding: 0 8px;
    max-width: 130px;
  }

  .nav-active-branch-badge {
    font-size: 11px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hamburger-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .app-container {
    margin-left: 0 !important;
  }

  .app-footer {
    left: 0 !important;
  }

  .nav-branch-dropdown-menu {
    max-width: calc(100vw - 16px) !important;
    min-width: 240px !important;
    right: 0 !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px !important;
    height: 100vh;
    max-height: 100vh;
    padding: 16px 12px !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.45);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.drawer-open .sidebar,
  .sidebar:not(.collapsed) {
    transform: translateX(0) !important;
  }

  .sidebar.collapsed {
    transform: translateX(-100%) !important;
  }

  /* Ensure mobile drawer always shows full text & labels */
  body.sidebar-mini .sidebar {
    width: 240px !important;
    padding: 16px 12px !important;
  }
  body.sidebar-mini .sidebar-brand-text,
  body.sidebar-mini .admin-subtitle,
  body.sidebar-mini .nav-item-btn span,
  body.sidebar-mini .sidebar-logout-card span {
    display: inline-block !important;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dash-charts-row,
  .dash-bottom-row,
  .dash-pdf-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }

  body {
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
  }

  .app-container {
    height: auto !important;
    overflow: visible !important;
    margin-left: 0 !important;
  }

  .main-wrapper {
    height: auto !important;
    overflow-y: visible !important;
    overflow-x: hidden;
  }

  .main-content {
    padding: 12px 10px 75px 10px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Top Banner Card */
  .content-banner-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
  }

  .banner-left {
    width: 100%;
    gap: 10px;
  }

  .banner-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .banner-title,
  .content-banner-title {
    font-size: 13.5px;
  }

  .banner-subtitle {
    font-size: 11px;
  }

  .banner-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .banner-actions button,
  .banner-actions a,
  .banner-actions .btn-primary-action,
  .banner-actions .btn-secondary-action,
  .banner-actions .btn-export,
  .btn-primary-action,
  .btn-new-entry {
    flex: 1 1 auto;
    min-width: 105px;
    min-height: 38px;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    padding: 8px 12px;
  }

  /* Subtab Toggle Buttons */
  .tab-toggle-container {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 4px;
    gap: 4px;
    scrollbar-width: none;
    border-radius: 8px;
  }

  .tab-toggle-container::-webkit-scrollbar {
    display: none;
  }

  .btn-toggle-tab {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 11.5px;
  }

  /* 5 Stat Summary Cards */
  .stats-cards-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card-timeout {
    grid-column: span 2;
  }

  .stat-card {
    padding: 12px 10px;
    border-radius: 8px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  /* Tables & Toolbars */
  .table-card {
    padding: 12px 10px;
    border-radius: 10px;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
  }

  .table-toolbar > div,
  .table-toolbar-left {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100%;
  }

  .entries-select-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .export-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .export-btn-group .btn-export {
    flex: 1 1 calc(20% - 6px);
    min-width: 52px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 8px;
    font-size: 11px;
  }

  .toolbar-right-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .view-toggle-wrapper {
    display: inline-flex !important;
    flex-shrink: 0 !important;
  }

  .search-box-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-box-wrapper .search-input {
    flex: 1;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 36px;
    font-size: 13px;
  }

  /* Filter bars */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .filter-input,
  .table-filter-select,
  .table-filter-date {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px;
    box-sizing: border-box;
  }

  .btn-filter,
  .btn-clear {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }

  /* Balance Summary Bar Mobile */
  .balance-summary-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  /* Simple Table Controls Mobile */
  .employee-select-wrapper {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .employee-dropdown {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .simple-export-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .simple-export-btns button,
  .btn-simple-excel,
  .btn-simple-pdf,
  .btn-simple-print {
    flex: 1 1 calc(33.333% - 6px) !important;
    min-height: 36px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Inline Forms (Advance, Payment, Payslip Selection) */
  .advance-form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .advance-field-group {
    width: 100%;
  }

  .advance-field-input {
    width: 100% !important;
    min-height: 38px;
    box-sizing: border-box;
  }

  .btn-save-advance-std {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }

  #payslipSelectionCard > div {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #payslipSelectionCard > div > div {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 4px !important;
  }

  #selectPayslipEmployee,
  #selectPayslipMonth,
  #btnGeneratePayslip {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px;
  }

  .payslip-document-wrapper {
    padding: 14px 10px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 11px !important;
  }

  /* Graceful touch-scrolling on phones for data tables */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
  }

  /* Table Footer & Pagination */
  .table-footer {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 10px 0 4px;
  }

  .pagination-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .pagination-btn {
    min-height: 36px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Modals */
  .modal-box,
  .modal-box-large,
  .modal-box-payment,
  .modal-box-manual,
  .modal-box-camera {
    width: 95% !important;
    max-width: 95% !important;
    max-height: calc(100dvh - 25px);
    overflow-y: auto;
    padding: 16px 12px;
    border-radius: 12px;
  }

  .form-grid,
  .form-grid-company,
  .payment-form-grid,
  .profile-grid,
  .view-company-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .form-grid .form-group,
  .form-grid-company .form-group,
  .form-grid [style*="grid-column: span"],
  .form-grid-company [style*="grid-column: span"],
  .view-company-grid [style*="grid-column: span"],
  .payment-form-grid .form-group {
    grid-column: span 1 !important;
  }

  .camera-stream-box {
    width: 100% !important;
    max-width: 280px !important;
    height: auto !important;
    aspect-ratio: 4/3;
  }

  .camera-modal-actions {
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .camera-modal-actions button {
    flex: 1 1 auto !important;
    min-height: 38px !important;
  }

  .reports-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .modal-footer {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 8px;
  }

  .modal-footer button,
  .modal-footer a {
    flex: 1;
    min-width: 100px;
    min-height: 38px;
    justify-content: center;
    text-align: center;
  }

  /* App Bottom Footer */
  .app-footer {
    height: auto;
    min-height: 36px;
    padding: 8px 12px;
    left: 0 !important;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .app-footer .footer-left,
  .app-footer .footer-brand-name {
    font-size: 10.5px;
  }

  .app-footer .footer-right {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .dash-stat-card.card-timeout {
    grid-column: span 2 !important;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .reports-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stats-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat-card-timeout {
    grid-column: span 2 !important;
  }

  .nav-title {
    font-size: 13px !important;
  }

  .top-navbar {
    padding: 0 8px;
  }

  .export-btn-group .btn-export {
    flex: 1 1 calc(33.333% - 6px);
  }

  .modal-overlay {
    padding: 8px !important;
  }

  .modal-body {
    padding: 12px !important;
  }

  .btn-std-save {
    min-height: 38px !important;
    padding: 8px 20px !important;
    width: 100% !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  .modal-close-icon-corner {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
  }
}

/* ================= EMPLOYEE GRID VIEW & PHOTO THUMBNAILS ================= */
.emp-table-photo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.emp-table-photo:hover {
  transform: scale(1.15);
  border-color: #3d6078;
}

.emp-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d6078, #2c3e50);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  margin: 0 auto;
}

.employee-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  padding: 14px 4px;
  align-items: start !important;
  grid-auto-rows: max-content !important;
}

.emp-grid-card {
  background-color: #eef4f8;
  border-radius: 12px;
  border: 1px solid #dce4ec;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  box-sizing: border-box;
}

.emp-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(61, 96, 120, 0.12);
  border-color: #b0c4de;
}

.emp-grid-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dce4ec;
}

.emp-grid-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.emp-grid-photo:hover {
  transform: scale(1.05);
}

.emp-grid-avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}

.emp-grid-info-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-grid-info-sub {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.emp-grid-id-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
}

.emp-grid-body {
  font-size: 11.5px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emp-grid-stat-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 2px;
}

.emp-grid-pill {
  background: #ffffff;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-grid-pill-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.emp-grid-pill-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.emp-grid-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #475569;
  padding: 1px 0;
}

.emp-grid-contact-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}

.emp-grid-contact-text {
  font-weight: 600;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emp-grid-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.view-modal-photo {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #3d6078;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ================= COMPANY GRID VIEW & LOGO THUMBNAILS ================= */
.comp-table-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #e2e8f0;
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.15s ease;
  background: #ffffff;
}

.comp-table-logo:hover {
  transform: scale(1.15);
  border-color: #3b82f6;
}

.comp-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  margin: 0 auto;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.25);
}

.company-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px 4px;
}

.comp-grid-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.comp-grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  border-color: #93c5fd;
}

.comp-grid-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.comp-grid-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid #e2e8f0;
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.comp-grid-avatar-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1e3a8a, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.comp-grid-info-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 3px;
  word-break: break-word;
}

.comp-grid-info-sub {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  font-family: monospace;
}

.comp-grid-body {
  font-size: 12px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.comp-grid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #f1f5f9;
  padding-bottom: 4px;
}

.comp-grid-label {
  color: #64748b;
  font-weight: 600;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comp-grid-val {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  font-size: 11.5px;
}

.comp-grid-switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 0 4px 0;
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.comp-grid-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Toolbar Right Controls & Icon-only View Toggles */
.toolbar-right-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-toggle-wrapper {
  display: inline-flex;
  border: 1px solid #ced4da;
  border-radius: 5px;
  overflow: hidden;
  background-color: #ffffff;
}

.btn-icon-view {
  background-color: #ffffff;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-icon-view:first-child {
  border-right: 1px solid #e2e8f0;
}

.btn-icon-view:hover {
  background-color: #f1f5f9;
  color: #3d6078;
}

.btn-icon-view.active {
  background-color: #3d6078;
  color: #ffffff;
}

/* Dedicated Face Camera Registration Overlay Modal */
.face-camera-modal-overlay {
  z-index: 1100 !important;
}

.modal-box-camera {
  max-width: 420px;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  animation: modalFadeIn 0.2s ease-out;
}

.camera-stream-box {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4/3;
  background-color: #1a1a2e;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #3d6078;
  margin: 0 auto;
}

.camera-stream-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  -webkit-transform: scaleX(-1);
}

.face-camera-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 135px;
  height: 175px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.16);
  z-index: 2;
}

.face-guidelines-pills {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.face-guidelines-pills span {
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
}

.camera-status-msg {
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
  font-weight: 600;
  color: #3d6078;
}

.camera-modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-snapshot {
  background-color: #198754;
  padding: 8px 20px;
  font-size: 13px;
}

/* Salary Basis Single Line Badge */
.badge-salary-basis,
.employee-table td .status-pill,
.employee-table td .status-badge {
  white-space: nowrap !important;
  display: inline-block;
}

.employee-table th,
.employee-table td,
.employee-table th:nth-child(5),
.employee-table td:nth-child(5) {
  display: table-cell !important;
}

/* Company Profile Styling */
.profile-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #edf2f7;
  padding: 24px;
  max-width: 900px;
  margin: 0 auto 30px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.profile-field-readonly {
  background-color: #f8fafc !important;
  color: #475569 !important;
  cursor: not-allowed;
  border-color: #e2e8f0 !important;
}

/* ================= MODERN DASHBOARD VIEW (MATCHING REFERENCE UI) ================= */

body.page-dashboard .main-content {
  background-color: #f1f5f9;
  padding: 18px 24px 90px 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

body.page-dashboard .top-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.page-dashboard .nav-title {
  color: #0f172a;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.8px;
}

body.page-dashboard .hamburger-btn {
  background-color: transparent;
  border: 1px solid #e2e8f0;
}

body.page-dashboard .hamburger-btn span {
  background-color: #334155;
}

body.page-dashboard .btn-logout {
  background-color: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

body.page-dashboard .btn-logout:hover {
  background-color: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

body.page-dashboard .btn-fullscreen {
  background-color: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

body.page-dashboard .bottom-footer {
  display: none;
}

/* Dashboard Container */
.dash-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ROW 1: 5 Stat Cards - Single Row on all non-mobile devices */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 768px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .dash-stat-card.card-timeout {
    grid-column: span 2 !important;
  }
}

@media (max-width: 480px) {
  .top-navbar {
    height: 48px !important;
    padding: 0 8px !important;
    gap: 4px !important;
  }

  .hamburger-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 4px !important;
    flex-shrink: 0 !important;
  }

  .nav-center {
    padding: 0 4px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .nav-title {
    font-size: 13px !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .nav-branch-title-suffix {
    display: none !important;
  }

  .nav-right {
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .nav-branch-toggle-btn {
    height: 30px !important;
    padding: 0 8px !important;
    max-width: 120px !important;
    flex-shrink: 0 !important;
  }

  .nav-active-branch-badge {
    font-size: 11px !important;
    font-weight: 700 !important;
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .top-nav-logo-circle {
    width: 28px !important;
    height: 28px !important;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .dash-stat-card.card-timeout {
    grid-column: span 2 !important;
  }
}

.dash-stat-card {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dash-stat-card.card-total {
  background-color: #d9eefd;
  border: 1px solid #bae6fd;
}
.dash-stat-card.card-present {
  background-color: #d1fae5;
  border: 1px solid #a7f3d0;
}
.dash-stat-card.card-leave {
  background-color: #ede9fe;
  border: 1px solid #ddd6fe;
}
.dash-stat-card.card-absent {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
}
.dash-stat-card.card-timeout {
  background-color: #fef3c7;
  border: 1px solid #fde68a;
}

.dash-stat-card .stat-icon-badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-card.card-total .stat-icon-badge {
  background-color: #0060ff;
  color: #ffffff;
}
.dash-stat-card.card-present .stat-icon-badge {
  background-color: #00c194;
  color: #ffffff;
}
.dash-stat-card.card-leave .stat-icon-badge {
  background-color: #8a31fb;
  color: #ffffff;
}
.dash-stat-card.card-absent .stat-icon-badge {
  background-color: #fc4c61;
  color: #ffffff;
}
.dash-stat-card.card-timeout .stat-icon-badge {
  background-color: #fabd02;
  color: #ffffff;
}

.dash-stat-card .stat-icon-badge svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.dash-stat-card .stat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.dash-stat-card .stat-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-stat-card .stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}

.dash-stat-card .stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.dash-stat-card .stat-trend {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  white-space: nowrap;
}

.stat-trend.trend-present,
.stat-trend.trend-total {
  color: #16a34a;
}

.stat-trend.trend-leave {
  color: #7c3aed;
}

.stat-trend.trend-absent {
  color: #dc2626;
}

.stat-trend.trend-timeout {
  color: #d97706;
}

.stat-main {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.stat-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-blue-subtle { background-color: #e0f2fe; }
.text-blue { color: #0284c7; }

.bg-green-subtle { background-color: #dcfce7; }
.text-green { color: #10b981; }

.bg-red-subtle { background-color: #fee2e2; }
.text-red { color: #ef4444; }

.bg-amber-subtle { background-color: #fef3c7; }
.text-amber { color: #f59e0b; }

.bg-purple-subtle { background-color: #f3e8ff; }
.text-purple { color: #8b5cf6; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.stat-num {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.stat-value-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.pill-green {
  color: #10b981;
}

.pill-purple {
  color: #8b5cf6;
}

.pill-red {
  color: #ef4444;
}

.pill-amber {
  color: #f59e0b;
}

.stat-deco {
  opacity: 0.22;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deco-blue { color: #0284c7; }
.deco-green { color: #10b981; }
.deco-purple { color: #8b5cf6; }
.deco-red { color: #ef4444; }
.deco-amber { color: #f59e0b; }

/* ROW 2: Charts Row */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-chart-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #eef2f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title-text {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.card-filter-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background-color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.chart-canvas-container {
  height: 250px;
  position: relative;
  width: 100%;
}

/* ROW 3: Bottom 2 Cards (Today's Attendance & Department Wise Summary) */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ROW 4: PDF Report Preview Cards (Yesterday's Activity & Previous Month Salary) */
.dash-pdf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-pdf-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #eef2f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.dash-pdf-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.dash-pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-pdf-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #f8fafc;
}

.dash-pdf-btn-action:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.dash-pdf-btn-action.btn-primary-action {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.dash-pdf-btn-action.btn-primary-action:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.dash-pdf-container {
  width: 100%;
  height: 420px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  margin-top: 12px;
  position: relative;
}

.dash-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.dash-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #eef2f6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.card-link-action {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease;
}

.card-link-action:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Tables inside Dashboard Cards */
.card-table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 270px;
  min-height: 200px;
  width: 100%;
}

@media (min-width: 992px) {
  .card-table-scroll {
    overflow-x: hidden;
  }
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dash-table thead th {
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.dash-table tbody td {
  padding: 9px 6px;
  color: #334155;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.dash-table tbody tr:hover {
  background-color: #f8fafc;
}

.text-muted { color: #94a3b8; font-size: 11px; }
.font-semibold { font-weight: 600; }
.text-dark { color: #0f172a; }

.table-empty {
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-style: italic;
}

/* Status Badges */
.table-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.badge-present {
  background-color: #dcfce7;
  color: #166534;
}

.badge-absent {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-timeout {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-leave {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
  border: 1px solid #d8b4fe !important;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.qa-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qa-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qa-arrow {
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.qa-btn:hover .qa-arrow {
  transform: translateX(3px);
}

.qa-btn-blue {
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e3a8a;
}
.qa-btn-blue .qa-icon,
.qa-btn-blue .qa-arrow {
  color: #2563eb;
}

.qa-btn-orange {
  background-color: #fff7ed;
  border: 1px solid #ffedd5;
  color: #7c2d12;
}
.qa-btn-orange .qa-icon,
.qa-btn-orange .qa-arrow {
  color: #ea580c;
}

.qa-btn-green {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #14532d;
}
.qa-btn-green .qa-icon,
.qa-btn-green .qa-arrow {
  color: #16a34a;
}

.qa-btn-red {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #7f1d1d;
}
.qa-btn-red .qa-icon,
.qa-btn-red .qa-arrow {
  color: #dc2626;
}

.qa-btn-purple {
  background-color: #faf5ff;
  border: 1px solid #f3e8ff;
  color: #581c87;
}
.qa-btn-purple .qa-icon,
.qa-btn-purple .qa-arrow {
  color: #9333ea;
}

.qa-btn-violet {
  background-color: #fdf4ff;
  border: 1px solid #fae8ff;
  color: #701a75;
}
.qa-btn-violet .qa-icon,
.qa-btn-violet .qa-arrow {
  color: #c026d3;
}


/* Responsive Breakpoints for Dashboard */
@media (max-width: 1200px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-charts-row,
  .dash-bottom-row,
  .dash-pdf-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.page-dashboard .main-content {
    padding: 12px 10px 75px 10px !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .dash-stat-card.card-timeout {
    grid-column: span 2 !important;
  }

  .dash-charts-row,
  .dash-bottom-row,
  .dash-pdf-row {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .dash-stat-card {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-height: 64px !important;
  }

  .dash-stat-card .stat-icon-badge {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
  }

  .dash-stat-card .stat-icon-badge svg {
    width: 18px !important;
    height: 18px !important;
  }

  .dash-stat-card .stat-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 2px !important;
  }

  .dash-stat-card .stat-value-row {
    gap: 6px !important;
  }

  .dash-stat-card .stat-num {
    font-size: 20px !important;
    font-weight: 800 !important;
  }

  .dash-stat-card .stat-trend {
    font-size: 10.5px !important;
  }

  .dash-chart-card,
  .dash-card,
  .dash-pdf-card {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 14px 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .dash-pdf-container {
    height: 350px !important;
  }

  .chart-canvas-container {
    height: 220px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  .chart-canvas-container canvas {
    max-width: 100% !important;
    width: 100% !important;
  }

  .card-table-scroll {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .card-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-title-text {
    font-size: 13.5px !important;
  }
}


/* ==========================================================================
   LEAVE & PERMISSION MODULE STYLES (IMAGES 1, 2, 3, 4, 5)
   ========================================================================== */

/* Employee Portal: Action Cards Grid (Image 1) */
.leave-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.leave-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.leave-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.leave-card-blue {
  background-color: #f0f9ff;
  border-color: #bae6fd;
}

.leave-card-blue:hover {
  border-color: #0284c7;
}

.leave-card-green {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

.leave-card-green:hover {
  border-color: #16a34a;
}

.leave-action-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.leave-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-circle-blue {
  background-color: #e0f2fe;
  color: #0284c7;
}

.icon-circle-green {
  background-color: #dcfce7;
  color: #16a34a;
}

.leave-action-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.leave-action-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.btn-circle-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.btn-circle-blue {
  background-color: #0284c7;
  color: #ffffff;
}

.btn-circle-green {
  background-color: #16a34a;
  color: #ffffff;
}

.leave-action-card:hover .btn-circle-arrow {
  transform: translateX(3px);
}

/* Portal Logo Circle Badge */
.portal-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Dual Section: My Requests (Left) & My Leave Balance (Right) */
.leave-dual-section {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 991px) {
  .leave-dual-section {
    grid-template-columns: 1fr;
  }
}

.leave-requests-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
  max-width: 100%;
}

.leave-balance-box {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
  max-width: 100%;
}

.leave-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

/* Progress Bars in My Leave Balance */
.balance-bars-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balance-bar-item {
  width: 100%;
}

.balance-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 3px;
}

.balance-bar-header strong {
  font-weight: 700;
  color: #0f172a;
  font-size: 11px;
}

.balance-track {
  height: 5px;
  background-color: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.balance-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.fill-blue { background-color: #0284c7; }
.fill-teal { background-color: #0d9488; }
.fill-indigo { background-color: #6366f1; }
.fill-purple { background-color: #a855f7; }

/* Status Badges */
.status-pill-pending {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.status-pill-approved {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.status-pill-rejected {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

/* Modals: Apply for Leave (Image 2) & Permission (Image 3) */
.modal-box-leave, .modal-box-perm {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  width: 95%;
  position: relative;
}

.modal-header-leave {
  background-color: #2c4c68;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header-perm {
  background-color: #1e3a5f;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.form-label-leave {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

.form-input-leave {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e293b;
  box-sizing: border-box;
  background-color: #ffffff;
}

.form-input-leave:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-input-readonly {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12.5px;
  color: #64748b;
  box-sizing: border-box;
  background-color: #f8fafc;
  cursor: not-allowed;
}

.modal-balance-box {
  background-color: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 14px;
}

.modal-bal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}

.badge-bal-blue {
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-bal-green {
  background-color: #dcfce7;
  color: #15803d;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.badge-bal-yellow {
  background-color: #fef9c3;
  color: #a16207;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.session-radio-group {
  display: flex;
  gap: 12px;
}

.session-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  background-color: #f8fafc;
  transition: all 0.15s ease;
  user-select: none;
}

.session-radio-label.active {
  background-color: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.file-upload-box {
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
  background-color: #f8fafc;
}

.file-upload-box input[type="file"] {
  width: 100%;
  font-size: 12px;
  color: #475569;
}

.modal-footer-leave {
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-leave-cancel {
  background-color: #e2e8f0;
  color: #475569;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-leave-cancel:hover {
  background-color: #cbd5e1;
}

.btn-leave-submit {
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-leave-submit:hover {
  background-color: #0369a1;
}

.btn-perm-submit {
  background-color: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}

.btn-perm-submit:hover {
  background-color: #15803d;
}

/* Permission Modal Header User Box (Image 3) */
.perm-emp-header-box {
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.perm-balance-summary-box {
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 14px;
}

/* ================= Admin Leave & Permission Hub (Image 4) ================= */
.leave-admin-header {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.leave-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .leave-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .leave-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.leave-kpi-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.leave-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-amber { background-color: #fef3c7; color: #b45309; }
.kpi-icon-green { background-color: #dcfce7; color: #16a34a; }
.kpi-icon-red   { background-color: #fee2e2; color: #dc2626; }
.kpi-icon-blue  { background-color: #e0f2fe; color: #0284c7; }

.leave-kpi-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.leave-kpi-val {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  margin: 3px 0 2px;
}

.leave-kpi-sub {
  font-size: 11px;
  color: #64748b;
}

/* Leave Policy Section (Image 4) */
.leave-policy-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.leave-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 1024px) {
  .leave-policy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .leave-policy-grid {
    grid-template-columns: 1fr;
  }
}

.leave-policy-item {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.policy-icon-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.policy-input-num {
  width: 60px;
  padding: 5px 8px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
}

/* Review Page (Image 5) */
.review-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.review-emp-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.review-emp-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 991px) {
  .review-layout-grid {
    grid-template-columns: 1fr;
  }
}

.review-info-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.review-info-table {
  width: 100%;
  border-collapse: collapse;
}

.review-info-table td {
  padding: 10px 6px;
  font-size: 12.5px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: top;
}

.review-info-table td:first-child {
  width: 130px;
  font-weight: 700;
  color: #475569;
}

.review-attachment-card {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.review-bal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12.5px;
}

.review-bal-pill {
  padding: 3px 12px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 12px;
}

.review-bal-green { background-color: #dcfce7; color: #15803d; }
.review-bal-blue  { background-color: #e0f2fe; color: #0369a1; }
.review-bal-gray  { background-color: #f1f5f9; color: #64748b; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin-anim {
  animation: spin 0.75s linear infinite;
  display: inline-block;
}

/* ---------------- Dynamic Circular Company Logo (Top Right) ---------------- */
.top-nav-logo-circle,
.portal-logo-circle {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-nav-logo-circle {
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.portal-logo-circle {
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.top-nav-logo-circle:hover,
.portal-logo-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.top-nav-logo-img,
.portal-logo-img,
.default-profile-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  display: block;
}

/* ---------------- Dynamic Employee Documents Upload ---------------- */
.doc-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  flex-wrap: wrap;
}

.doc-entry-row:hover {
  border-color: #cbd5e1;
  background-color: #f1f5f9;
}

.doc-title-input {
  flex: 1;
  min-width: 170px;
  height: 34px;
  padding: 6px 10px;
  font-size: 12.5px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.doc-upload-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-doc-choose {
  background-color: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-doc-choose:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.doc-file-status {
  font-size: 11.5px;
  color: #64748b;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.btn-doc-view {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-doc-view:hover {
  background-color: #bae6fd;
  color: #0284c7;
}

.btn-doc-add {
  background-color: #3d6078;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.btn-doc-add:hover {
  background-color: #2b4557;
}

.btn-doc-remove {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-doc-remove:hover {
  background-color: #fecaca;
  color: #b91c1c;
}

/* ==========================================================================
   SPA Instant Navigation: Top Progress Bar & View Transitions
   ========================================================================== */
.spa-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #0060ff 0%, #00c194 100%);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.18s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.2s ease;
  box-shadow: 0 0 8px rgba(0, 96, 255, 0.8), 0 0 14px rgba(0, 193, 148, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: 0.12s ease-out both spa-fade-out;
  }
  ::view-transition-new(root) {
    animation: 0.12s ease-in both spa-fade-in;
  }
}

@keyframes spa-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes spa-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   Global Saving Feedback Overlay & Anti-Duplicate Processing Modal
   ========================================================================== */
.global-saving-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.global-saving-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.global-saving-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 26px;
  box-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 440px;
  width: 90%;
  animation: savingCardPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes savingCardPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.global-saving-spinner {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 50%;
}

.spinner-ring {
  width: 26px;
  height: 26px;
  border: 3px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: savingSpin 0.75s linear infinite;
}

@keyframes savingSpin {
  to { transform: rotate(360deg); }
}

.global-saving-content {
  flex: 1;
  min-width: 0;
}

.global-saving-title {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.global-saving-subtitle {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}

/* Button saving state indicator */
.btn-is-submitting {
  pointer-events: none !important;
  opacity: 0.72 !important;
  cursor: not-allowed !important;
}

/* ==========================================================================
   UNIVERSAL CROSS-DEVICE & MOBILE RESPONSIVENESS SUITE (ALL MODULES & UIS)
   ========================================================================== */

/* 1. Global Viewport & Safe-Area Safeguards */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  max-width: 100vw;
  overflow-x: hidden !important;
}

body {
  min-height: 100dvh;
}

.app-container {
  min-height: calc(100dvh - 52px);
  max-width: 100vw;
  overflow-x: hidden !important;
}

.main-wrapper {
  max-width: 100vw;
  overflow-x: hidden !important;
}

.main-content {
  box-sizing: border-box;
}

/* 2. Responsive Tables & Touch Scrolling Momentum */
.table-responsive,
.table-responsive-custom,
.table-container,
.fw-table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
  position: relative;
}

.table-responsive::-webkit-scrollbar,
.fw-table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb,
.fw-table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* 3. Universal Mobile Subtab Horizontal Carousels */
.tab-toggle-container,
.subtab-toggle-group,
.nav-tabs-custom,
.fw-subnav-pills {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  max-width: 100% !important;
}

.tab-toggle-container::-webkit-scrollbar,
.fw-subnav-pills::-webkit-scrollbar {
  display: none !important;
}

.tab-toggle-container .btn-toggle-tab,
.fw-subnav-pills .nav-item-btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* 4. Touch Targets & Minimum Action Button Sizing */
.btn-action-icon,
.btn-action-view,
.btn-action-edit,
.btn-action-delete,
.btn-action-call {
  min-width: 32px !important;
  min-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  touch-action: manipulation;
}

/* 5. Mobile & Tablet Breakpoints */
@media (max-width: 992px) {
  /* Navigation Bar Adaptations */
  .top-navbar {
    margin-left: 0 !important;
    padding: 0 12px;
    height: 50px;
  }

  .nav-center {
    position: static;
    transform: none;
    flex: 1;
    text-align: center;
    min-width: 0;
    padding: 0 8px;
  }

  .nav-title {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Branch switcher dropdown containment */
  .nav-branch-dropdown-menu {
    max-width: calc(100vw - 16px) !important;
    min-width: 260px !important;
    right: 0 !important;
    left: auto !important;
  }

  /* Grids */
  .stats-cards-row,
  .dash-stats-grid,
  .leave-kpi-grid,
  .fw-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari Automatic Viewport Zoom on Form Focus */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Main Content Spacing for Mobile (account for fixed header + bottom footer + safe area) */
  .main-content {
    padding: 12px 10px calc(80px + var(--safe-bottom)) 10px !important;
    max-width: 100vw !important;
  }

  /* Top Banner Cards */
  .content-banner-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px 12px !important;
  }

  .banner-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .banner-actions button,
  .banner-actions a,
  .banner-actions .btn-primary-action,
  .banner-actions .btn-secondary-action,
  .banner-actions .btn-export {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 42px !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 12.5px !important;
  }

  /* Form Grids collapse to single-column */
  .form-grid,
  .form-grid-company,
  .payment-form-grid,
  .profile-grid,
  .view-company-grid,
  .advance-form-row,
  .fw-form-grid-4,
  .fw-form-grid-3,
  .fw-form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-grid [style*="grid-column: span"],
  .form-grid-company [style*="grid-column: span"],
  .view-company-grid [style*="grid-column: span"],
  .payment-form-grid .form-group,
  .fw-col-span-2,
  .fw-col-span-3,
  .fw-col-span-4 {
    grid-column: span 1 !important;
  }

  /* Export Button Groups */
  .export-btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .export-btn-group .btn-export {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 38px !important;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
  }

  /* Table Toolbars */
  .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .table-toolbar-left {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .table-toolbar-left > .filter-group {
    flex: 1 1 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }

  .table-toolbar-left .filter-input,
  .table-toolbar-left select.filter-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    font-size: 14px !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
  }

  .table-toolbar-left > .btn-filter,
  .table-toolbar-left > .btn-clear {
    flex: 1 1 calc(50% - 4px) !important;
    min-height: 40px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .table-toolbar-right,
  .toolbar-right-controls {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .entries-select-wrapper {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .entries-select-wrapper .entries-select {
    min-height: 38px !important;
    font-size: 13px !important;
    padding: 4px 8px !important;
  }

  .search-box-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 4px !important;
  }

  .search-box-wrapper label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    white-space: nowrap !important;
  }

  .search-box-wrapper .search-input {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    font-size: 14px !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
  }

  /* Subtab Toggle Buttons & Status Pills (Mobile Touch Carousel) */
  .tab-toggle-container,
  .status-tabs-nav,
  .status-filter-pills {
    display: flex !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    padding: 4px !important;
    gap: 4px !important;
    border-radius: 8px !important;
  }

  .tab-toggle-container::-webkit-scrollbar,
  .status-tabs-nav::-webkit-scrollbar,
  .status-filter-pills::-webkit-scrollbar {
    display: none !important;
  }

  .btn-toggle-tab,
  .status-tab-btn,
  .btn-status-filter {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* Compact Table Cells on Mobile */
  .employee-table th,
  .employee-table td,
  .table-custom th,
  .table-custom td,
  .fw-table th,
  .fw-table td {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  /* Modals: Universal Bottom-Sheet on Mobile */
  .modal-overlay,
  .fw-modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .modal-box,
  .modal-box-large,
  .modal-box-payment,
  .modal-box-manual,
  .modal-box-leave,
  .modal-box-perm,
  .fw-modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(94dvh - var(--safe-top)) !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.25) !important;
  }

  .modal-header,
  .fw-modal-header {
    padding: 14px 16px !important;
    flex-shrink: 0 !important;
  }

  .modal-body,
  .fw-modal-body {
    flex: 1 1 auto !important;
    max-height: calc(94dvh - 120px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 16px !important;
  }

  .modal-footer,
  .fw-modal-footer {
    padding: 12px 16px calc(12px + var(--safe-bottom)) 16px !important;
    flex-shrink: 0 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .modal-footer button,
  .modal-footer a,
  .fw-modal-footer .fw-btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 42px !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 13px !important;
  }

  /* App Footer with Safe Area Support */
  .app-footer {
    left: 0 !important;
    padding: 8px 12px calc(8px + var(--safe-bottom)) 12px !important;
    min-height: 38px !important;
  }
}

@media (max-width: 576px) {
  /* 2-column KPI Metrics for sleek mobile app feel */
  .stats-cards-row,
  .dash-stats-grid,
  .reports-stats-grid,
  .leave-kpi-grid,
  .fw-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card-timeout,
  .dash-stat-card.card-timeout {
    grid-column: span 2 !important;
  }

  /* Full-width Modal Action Buttons */
  .modal-footer button,
  .modal-footer a,
  .fw-modal-footer .fw-btn {
    flex: 1 1 100% !important;
  }

  /* Leaflet & Map Containers */
  #fieldLiveMap,
  #assignPickerMap,
  #branchLocationMap,
  .map-box-responsive {
    height: 290px !important;
    max-height: 40dvh !important;
    width: 100% !important;
    border-radius: 8px !important;
  }

  /* Camera Stream Viewport */
  .camera-stream-box,
  .fw-camera-box,
  .portal-camera-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 4/3 !important;
    margin: 0 auto !important;
  }

  /* Payslip Paper Scale for Phones */
  .payslip-document-wrapper,
  .payslip-table-wrapper {
    padding: 10px 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@media (max-width: 380px) {
  /* Ultra-compact Phones (iPhone SE, Galaxy A01, etc.) */
  .top-navbar {
    padding: 0 6px !important;
    height: 46px !important;
  }

  .nav-title {
    font-size: 11px !important;
  }

  .hamburger-btn {
    width: 30px !important;
    height: 30px !important;
    padding: 4px !important;
  }

  .nav-branch-toggle-btn {
    max-width: 95px !important;
    padding: 0 4px !important;
    height: 26px !important;
  }

  .nav-active-branch-badge {
    font-size: 9.5px !important;
    max-width: 70px !important;
  }

  .banner-actions button,
  .banner-actions a,
  .banner-actions .btn-primary-action,
  .banner-actions .btn-secondary-action {
    flex: 1 1 100% !important;
  }
}

/* =========================================================================
   UNIVERSAL 20% / 80% UI LAYOUT RULE
   Top Controls Zone: ~20% of screen height
   Records Zone: ~80% of screen height
   DASHBOARD TAB STRICTLY EXCLUDED (:not(.page-dashboard))
   ========================================================================= */

@media (min-width: 993px) {
  /* 1. Viewport Container Lock for Non-Dashboard Pages */
  body:not(.page-dashboard) .main-wrapper {
    height: calc(100vh - 60px - 38px) !important;
    overflow-y: hidden !important;
  }

  body:not(.page-dashboard) .main-content {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 18px 8px 18px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* 2. Top Controls Zone (~20% screen height) */
  body:not(.page-dashboard) .content-banner-card {
    padding: 6px 14px !important;
    margin-bottom: 6px !important;
    min-height: 42px !important;
    max-height: 48px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    gap: 10px !important;
  }

  body:not(.page-dashboard) .banner-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  body:not(.page-dashboard) .banner-icon-badge {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .banner-icon-badge svg {
    width: 16px !important;
    height: 16px !important;
  }

  body:not(.page-dashboard) .banner-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    margin-bottom: 1px !important;
    letter-spacing: 0.3px !important;
  }

  body:not(.page-dashboard) .banner-subtitle {
    font-size: 10.5px !important;
    line-height: 1.15 !important;
    color: #64748b !important;
    margin: 0 !important;
  }

  body:not(.page-dashboard) .banner-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  body:not(.page-dashboard) .btn-primary-action,
  body:not(.page-dashboard) .btn-secondary-action {
    height: 30px !important;
    padding: 3px 12px !important;
    font-size: 11.5px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  body:not(.page-dashboard) .filter-bar {
    margin-bottom: 6px !important;
    gap: 8px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .filter-group {
    gap: 3px !important;
    font-size: 10.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .filter-group label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .filter-input,
  body:not(.page-dashboard) select.filter-input {
    height: 25px !important;
    padding: 1px 5px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
  }

  body:not(.page-dashboard) input[type="date"].filter-input,
  body:not(.page-dashboard) .filter-input[type="date"] {
    width: 98px !important;
    max-width: 102px !important;
    padding: 1px 3px !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) input[type="month"].filter-input,
  body:not(.page-dashboard) .filter-input[type="month"] {
    width: 108px !important;
    max-width: 112px !important;
    padding: 1px 4px !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) select.filter-input {
    max-width: 100px !important;
    min-width: 75px !important;
    text-overflow: ellipsis !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .btn-filter,
  body:not(.page-dashboard) .btn-clear {
    height: 25px !important;
    padding: 2px 7px !important;
    font-size: 10.5px !important;
    border-radius: 5px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body:not(.page-dashboard) .tab-toggle-container {
    gap: 4px !important;
  }

  body:not(.page-dashboard) .btn-toggle-tab {
    padding: 4px 10px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
  }

  body:not(.page-dashboard) .table-toolbar,
  .fw-section-pane:not(#paneFieldDashboard) .table-toolbar {
    margin-bottom: 6px !important;
    padding-bottom: 4px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
    overflow-x: auto !important;
    scrollbar-width: thin !important;
  }

  body:not(.page-dashboard) .table-toolbar-left,
  .fw-section-pane:not(#paneFieldDashboard) .table-toolbar-left {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  body:not(.page-dashboard) .table-toolbar-right,
  .fw-section-pane:not(#paneFieldDashboard) .table-toolbar-right {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    margin-left: auto !important;
  }

  body:not(.page-dashboard) .entries-select-wrapper,
  body:not(.page-dashboard) .search-box-wrapper {
    font-size: 10.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  body:not(.page-dashboard) .entries-select-wrapper label,
  body:not(.page-dashboard) .search-box-wrapper label {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin: 0 !important;
  }

  body:not(.page-dashboard) .entries-select {
    height: 25px !important;
    padding: 1px 4px !important;
    font-size: 10.5px !important;
    border-radius: 5px !important;
    box-sizing: border-box !important;
  }

  body:not(.page-dashboard) .search-input {
    height: 25px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    border-radius: 5px !important;
    width: 80px !important;
    min-width: 75px !important;
    box-sizing: border-box !important;
    transition: width 0.2s ease !important;
  }

  body:not(.page-dashboard) .search-input:focus {
    width: 115px !important;
  }

  body:not(.page-dashboard) .export-btn-group {
    gap: 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  body:not(.page-dashboard) .btn-export {
    height: 25px !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
    border-radius: 5px !important;
    gap: 3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  body:not(.page-dashboard) .btn-export svg {
    width: 11px !important;
    height: 11px !important;
  }

  /* 3. Records Zone (~80% screen height) */
  body:not(.page-dashboard) .table-card {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 10px 14px 6px 14px !important;
    margin-bottom: 0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    overflow: hidden !important;
  }

  body:not(.page-dashboard) .table-card[style*="display: none"],
  body:not(.page-dashboard) .table-card[style*="display:none"],
  body:not(.page-dashboard) .table-card.d-none,
  body:not(.page-dashboard) .table-card.is-hidden {
    display: none !important;
  }

  body:not(.page-dashboard) .table-responsive,
  body:not(.page-dashboard) .table-responsive-wrapper {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    min-height: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    margin-bottom: 4px !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  /* Grid & Card Containers inside Table-Card (Employee Details, Manage Companies) */
  body:not(.page-dashboard) .employee-grid-container,
  body:not(.page-dashboard) .company-grid-container {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    padding: 12px 6px 24px 6px !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    align-items: start !important;
    grid-auto-rows: max-content !important;
  }

  /* Sticky Header on all Data Tables */
  body:not(.page-dashboard) .employee-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
    background: #f8fafc !important;
    box-shadow: 0 1px 0 #cbd5e1 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  body:not(.page-dashboard) .employee-table tbody td {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  /* Docked Table Footer at bottom of records card */
  body:not(.page-dashboard) .table-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding: 6px 0 0 0 !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  body:not(.page-dashboard) .pagination-btn {
    height: 24px !important;
    min-width: 24px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    line-height: 24px !important;
  }

  /* Universal Sleek Scrollbars */
  body:not(.page-dashboard) .employee-grid-container::-webkit-scrollbar,
  body:not(.page-dashboard) .company-grid-container::-webkit-scrollbar,
  body:not(.page-dashboard) .branch-directory-scroll-wrapper::-webkit-scrollbar,
  body:not(.page-dashboard) .table-responsive::-webkit-scrollbar,
  body:not(.page-dashboard) .table-responsive-wrapper::-webkit-scrollbar,
  body:not(.page-dashboard) .main-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  body:not(.page-dashboard) .employee-grid-container::-webkit-scrollbar-track,
  body:not(.page-dashboard) .company-grid-container::-webkit-scrollbar-track,
  body:not(.page-dashboard) .branch-directory-scroll-wrapper::-webkit-scrollbar-track,
  body:not(.page-dashboard) .table-responsive::-webkit-scrollbar-track,
  body:not(.page-dashboard) .table-responsive-wrapper::-webkit-scrollbar-track,
  body:not(.page-dashboard) .main-wrapper::-webkit-scrollbar-track {
    background: transparent;
  }

  body:not(.page-dashboard) .employee-grid-container::-webkit-scrollbar-thumb,
  body:not(.page-dashboard) .company-grid-container::-webkit-scrollbar-thumb,
  body:not(.page-dashboard) .branch-directory-scroll-wrapper::-webkit-scrollbar-thumb,
  body:not(.page-dashboard) .table-responsive::-webkit-scrollbar-thumb,
  body:not(.page-dashboard) .table-responsive-wrapper::-webkit-scrollbar-thumb,
  body:not(.page-dashboard) .main-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  body:not(.page-dashboard) .employee-grid-container::-webkit-scrollbar-thumb:hover,
  body:not(.page-dashboard) .company-grid-container::-webkit-scrollbar-thumb:hover,
  body:not(.page-dashboard) .branch-directory-scroll-wrapper::-webkit-scrollbar-thumb:hover,
  body:not(.page-dashboard) .table-responsive::-webkit-scrollbar-thumb:hover,
  body:not(.page-dashboard) .table-responsive-wrapper::-webkit-scrollbar-thumb:hover,
  body:not(.page-dashboard) .main-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  /* Full-page free-flowing scrollable documents and long form pages */
  body.page-company-profile .main-wrapper,
  body.page-payslip-preview .main-wrapper,
  body.page-monthly-payslip .main-wrapper,
  body.page-support-tickets .main-wrapper,
  body.page-support-\&-help .main-wrapper,
  body.page-support .main-wrapper,
  .main-wrapper:has(#companyProfileForm),
  .main-wrapper:has(#printablePayslipDoc),
  .main-wrapper:has(.payslip-doc),
  .main-wrapper:has(.review-emp-card),
  .main-wrapper:has(.support-page-container) {
    height: calc(100vh - 60px - 38px) !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  body.page-company-profile .main-content,
  body.page-payslip-preview .main-content,
  body.page-monthly-payslip .main-content,
  body.page-support-tickets .main-content,
  body.page-support-\&-help .main-content,
  body.page-support .main-content,
  .main-content:has(#companyProfileForm),
  .main-content:has(#printablePayslipDoc),
  .main-content:has(.payslip-doc),
  .main-content:has(.review-emp-card),
  .main-content:has(.support-page-container) {
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 40px !important;
  }

  /* Manage Branches: Docked top banner (~20%) + smooth scrolling branch directory cards (~80%) */
  body.page-manage-branches .main-wrapper,
  .main-wrapper:has(.branch-directory-scroll-wrapper) {
    height: calc(100vh - 60px - 38px) !important;
    overflow: hidden !important;
  }

  body.page-manage-branches .main-content,
  .main-content:has(.branch-directory-scroll-wrapper) {
    height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding-bottom: 8px !important;
  }

  body.page-manage-branches .branch-directory-scroll-wrapper,
  .branch-directory-scroll-wrapper {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    padding-right: 6px !important;
    padding-bottom: 35px !important;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  body.page-manage-branches .branch-directory-grid {
    overflow: visible !important;
    margin-bottom: 24px !important;
  }

  body.page-company-profile .table-card,
  .table-card:has(#companyProfileForm) {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    flex: none !important;
  }

  #payslipSelectionCard {
    flex: 0 0 auto !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  body.page-support-tickets .admin-support-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  /* Support form scrolling when inside table-card or non-table pages */
  body:not(.page-dashboard) .table-card:not(:has(.table-responsive)):not(:has(.employee-grid-container)):not(:has(.company-grid-container)) {
    overflow-y: auto !important;
  }
  body:not(.page-dashboard) .table-card form {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  body:not(.page-dashboard) .support-page-container {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
  }
}

/* ================= SYSTEM ADMIN COMPANY FILTER (ALL TABS) ================= */
.sysadmin-company-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0 !important;
  margin-right: 2px;
}

.sysadmin-company-filter-wrap label {
  font-size: 9.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1;
  text-transform: uppercase;
  flex-shrink: 0 !important;
}

.sysadmin-company-select {
  height: 25px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
  outline: none;
  cursor: pointer;
  width: 135px !important;
  min-width: 120px !important;
  max-width: 145px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-sizing: border-box;
  flex-shrink: 0 !important;
}

.sysadmin-company-select:hover {
  background-color: #ffffff;
  border-color: #94a3b8;
}

.sysadmin-company-select:focus {
  background-color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

@media (max-width: 992px) {
  /* Ensure main wrapper and content scroll freely on mobile & tablet */
  body:not(.page-dashboard) .main-wrapper {
    height: auto !important;
    overflow-y: visible !important;
  }

  body:not(.page-dashboard) .main-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .branch-directory-scroll-wrapper {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
}

/* ================= DASHBOARD HEADER BAR & ACTIONS ================= */
.dash-header-bar {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  flex-wrap: nowrap !important;
  gap: 16px !important;
  width: 100% !important;
}

.dash-header-title-group {
  min-width: 0 !important;
  flex: 0 1 auto !important;
}

.dash-header-actions {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
  margin-left: auto !important;
}

.dash-header-actions .sysadmin-company-filter-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
  margin: 0 !important;
  width: auto !important;
}

.dash-header-buttons-grid {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
}

.dash-header-buttons-grid button,
.dash-header-buttons-grid .btn-voice-briefing,
.dash-header-buttons-grid #btnDashboardToggleVoice {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

@media (max-width: 768px) {
  .dash-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .dash-header-title-group {
    width: 100% !important;
  }

  .dash-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .dash-header-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .dash-header-buttons-grid button,
  .dash-header-buttons-grid .btn-voice-briefing,
  .dash-header-buttons-grid #btnDashboardToggleVoice {
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 11.5px !important;
    padding: 6px 8px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  .sysadmin-company-filter-wrap {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 2px 0 !important;
  }
  .sysadmin-company-filter-wrap label {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    white-space: nowrap !important;
  }
  .sysadmin-company-select {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    font-size: 13.5px !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
  }
}

@media (max-width: 640px) {
  .employee-grid-container,
  .company-grid-container {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 8px 0 !important;
  }
  .emp-grid-card,
  .company-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}


