/**
 * amhr UI — Color palette extracted from A.M. HR Logo (Draft 6)
 * Dark Forest Green (#1a4731) | Bright Lime Green (#6dbf4e)
 */
:root {
  --vms-navbar: #1a4731;
  --vms-sidebar: #102a1e;
  --vms-sidebar-hover: #1a5c2a;
  --vms-content: #f0f9f4;
  --vms-accent: #6dbf4e;
  --vms-text-dark: #0f172a;
  --vms-border: rgba(0, 0, 0, 0.08);
  --vms-radius-sm: 0.45rem;
  --vms-radius-md: 0.6rem;
  --vms-radius-lg: 0.75rem;
}

/* Fix navbar vertical alignment and spacing */
.navbar-amhr {
  min-height: 52px;
  background-color: var(--vms-navbar) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 0 !important;
}
.navbar-amhr .container-fluid {
  min-height: 52px;
  display: flex;
  align-items: center;
}

.navbar-amhr .navbar-brand {
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
}
.navbar-amhr .amhr-nav-tools-wrap {
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
}
.navbar-amhr .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
}




html {
  scroll-behavior: smooth;
}

body.app-vms {
  min-height: 100vh;
  background: var(--vms-content);
  color: var(--vms-text-dark);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.app-vms-guest {
  min-height: 100vh;
  background: linear-gradient(165deg, #e8f5e0 0%, var(--vms-content) 45%, #dcefd0 100%);
  color: var(--vms-text-dark);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Top navbar (VMS-style) */
.navbar-amhr {
  background-color: var(--vms-navbar) !important;
  border-bottom: 1px solid rgba(0, 105, 62, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.navbar-amhr.sticky-top {
  z-index: 1035;
}

.navbar-amhr .navbar-brand {
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.02em;
}

.navbar-amhr .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.35rem;
}

.navbar-amhr .nav-link:hover {
  background: rgba(255, 255, 255, 0.35);
}

.navbar-amhr .navbar-toggler {
  border-color: rgba(0, 105, 62, 0.25);
}

/* Mobile: keep the expanded menu scrollable instead of filling the viewport */
@media (max-width: 767.98px) {
  .navbar-amhr .navbar-collapse {
    max-height: min(70vh, 28rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   App layout: pure flexbox wrapper (no Bootstrap grid cols)
   ============================================================ */
.amhr-app-wrap {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar-amhr {
  background-color: var(--vms-sidebar);
  padding: 0;
  border-right: 1px solid rgba(0,0,0,0.08);
  width: 225px;
  flex: 0 0 225px;
  min-width: 0;
  overflow-x: hidden;
  position: relative;
  transition: width 0.28s cubic-bezier(.4,0,.2,1), flex-basis 0.28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}

.sidebar-amhr.sidebar-collapsed {
  width: 60px;
  flex-basis: 60px;
}

.sidebar-amhr .sidebar-brand {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.05);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  min-height: 3.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.sidebar-amhr.sidebar-collapsed .sidebar-brand-text,
.sidebar-amhr.sidebar-collapsed .nav-link-text,
.sidebar-amhr.sidebar-collapsed .sidebar-section-label {
  display: none;
}

.sidebar-amhr.sidebar-collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-amhr.sidebar-collapsed .nav-link i {
  margin-right: 0 !important;
  width: auto;
}

.sidebar-amhr .nav-link {
  color: rgba(255,255,255,0.92) !important;
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  border-left: 3px solid transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: background 0.15s, border-left-color 0.15s;
}

.sidebar-amhr .nav-link:hover {
  background: var(--vms-sidebar-hover);
  border-left-color: rgba(255,255,255,0.55);
}

.sidebar-amhr .nav-link.active {
  background: rgba(0,0,0,0.14);
  border-left-color: #fff;
  font-weight: 600;
}

.sidebar-amhr .nav-link i {
  width: 1.25rem;
  opacity: 0.95;
  flex-shrink: 0;
}

.sidebar-amhr .sidebar-user {
  padding: 0.75rem 1rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Sidebar Accordion Groups */
.sidebar-accordion .sidebar-group {
  margin-bottom: 0.25rem;
}

.sidebar-group-header {
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.65) !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.4rem !important;
  cursor: pointer;
  transition: color 0.2s;
}

.sidebar-group-header:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.03);
}

.sidebar-chevron {
  font-size: 0.7rem;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  opacity: 0.5;
}

.sidebar-group-header[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Sub-links in sidebar */
.sidebar-group .collapse .nav-link {
  padding-left: 2.25rem !important;
  font-size: 0.85rem;
  opacity: 0.85;
}

.sidebar-group .collapse .nav-link:hover {
  opacity: 1;
}

.sidebar-group .collapse .nav-link.active {
  opacity: 1;
  background: rgba(255,255,255,0.12);
}

/* Hide groups when collapsed */
.sidebar-amhr.sidebar-collapsed .sidebar-group-header {
  justify-content: center;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.sidebar-amhr.sidebar-collapsed .sidebar-group-header .sidebar-chevron,
.sidebar-amhr.sidebar-collapsed .sidebar-group-header .nav-link-text {
  display: none;
}

.sidebar-amhr.sidebar-collapsed .collapse {
  height: 0 !important;
  display: none !important; /* Keep this for pure mini mode, but JS will remove .sidebar-collapsed */
}

/* Ensure no horizontal scroll during transition */
.sidebar-amhr {
  overflow-x: hidden;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  background: rgba(255,255,255,0.05);
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.28s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle-btn:hover { 
  background: rgba(255,255,255,0.15); 
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sidebar-amhr.sidebar-collapsed .sidebar-toggle-btn { transform: rotate(180deg); }

/* Tooltip on collapsed sidebar items */
.sidebar-amhr.sidebar-collapsed .nav-link[title] { position: relative; }
.sidebar-amhr.sidebar-collapsed .nav-link[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 50%; transform: translateY(-50%);
  background: rgba(20,30,20,0.95);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Main content */
.main-amhr {
  flex: 1 1 0;
  min-width: 0;
  background: var(--vms-content);
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 2rem;
}

@media (min-width: 768px) {
  .main-amhr { padding: 1.5rem 1.75rem 2rem; }
}

/* ============================================================
   Mobile accordion nav groups
   ============================================================ */
.mobile-nav-accordion { padding-bottom: 0.5rem; }

.mnav-group { margin-bottom: 0.15rem; }

.mnav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 1rem;
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.12) 0%, rgba(5, 150, 105, 0.03) 100%);
  border: none;
  border-radius: 0.4rem;
  color: var(--vms-text-dark);
  font-weight: 700;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s;
}
.mnav-group-header:hover {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.2) 0%, rgba(5, 150, 105, 0.06) 100%);
}
.mnav-group-header--hr {
  background: linear-gradient(90deg, rgba(6, 32, 22, 0.1) 0%, rgba(6, 32, 22, 0.02) 100%);
}
.mnav-group-header--hr:hover {
  background: linear-gradient(90deg, rgba(6, 32, 22, 0.15) 0%, rgba(6, 32, 22, 0.04) 100%);
}
.mnav-group-header--premium {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, rgba(212, 175, 55, 0.03) 100%);
}
.mnav-group-header--premium:hover {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.06) 100%);
}

.mnav-chevron {
  font-size: 0.7rem;
  opacity: 0.5;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), opacity 0.2s;
  flex-shrink: 0;
}
.mnav-group-header[aria-expanded="true"] .mnav-chevron {
  transform: rotate(180deg);
  opacity: 0.85;
}

.mnav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 1rem 0.48rem 1.65rem;
  color: var(--vms-text-dark) !important;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0.35rem;
  transition: background 0.14s;
  white-space: nowrap;
}
.mnav-link i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.7;
  flex-shrink: 0;
  font-size: 0.84rem;
}
.mnav-link:hover { background: rgba(15, 23, 42, 0.05); color: var(--vms-accent) !important; }
.mnav-link:hover i { opacity: 1; }
.mnav-link.active { background: rgba(0,105,62,0.12); color: var(--vms-accent) !important; font-weight: 600; }
.mnav-link.active i { opacity: 1; }



@media (min-width: 768px) {
  .main-amhr {
    padding: 1.5rem 1.75rem 2rem;
  }
}

.content-header-amhr {
  margin-bottom: 1rem;
}

.content-header-amhr h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--vms-text-dark);
  margin: 0;
}

.content-header-amhr p.lead {
  font-size: 0.95rem;
  color: #3d5c3d;
  margin: 0.35rem 0 0;
}

@media (max-width: 767.98px) {
  .content-header-amhr h1 {
    font-size: 1.2rem;
  }
  .content-header-amhr p.lead {
    font-size: 0.8rem;
  }
  .card-amhr .card-body {
    padding: 0.85rem !important;
  }
  .main-amhr {
    padding: 1rem 0.75rem 2rem;
  }
}

/* Cards */
.card-amhr {
  background: #fff;
  border: 1px solid var(--vms-border);
  border-radius: var(--vms-radius-lg);
  box-shadow: 0 6px 18px rgba(0, 45, 30, 0.07);
}

.card-amhr .card-header {
  background: rgba(166, 207, 152, 0.25);
  border-bottom: 1px solid var(--vms-border);
  font-weight: 600;
  color: var(--vms-text-dark);
}

/* Tables */
.table-amhr {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--vms-radius-md);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  background: #fff;
}

.table-amhr thead th {
  background: linear-gradient(180deg, #f8faf9 0%, #edf2ed 100%);
  color: #344934;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #d9e5d9;
  border-top: none;
}

.table-amhr tbody td {
  border-bottom: 1px solid #f0f4f0;
  padding: 1.1rem 1.25rem;
  vertical-align: middle;
  color: #2c3e2c;
  transition: all 0.2s ease;
}

.table-amhr tbody tr:last-child td {
  border-bottom: none;
}

.table-amhr tbody tr:nth-child(even) td {
  background: rgba(166, 207, 152, 0.04);
}

.table-amhr.table-hover tbody tr:hover td {
  background: rgba(0, 105, 62, 0.06) !important;
  color: #004d2e;
}

/* Professional admin table variant */
.table-amhr.table-pro {
  font-size: 0.84rem;
}

.table-amhr.table-pro thead th {
  background: #f8faf8;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.74rem;
  border-bottom: 1.5px solid #e2eee2;
  color: #4b5f4b;
  white-space: nowrap;
}

.table-amhr.table-pro tbody td {
  border-bottom: 1px solid #f1f7f1;
  padding: 1.1rem 1.25rem;
}

.table-amhr.table-pro tbody tr:nth-child(even) td {
  background: #fcfdfc;
}

.table-amhr.table-pro.table-hover tbody tr:hover td {
  background: #f0f7f2 !important;
}

/* Status Badges & Chips inside tables */
.table-amhr .badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.table-amhr .amount-cell {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* DataTables polish for all app tables */
div.dataTables_wrapper div.dataTables_length select {
  border-radius: var(--vms-radius-sm);
  border: 1px solid rgba(85, 124, 85, 0.35);
  min-width: 5.2rem;
}

div.dataTables_wrapper div.dataTables_filter input {
  border-radius: var(--vms-radius-md);
  border: 1px solid rgba(85, 124, 85, 0.35);
  padding: 0.35rem 0.8rem;
  min-width: 14rem;
}

div.dataTables_wrapper div.dataTables_filter input:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 105, 62, 0.12);
  border-color: rgba(0, 105, 62, 0.45);
}

.dataTables_wrapper .dataTables_info {
  color: #476247;
  font-size: 0.82rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--vms-radius-sm) !important;
  border: 1px solid transparent !important;
  margin: 0 0.12rem;
}

/* Tone down overly circular controls for a cleaner look */
.btn,
.form-control,
.form-select,
.input-group-text,
.badge {
  border-radius: var(--vms-radius-sm);
}

.btn.rounded-pill,
.badge.rounded-pill {
  border-radius: var(--vms-radius-md) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(0, 105, 62, 0.08) !important;
  border-color: rgba(0, 105, 62, 0.18) !important;
  color: #18512f !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #00693e !important;
  border-color: #00693e !important;
  color: #fff !important;
}

.btn-amhr-primary {
  background-color: var(--vms-accent);
  border-color: var(--vms-accent);
  color: #fff;
  font-weight: 600;
}

.btn-amhr-primary:hover {
  background-color: #005530;
  border-color: #005530;
  color: #fff;
}

.badge-slot {
  background: rgba(0, 105, 62, 0.12);
  color: var(--vms-accent);
  border: 1px solid rgba(0, 105, 62, 0.25);
}

.alert-amhr-info {
  background: rgba(166, 207, 152, 0.35);
  border: 1px solid rgba(85, 124, 85, 0.35);
  color: var(--vms-text-dark);
  font-size: 0.875rem;
}

/* Guest auth card */
.guest-card {
  max-width: 420px;
  margin: 2rem auto;
  border: 1px solid var(--vms-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Lightbox modals (captures page) */
.amhr-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.88);
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.amhr-modal.show-flex {
  display: flex;
}
.amhr-modal-inner {
  background: #fff;
  border-radius: 0.5rem;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1rem;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.amhr-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  border: none;
  background: none;
}
.amhr-modal-close:hover {
  color: #0f172a;
}
.amhr-map-box {
  width: 100%;
  height: 320px;
  border-radius: 0.35rem;
}

/* Navbar announcement notifications */
.dropdown-toggle-no-caret::after {
  display: none !important;
}

.nav-announce-pill {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62rem;
  padding: 0.2em 0.45em;
}

.nav-announce-dot {
  font-size: 0.58rem;
  padding: 0.2em 0.38em;
  line-height: 1;
}

.nav-notify-menu {
  min-width: min(320px, calc(100vw - 2rem));
  max-height: 70vh;
  overflow-y: auto;
}

.sidebar-amhr .nav-link.position-relative {
  padding-right: 2.25rem !important;
}

/* Toast stack: full-width below sticky navbar on phones; top-right on desktop */
.amhr-toast-host {
  z-index: 1070;
  left: 0;
  right: 0;
  top: calc(3.45rem + env(safe-area-inset-top, 0px));
  padding: 0.35rem 0.65rem 0.35rem;
  max-width: none;
  width: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.amhr-toast-host .toast {
  pointer-events: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .amhr-toast-host {
    left: auto;
    top: calc(3.65rem + env(safe-area-inset-top, 0px));
    right: 0.5rem;
    width: auto;
    max-width: min(100vw - 1.5rem, 22rem);
    align-items: flex-end;
    padding-top: 0.25rem;
  }

  .amhr-toast-host .toast {
    width: 100%;
    min-width: min(20rem, calc(100vw - 2rem));
  }
}

/* Top navbar: keep bell + toggler aligned on narrow screens */
.amhr-nav-tools-wrap {
  max-width: calc(100vw - 8rem);
}

.amhr-unread-num {
  min-width: 1.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.28em 0.45em;
}

.amhr-announce-toast {
  border-radius: 0.65rem !important;
  overflow: hidden;
}

.amhr-toast-header {
  background: linear-gradient(90deg, #d8f3dc 0%, #f8fff5 100%) !important;
}
/* Notification Dropdown Utilities */
.nav-notify-menu {
  width: 320px;
  max-width: 90vw;
  margin-top: 0.5rem;
}

@media (max-width: 575.98px) {
  .nav-notify-menu {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 60px !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 30px) !important;
    max-width: 350px !important;
    margin: 0 !important;
  }
}

.nav-notify-scroll::-webkit-scrollbar {
  width: 6px;
}
.nav-notify-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}
.nav-notify-menu .dropdown-item:hover {
  background-color: rgba(166, 207, 152, 0.15);
}
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bg-opacity-10 {
  --bs-bg-opacity: 0.1;
}

.pulse-badge { animation: pulse-animation 2s infinite; }
@keyframes pulse-animation { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }

/* Preloader */
#amhr-preloader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease-out, visibility 0.4s;
}

#amhr-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(26, 71, 49, 0.1);
  border-top-color: var(--vms-navbar);
  border-radius: 50%;
  animation: amhr-spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes amhr-spin {
  to { transform: rotate(360deg); }
}

.preloader-logo {
  height: 48px;
  width: auto;
  margin-bottom: 1rem;
  animation: amhr-pulse 1.5s ease-in-out infinite;
}

@keyframes amhr-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}
