/* HRMS Pro - Modern Glassmorphism & Executive Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #1b56a3;
  --primary-hover: #133966;
  --primary-light: #e8f1fc;
  --secondary: #256fc8;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --dark: #0f233f;
  --dark-surface: #172b4d;
  --dark-sidebar: #0d1e38;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8fafc;
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Sidebar Styles - Modern Light Navy Multi-Shade Theme */
.sidebar {
  width: 255px;
  background: linear-gradient(180deg, #f0f6fd 0%, #e6effa 40%, #dbe8f8 80%, #d1e2f5 100%);
  color: var(--slate-800);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #cadbf2;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden; /* Container itself never scrolls; header & footer stay permanently pinned */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  box-shadow: 4px 0 25px rgba(27, 86, 163, 0.05);
}

.sidebar-header {
  flex-shrink: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #d4e3f7;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1b56a3 0%, #256fc8 50%, #3b8fe0 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 111, 200, 0.35);
  flex-shrink: 0;
}

.brand-text h2 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f2b48;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1b56a3;
  background: #e0ecfb;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid #bad4f5;
  display: inline-block;
  margin-top: 1px;
}

.sidebar-menu {
  padding: 6px 10px;
  flex: 1 1 auto;
  min-height: 0; /* Crucial: allows flex child to scroll cleanly if needed */
  overflow-y: auto; /* Only navigation links scroll if viewport is extremely short */
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: #bad4f5 transparent;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}
.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: #bad4f5;
  border-radius: 10px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: #93c5fd;
}

.menu-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #527499;
  font-weight: 800;
  padding: 6px 8px 2px;
  margin-top: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5.5px 10px;
  border-radius: 8px;
  color: #2c486d;
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 600;
  line-height: 1.3;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
}

.nav-link:focus {
  outline: none;
}

.nav-link:focus-visible {
  outline: 2px solid #256fc8;
  outline-offset: -2px;
}

.nav-link:hover {
  color: #0f2b48;
  background: #e1ecfb;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(37, 111, 200, 0.08);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #133966 0%, #1a4d8c 45%, #256fc8 100%);
  font-weight: 700;
  box-shadow: 0 4px 14px -2px rgba(27, 86, 163, 0.35);
  transform: translateX(0);
}

.nav-link svg,
.nav-link i {
  flex-shrink: 0;
  width: 17px !important;
  height: 17px !important;
  color: #49729f;
  transition: transform 0.2s, color 0.2s;
}

.nav-link:hover svg,
.nav-link:hover i {
  color: #1b56a3;
  transform: scale(1.08);
}

.nav-link.active svg,
.nav-link.active i {
  color: #ffffff;
  opacity: 1;
  transform: scale(1.05);
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 8px 10px;
  border-top: 1px solid #d4e3f7;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  z-index: 2;
}

.user-card-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #cadcf5;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(27, 86, 163, 0.06);
  transition: all 0.2s ease;
}

.user-card-mini.active {
  border-color: #256fc8;
  background: #eef5fc;
  box-shadow: 0 4px 14px rgba(37, 111, 200, 0.18);
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 700;
  font-size: 0.80rem;
  color: #0f2b48;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.65rem;
  color: #1b56a3;
  background: #e8f1fc;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  text-transform: capitalize;
  margin-top: 1px;
}

.user-card-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: all 0.2s ease;
}

.user-card-link:hover {
  background: rgba(224, 236, 251, 0.6);
}

.user-card-link:hover .user-name {
  color: #1b56a3;
}

.user-card-link:hover .avatar-initial {
  transform: scale(1.05);
}

.sidebar-logout-btn {
  color: #6482a6;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.sidebar-logout-btn svg,
.sidebar-logout-btn i {
  width: 16px !important;
  height: 16px !important;
}

.avatar-initial {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1b56a3 0%, #256fc8 50%, #3b8fe0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 111, 200, 0.25);
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #f8fafc;
}

/* Navbar */
.top-navbar {
  height: 72px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.header-brand-wrap:hover {
  opacity: 0.88;
}

.header-brand-img {
  height: 36px;
  max-width: 150px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}

.header-brand-name {
  font-size: 0.90rem;
  font-weight: 800;
  color: #0f2b48;
  letter-spacing: -0.02em;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #1b56a3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.header-nav-divider {
  height: 24px;
  width: 1px;
  background: #cadbf2;
  margin: 0 2px;
}

.page-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 5px 12px;
  background: #e8f1fc;
  border: 1px solid #d4e5f9;
  border-radius: 9999px;
  color: #163f78;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Navbar User Profile Dropdown */
.navbar-user-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #cadbf2;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(27, 86, 163, 0.05);
  transition: all 0.2s ease;
}

.navbar-user-menu-wrap:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(27, 86, 163, 0.1);
}

.navbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 10px;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  border-radius: 9px 0 0 9px;
  transition: background 0.15s ease;
}

.navbar-user-btn:hover {
  background: #f0f6fd;
}

.navbar-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f2b48;
}

.navbar-dropdown-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid #dbe8f8;
  padding: 8px 8px;
  cursor: pointer;
  color: #6482a6;
  outline: none;
  border-radius: 0 9px 9px 0;
  transition: all 0.2s ease;
}

.navbar-dropdown-toggle-btn:hover,
.navbar-dropdown-toggle-btn.active {
  background: #f0f6fd;
  color: #1b56a3;
}

.navbar-dropdown-toggle-btn.active svg,
.navbar-dropdown-toggle-btn.active i {
  transform: rotate(180deg);
}

.navbar-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid #cadbf2;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(27, 86, 163, 0.16);
  padding: 8px;
  z-index: 100;
}

.navbar-user-dropdown.show {
  display: block !important;
  animation: fadeInDown 0.18s ease-out;
}

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

.user-dropdown-header {
  padding: 10px 12px;
  background: linear-gradient(135deg, #f0f6fd 0%, #e6effa 100%);
  border-radius: 10px;
  border: 1px solid #d8e5f7;
}

.user-dropdown-name {
  font-weight: 800;
  font-size: 0.86rem;
  color: #0f2b48;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 0.72rem;
  color: #527499;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background: #e6effa;
  margin: 6px 0;
}

.user-dropdown-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2c486d;
  text-decoration: none;
  transition: all 0.15s ease;
}

.user-dropdown-item i,
.user-dropdown-item svg {
  width: 16px !important;
  height: 16px !important;
  color: #527499;
  transition: color 0.15s ease;
}

.user-dropdown-item:hover {
  background: #f0f6fd;
  color: #1b56a3;
  transform: translateX(2px);
}

.user-dropdown-item:hover i,
.user-dropdown-item:hover svg {
  color: #1b56a3;
}

.user-dropdown-logout {
  color: #dc2626 !important;
}

.user-dropdown-logout i,
.user-dropdown-logout svg {
  color: #dc2626 !important;
}

.user-dropdown-logout:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

/* Content Container */
.page-body {
  padding: 32px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-heading h1 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}

.page-heading p {
  font-size: 0.9rem;
  color: var(--slate-500);
  margin-top: 4px;
}

/* Flash Messages */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

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

/* Dashboard Split & Grid Utilities */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.primary { background: #eef2ff; color: #4f46e5; }
.stat-icon.success { background: #ecfdf5; color: #10b981; }
.stat-icon.warning { background: #fffbeb; color: #f59e0b; }
.stat-icon.info { background: #f0f9ff; color: #0284c7; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-info .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
}

.stat-info .stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-info .stat-desc {
  font-size: 0.8rem;
  color: var(--slate-400);
  margin-top: 4px;
}

/* Modern Card Component */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.table-custom th {
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--slate-200);
}

.table-custom td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.88rem;
  color: var(--slate-700);
  vertical-align: middle;
}

.table-custom tr:last-child td {
  border-bottom: none;
}

.table-custom tbody tr {
  transition: background-color 0.15s ease;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-primary { background: #e0e7ff; color: #4338ca; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #133966 0%, #1a4d8c 45%, #256fc8 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(27, 86, 163, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f2d52 0%, #164278 45%, #1f60af 100%);
  box-shadow: 0 4px 14px rgba(27, 86, 163, 0.38);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.btn-secondary:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-300);
  background-color: #ffffff;
  color: var(--slate-800);
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleUp 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Digital ID Card Styles - Modern Light Navy Multi-Shade Theme */
.id-card-stage {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  margin: 8px auto 16px;
  max-width: 720px;
}

.id-badge-card {
  width: 310px;
  height: 452px;
  background: linear-gradient(168deg, #ffffff 0%, #f4f8fe 26%, #e2eefa 66%, #cadff7 100%);
  border-radius: 16px;
  border: 1.5px solid #bdd6f5;
  box-shadow: 0 16px 36px rgba(27, 86, 163, 0.12), 0 4px 12px rgba(27, 86, 163, 0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
  flex-shrink: 0;
}

.id-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(27, 86, 163, 0.18), 0 6px 16px rgba(27, 86, 163, 0.08);
}

.badge-lanyard-slot {
  width: 44px;
  height: 7px;
  border-radius: 4px;
  background: #cbdff8;
  border: 1.5px solid #9fc1ed;
  margin: 7px auto 5px;
  box-shadow: inset 0 2px 4px rgba(15, 43, 72, 0.2);
  flex-shrink: 0;
}

.badge-header-band {
  background: linear-gradient(135deg, #102e52 0%, #17457a 45%, #1e5ba3 80%, #2873c2 100%);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #38bdf8;
  box-shadow: 0 3px 10px rgba(16, 46, 82, 0.25);
  flex-shrink: 0;
}

.badge-company-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
  line-height: 1.15;
}

.badge-company-sub {
  font-size: 0.58rem;
  color: #bae6fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}

.badge-body {
  padding: 8px 12px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.badge-photo-wrap {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 4px;
  flex-shrink: 0;
}

.badge-photo-img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(27, 86, 163, 0.22);
  display: block;
}

.badge-photo-initial {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b56a3 0%, #256fc8 50%, #3b8fe0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(27, 86, 163, 0.22);
}

.badge-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 6px #10b981;
}

.badge-name-block {
  text-align: center;
  margin-bottom: 4px;
}

.badge-emp-name {
  font-size: 1.10rem;
  font-weight: 800;
  color: #0f2b48;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.badge-emp-desig {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1b56a3;
  margin-top: 2px;
}

.badge-emp-dept {
  font-size: 0.65rem;
  font-weight: 600;
  color: #527499;
  margin-top: 1px;
}

.badge-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 5px;
}

.badge-meta-grid {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #cadbf2;
  border-radius: 9px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 5px;
}

.badge-meta-item span {
  font-size: 0.56rem;
  text-transform: uppercase;
  color: #6482a6;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: block;
  line-height: 1;
}

.badge-meta-item strong {
  font-size: 0.74rem;
  color: #0f2b48;
  font-weight: 800;
  display: block;
  margin-top: 2px;
}

.badge-barcode-footer {
  background: rgba(255, 255, 255, 0.75);
  border-top: 1px dashed #cadbf2;
  padding: 4px 10px 5px;
  text-align: center;
  flex-shrink: 0;
}

.badge-barcode-bars {
  letter-spacing: 3.5px;
  font-size: 1.05rem;
  font-family: monospace;
  font-weight: 900;
  color: #154275;
  line-height: 1;
}

.badge-barcode-caption {
  font-size: 0.55rem;
  color: #6482a6;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* Badge Back Side Styles */
.badge-back-terms {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #cadbf2;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 0.62rem;
  color: #334e68;
  line-height: 1.3;
  margin-bottom: 6px;
}

.badge-qr-section {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cadbf2;
  border-radius: 9px;
  padding: 6px 9px;
  margin-bottom: 6px;
}

.badge-signature-line {
  border-bottom: 1.5px solid #6482a6;
  width: 120px;
  margin: 6px auto 2px;
  font-family: 'Brush Script MT', cursive, sans-serif;
  font-size: 0.95rem;
  color: #1b56a3;
  text-align: center;
}

/* Printable Payslip */
.payslip-container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

@media print {
  .sidebar, .top-navbar, .page-header, .no-print {
    display: none !important;
  }
  .main-content {
    background: #fff !important;
  }
  .page-body {
    padding: 0 !important;
  }
  .payslip-container {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  display: none;
}

/* Sidebar Mobile Backdrop Overlay */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 43, 72, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Bottom Navigation Bar (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid #cadbf2;
  box-shadow: 0 -4px 20px rgba(27, 86, 163, 0.08);
  z-index: 999;
  padding: 0 10px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 1;
  height: 100%;
  color: #6482a6;
  position: relative;
  transition: all 0.2s ease;
  padding: 4px 0 2px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-icon-box {
  width: 38px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-icon-box svg,
.mobile-nav-icon-box i {
  width: 20px !important;
  height: 20px !important;
  color: #6482a6;
  transition: all 0.2s ease;
}

.mobile-nav-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 2px;
  transition: color 0.2s ease;
}

.mobile-nav-link:hover .mobile-nav-text,
.mobile-nav-link:hover .mobile-nav-icon-box svg {
  color: #1b56a3;
}

.mobile-nav-link.active {
  color: #1b56a3;
}

.mobile-nav-link.active .mobile-nav-icon-box {
  background: linear-gradient(135deg, #e0ecfb 0%, #d4e5f9 100%);
  box-shadow: 0 2px 8px rgba(27, 86, 163, 0.18);
  transform: translateY(-2px);
}

.mobile-nav-link.active .mobile-nav-icon-box svg,
.mobile-nav-link.active .mobile-nav-icon-box i {
  color: #1b56a3;
}

.mobile-nav-link.active .mobile-nav-text {
  color: #0f2b48;
  font-weight: 800;
}

.mobile-nav-active-pill {
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, #1b56a3, #38bdf8);
  border-radius: 0 0 3px 3px;
}

/* ========================================================
   RESPONSIVE DESIGN BREAKPOINTS (Mobile & Tablet)
   ======================================================== */
@media (max-width: 992px) {
  /* Reserve space for fixed bottom bar on mobile */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Show Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex !important;
  }

  /* Sidebar Drawer on Mobile / Tablet */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -270px !important;
    width: 260px !important;
    z-index: 1050 !important;
    box-shadow: 10px 0 35px rgba(15, 43, 72, 0.25) !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .sidebar.open {
    left: 0 !important;
  }

  /* Show hamburger button on mobile */
  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 8px !important;
    border-radius: 8px !important;
    margin-right: 4px !important;
  }

  /* Top Navbar layout adjustments */
  .top-navbar {
    height: 60px !important;
    padding: 0 14px !important;
  }

  .header-brand-img {
    height: 28px !important;
    max-width: 120px !important;
  }

  .header-brand-name {
    font-size: 0.82rem !important;
    max-width: 130px !important;
  }

  .header-nav-divider,
  .page-title-badge {
    display: none !important;
  }

  .navbar-right {
    gap: 8px !important;
  }

  .navbar-right .btn span {
    display: none !important; /* Icon-only buttons */
  }

  /* Page Content Container */
  .page-body {
    padding: 16px 12px 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Page Header stack */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .page-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* Grid collapses to 1 column */
  .dashboard-split-grid,
  div[style*="grid-template-columns: 1fr 1fr"],
  .form-grid-2, 
  .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
  }

  /* User Profile Grid Collapse */
  div[style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Digital ID Card Stage on Mobile */
  .id-card-stage {
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
  }

  .id-badge-card {
    max-width: 95vw !important;
  }

  /* Responsive Tables Wrapper */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  table {
    min-width: 460px;
  }
}

@media (max-width: 640px) {
  /* Extra-small mobile screens */
  .top-navbar {
    padding: 0 10px !important;
    height: 56px !important;
  }

  .header-nav-divider,
  .header-nav-divider-v,
  .page-title-badge,
  .header-brand-badge {
    display: none !important;
  }

  .navbar-left {
    gap: 6px !important;
  }

  .header-brand-wrap {
    gap: 6px !important;
  }

  .header-brand-img {
    height: 26px !important;
    max-width: 90px !important;
  }

  /* Hide company text next to logo on mobile phones to prevent header overflow */
  .header-brand-text {
    display: none !important;
  }

  .navbar-right {
    gap: 6px !important;
  }

  /* Compact quick actions on mobile header */
  .navbar-right .btn {
    padding: 6px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Icon-only for navbar right buttons on mobile to avoid overflow */
  .navbar-right .btn span {
    display: none !important;
  }

  .navbar-user-name,
  .navbar-dropdown-toggle-btn {
    display: none !important; /* Hide chevron & name: avatar is touch target */
  }

  .navbar-user-btn {
    padding: 2px !important;
    border-radius: 8px !important;
  }

  .navbar-user-menu-wrap {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .navbar-user-dropdown {
    position: fixed !important;
    top: 58px !important;
    right: 8px !important;
    left: auto !important;
    width: 250px !important;
    max-width: calc(100vw - 16px) !important;
  }

  .btn {
    padding: 7px 12px !important;
    font-size: 0.80rem !important;
  }

  .page-heading h1 {
    font-size: 1.22rem !important;
  }

  .page-heading p {
    font-size: 0.78rem !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
  }

  .stat-card {
    padding: 16px 18px !important;
    border-radius: 12px !important;
  }

  .stat-info .stat-label {
    font-size: 0.72rem !important;
  }

  .stat-info .stat-value {
    font-size: 1.45rem !important;
    margin: 3px 0 !important;
  }

  .stat-info .stat-desc {
    font-size: 0.72rem !important;
  }

  .stat-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
  }

  .stat-icon i,
  .stat-icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  .card-body {
    padding: 16px !important;
  }

  /* Modal responsive constraints */
  .modal-dialog {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    margin: 10px auto !important;
    padding: 14px !important;
  }
}

@media (max-width: 380px) {
  .top-navbar {
    padding: 0 6px !important;
  }
  .navbar-left {
    gap: 4px !important;
  }
  .navbar-right {
    gap: 4px !important;
  }
  .page-body {
    padding: 12px 8px 24px !important;
  }
  .stat-card {
    padding: 14px 12px !important;
  }
}
