body {
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: #f3f4f8;
}

a,
a:hover,
a:focus,
a:active,
.nav-link {
  text-decoration: none !important;
  border-bottom: none !important;
}

.eg-topbar {
  background: linear-gradient(135deg, #4a1a9e 0%, #3c0f85 52%, #2f0d6e 100%);
  color: #ffffff;
  padding: 0.45rem 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.eg-topbar-login {
  padding: 0.6rem 1rem;
}

.eg-system-logo {
  width: 30px;
  height: auto;
  display: block;
  object-fit: contain;
}

.eg-system-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: transform 0.25s ease;
  transform-origin: left center;
}

.eg-system-brand:hover {
  animation: egBrandHoverPop 0.45s ease;
  transform: scale(1.08);
}

@keyframes egBrandHoverPop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1.08);
  }
}

.eg-system-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.eg-system-wordmark-top {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
}

.eg-system-wordmark-bottom {
  font-size: 0.66rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

/* Employee app — compact, balanced header (reference: solid purple) */
.eg-topbar--employee {
  padding: 0;
  background: #3b2374;
  background-image: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.eg-topbar--employee .eg-topbar-inner {
  max-width: none;
  margin: 0;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.eg-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem 1rem;
  min-height: 56px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}


@media (min-width: 992px) {
  .eg-topbar-inner {
    padding: 0.45rem 1.5rem;
  }
}

.eg-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
  color: inherit !important;
  flex-shrink: 0;
  min-width: 0;
}

.eg-topbar-brand:hover .eg-topbar-title {
  color: #ffffff;
}

.eg-topbar-wordmark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
  text-align: left;
}

.eg-topbar-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.eg-topbar-tagline {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 0.05rem;
}

.eg-topbar-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.eg-topbar-wordmark--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  line-height: 1.2;
}

.eg-topbar-title-rest {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eg-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
  color: inherit !important;
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  margin: 0;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.eg-topbar-user:hover {
  background: rgba(255, 255, 255, 0.12);
}

.eg-topbar-user:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.eg-topbar-greeting {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}

@media (max-width: 400px) {
  .eg-topbar-greeting {
    display: none;
  }

  .eg-topbar-user {
    padding: 0.2rem;
  }
}

.eg-avatar-circle--header {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: linear-gradient(145deg, #faf5ff 0%, #ede9fe 100%);
  align-self: center;
}

.eg-topbar-avatar-fallback {
  font-size: 1.2rem;
  color: #5b21b6;
  opacity: 0.9;
}

/* Thin bar under employee header (e.g. profile back link) */
.eg-subbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.eg-subbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}

@media (min-width: 992px) {
  .eg-subbar-inner {
    padding: 0.5rem 1.5rem;
  }
}

.eg-back-link--bar {
  margin-bottom: 0;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  border-radius: 999px;
}

.eg-logo-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #3c0f85;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.eg-topbar--employee .eg-logo-box {
  width: 40px;
  height: 40px;
  font-size: 19px;
  flex-shrink: 0;
}

.eg-wordmark-top {
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

.eg-wordmark-bottom {
  font-size: 0.7rem;
  opacity: 0.85;
}

.eg-hero-title {
  font-weight: 800;
  font-size: 1.8rem;
}

.eg-hero-highlight {
  color: #6f2cff;
}

.eg-hero-subtitle {
  font-size: 0.95rem;
}

.eg-hero-login-btn {
  border-radius: 999px;
  background-color: #6f2cff;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.eg-hero-login-btn:hover {
  background-color: #5b22d1;
  color: #ffffff;
}

.eg-login-card {
  background-color: #ffffff;
  border-radius: 4px;
  border: 1px solid #d6d6d6;
  padding: 3rem 3.5rem;
}

.eg-login-title {
  font-weight: 800;
}

.eg-login-btn {
  border-radius: 999px;
  border: 1px solid #000000;
  background-color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.eg-login-btn:hover {
  background-color: #f3f3f3;
}

.eg-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f3e5ff;
}

.eg-sidebar {
  min-height: calc(100vh - 56px);
  padding: 1rem 0.75rem;
}

.eg-sidebar-brand {
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.eg-sidebar-link,
.eg-sidebar-link:hover,
.eg-sidebar-link:focus,
.eg-sidebar-link span {
  text-decoration: none !important;
  border-bottom: none !important;
}

.eg-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  margin-bottom: 0.4rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.eg-sidebar-link i {
  font-size: 1.15rem;
  width: 1.25rem;
  flex-shrink: 0;
}

/* SuperAdmin sidebar - blue theme */
.eg-sidebar-superadmin {
  background-color: #eff6ff;
  border-right: 1px solid #dbeafe;
}

.eg-sidebar-superadmin .eg-sidebar-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1d4ed8;
  font-weight: 600;
}

.eg-sidebar-superadmin .eg-sidebar-link {
  color: #1e3a8a;
}

.eg-sidebar-superadmin .eg-sidebar-link i {
  color: #2563eb;
}

.eg-sidebar-superadmin .eg-sidebar-link:hover {
  background-color: #dbeafe;
}

.eg-sidebar-superadmin .eg-sidebar-link.active {
  background-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.eg-sidebar-superadmin .eg-sidebar-link.active i {
  color: #ffffff;
}

/* Office Admin sidebar - blue theme */
.eg-sidebar-admin {
  background-color: #eff6ff;
  border-right: 1px solid #dbeafe;
}

.eg-sidebar-admin .eg-sidebar-role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1d4ed8;
  font-weight: 600;
}

.eg-sidebar-admin .eg-sidebar-link {
  color: #1e3a8a;
}

.eg-sidebar-admin .eg-sidebar-link i {
  color: #2563eb;
}

.eg-sidebar-admin .eg-sidebar-link:hover {
  background-color: #dbeafe;
}

.eg-sidebar-admin .eg-sidebar-link.active {
  background-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}

.eg-sidebar-admin .eg-sidebar-link.active i {
  color: #ffffff;
}

/* Logout - red/destructive */
.eg-sidebar-link-danger {
  color: #d13438 !important;
}

.eg-sidebar-link-danger i {
  color: #d13438 !important;
}

.eg-sidebar-link-danger:hover {
  background-color: #fef2f2 !important;
}

.eg-sidebar-link-danger.active,
.eg-sidebar-link-danger.active i {
  color: #ffffff !important;
}

/* Employee nav (pill style, no underline) */
.eg-employee-nav {
  display: inline-flex;
  gap: 0.5rem;
}

.eg-employee-nav-link,
.eg-employee-nav-link:hover,
.eg-employee-nav-link span {
  text-decoration: none !important;
  border-bottom: none !important;
}

.eg-employee-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background-color: #e5e7eb;
  color: #374151;
  font-weight: 500;
  font-size: 0.9rem;
}

.eg-employee-nav-link i {
  font-size: 1rem;
}

.eg-employee-nav-link.active {
  background-color: #10b981;
  color: #ffffff;
}

.eg-employee-nav-link-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.eg-employee-nav-link-danger i {
  color: #b91c1c;
}

.eg-employee-nav-link-danger:hover {
  background-color: #fecaca;
  color: #991b1b;
}

.eg-metric-card {
  background-color: #ffffff;
  border-radius: 1.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.eg-panel {
  background-color: #ffffff;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.eg-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.eg-dot-gray {
  background-color: #d3d3d3;
}

.eg-dot-green {
  background-color: #25c63a;
}

.eg-dot-red {
  background-color: #f44336;
}

.eg-dot-yellow {
  background-color: #ffeb3b;
}

.eg-employee-card {
  background-color: #ffffff;
  border-radius: 1.25rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Keep avatar circular when the name/email block is tall (flex row + narrow columns) */
.eg-employee-card .d-flex.align-items-center>.eg-avatar-circle {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  box-sizing: border-box;
}

/* Prevent long name/email/position text from overflowing employee cards on mobile */
.eg-employee-card .flex-grow-1 {
  min-width: 0;
}

.eg-employee-card .fw-semibold,
.eg-employee-card .text-muted.small,
.eg-employee-card .badge + .text-muted.small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Employee profile / settings page */
.eg-profile-page {
  background-color: #F9FAFB !important;
}

.eg-profile-back-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1rem;
}

.eg-back-link--profile {
  margin-bottom: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 999px;
  border-color: #dbeafe;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.eg-back-link--profile:hover {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.eg-back-link--profile:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.eg-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.eg-back-link:hover {
  color: #6f2cff;
  background: #f5f3ff;
  border-color: #e9e5ff;
}

.eg-back-link i {
  font-size: 1rem;
}

body .eg-profile-container {
  max-width: 560px;
}

.eg-profile-alert {
  border-radius: 0.75rem;
  max-width: 640px;
}

.eg-settings-card {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.75rem;
  margin-bottom: 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.eg-settings-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
}

.eg-settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.eg-settings-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #e9e5ff;
}

.eg-settings-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eg-settings-avatar .bi-person-fill {
  font-size: 2.25rem;
  color: #8b7ab8;
}

.eg-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

@media (max-width: 480px) {
  .eg-settings-grid {
    grid-template-columns: 1fr;
  }
}

.eg-settings-field {
  min-width: 0;
}

.eg-settings-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.eg-settings-input {
  width: 100%;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.95rem;
  color: #111827;
  background: transparent;
  transition: border-color 0.15s;
}

.eg-settings-input--box {
  padding: 0.65rem 0.95rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fafafa;
}

.eg-settings-input--box:focus {
  border-color: #6f2cff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(111, 44, 255, 0.12);
}

.eg-settings-input:focus {
  outline: none;
  border-bottom-color: #6f2cff;
}

.eg-settings-input::placeholder {
  color: #9ca3af;
}

.eg-settings-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

.eg-settings-btn--primary {
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #6f2cff 0%, #5b22d1 100%);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.eg-settings-btn--primary:hover {
  background: linear-gradient(135deg, #5b22d1 0%, #4c1d99 100%);
  box-shadow: 0 4px 12px rgba(111, 44, 255, 0.35);
}

.eg-settings-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6f2cff;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.eg-settings-btn:hover {
  color: #5b22d1;
}

.eg-settings-change-link {
  font-size: 0.9rem;
  color: #6f2cff;
  cursor: pointer;
  font-weight: 500;
}

.eg-settings-change-link:hover {
  color: #5b22d1;
  text-decoration: underline;
}

.eg-settings-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eg-settings-row .eg-settings-field {
  flex: 1;
  min-width: 0;
}

/* Toggle rows */
.eg-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.eg-settings-toggle-row:last-of-type {
  border-bottom: none;
}

.eg-settings-toggle-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.eg-settings-toggle-desc {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.2rem;
}

.eg-settings-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.eg-settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.eg-settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  border-radius: 24px;
  transition: 0.2s;
}

.eg-settings-toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.eg-settings-toggle input:checked+.eg-settings-toggle-slider {
  background-color: #6f2cff;
}

.eg-settings-toggle input:checked+.eg-settings-toggle-slider::before {
  transform: translateX(20px);
}

/* Delete section */
.eg-settings-desc {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.eg-settings-delete-btn {
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: #dc2626;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

.eg-settings-delete-btn:hover {
  background: #b91c1c;
  color: #fff;
}

/* Profile panel */
.eg-profile-page--ref {
  background-color: #f3f4f6 !important;
}

body .eg-profile-container--ref {
  max-width: 820px;
}

.eg-profile-wrapper {
  display: flex;
  justify-content: center;
}

.eg-profile-ref-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  padding: 1.4rem 1.55rem 1.6rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.eg-profile-ref-cardhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.1rem 0.55rem;
}

.eg-profile-ref-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.eg-profile-ref-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
}

.eg-profile-ref-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eg-profile-ref-avatar .bi-person-fill {
  font-size: 2.75rem;
  color: #64748b;
}

.eg-profile-ref-intro {
  min-width: 0;
}

.eg-profile-ref-name {
  font-size: 1.55rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.eg-profile-ref-nicklink {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none !important;
}

.eg-profile-ref-nicklink:hover {
  color: #2563eb;
}

.eg-profile-ref-nicklink--muted {
  color: #9ca3af;
  pointer-events: none;
}

.eg-profile-ref-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  color: #2563eb;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.eg-profile-ref-edit:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.eg-profile-ref-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.25rem 0 1.25rem;
  opacity: 1;
}

.eg-profile-ref-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem;
}

.eg-profile-ref-dl {
  margin: 0;
}

.eg-profile-ref-row {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0.1rem;
  border-bottom: 1px solid #f3f4f6;
}

.eg-profile-ref-row:last-of-type {
  border-bottom: none;
}

.eg-profile-ref-row dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4b5563;
  margin: 0;
}

.eg-profile-ref-row dd {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  word-break: break-word;
}

@media (max-width: 520px) {
  .eg-profile-ref-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

.eg-profile-ref-hint {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.eg-profile-ref-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none !important;
}

.eg-profile-ref-link:hover {
  text-decoration: underline !important;
}

.eg-profile-ref-form .eg-profile-ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.eg-profile-ref-field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 520px) {
  .eg-profile-ref-form .eg-profile-ref-grid {
    grid-template-columns: 1fr;
  }
}

.eg-profile-ref-field .eg-profile-ref-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.35rem;
}

.eg-profile-ref-input {
  width: 100%;
  padding: 0.62rem 0.8rem;
  font-size: 0.95rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #111827;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eg-profile-ref-input:focus {
  outline: none;
  border-color: #60a5fa;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.eg-profile-ref-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

.eg-profile-ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.6rem;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s, box-shadow 0.15s;
}

.eg-profile-ref-btn--primary {
  background: #2563eb;
  color: #ffffff;
}

.eg-profile-ref-btn--primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  color: #ffffff;
}

.eg-profile-ref-btn--ghost {
  background: #ffffff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.eg-profile-ref-btn--ghost:hover {
  background: #f9fafb;
  color: #111827;
}

/* Modal-tuned profile layout */
.eg-profile-page--modal {
  background: transparent !important;
}

.eg-profile-page--modal main {
  padding: 0 !important;
}

.eg-profile-shell--modal {
  margin: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem 1rem;
}

.eg-profile-page--modal .eg-profile-container--ref {
  width: 100%;
  max-width: 100%;
}

.eg-profile-page--modal .eg-profile-wrapper {
  width: 100%;
  margin: 0;
  padding: 0.72rem 0.75rem 0.5rem;
  box-sizing: border-box;
}

.eg-profile-page--modal .eg-profile-ref-card {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.95rem 1rem 1.05rem;
  box-shadow: none;
  background: #ffffff;
}

.eg-profile-page--modal .eg-profile-ref-cardhead {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.eg-profile-page--modal .eg-profile-ref-avatar {
  width: 74px;
  height: 74px;
}

.eg-profile-page--modal .eg-profile-ref-name {
  font-size: 1.35rem;
}

.eg-profile-page--modal .eg-profile-ref-divider {
  margin: 0.85rem 0 0.9rem;
}

.eg-profile-page--modal .eg-profile-ref-row {
  padding: 0.55rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.eg-profile-page--modal .eg-profile-ref-form .eg-profile-ref-grid {
  gap: 0.75rem 0.9rem;
}

.eg-profile-page--modal .eg-profile-ref-form-actions {
  margin-top: 1rem;
  padding-top: 0.9rem;
}

.eg-profile-page--modal .eg-profile-ref-dl,
.eg-profile-page--modal .eg-profile-ref-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.eg-profile-page--modal .eg-profile-ref-section-title {
  margin-bottom: 0.7rem;
}

.eg-profile-page--modal #employeeBarcode,
.eg-profile-page--modal #adminBarcode {
  max-width: 100%;
  height: auto;
}

.eg-profile-password-panel {
  border-radius: 0.85rem;
}

.eg-profile-page--modal .eg-profile-password-panel {
  padding: 0 !important;
  margin-top: 0.9rem !important;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.eg-change-password-panel h5 {
  font-size: 1rem;
}

.eg-change-password-panel .form-label {
  font-size: 0.82rem;
}

.eg-change-password-panel .btn {
  font-size: 0.82rem;
}

/* Profile v2 redesign */
.eg-profile-v2 {
  width: 100%;
  margin: 0.35rem 0 0.55rem;
  display: grid;
  gap: 0.6rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0.15rem;
}

.eg-profile-v2__hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  box-shadow: none;
}

.eg-profile-v2__hero-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.eg-profile-v2__avatar-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.eg-profile-v2__avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #d1d5db;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eg-profile-v2__avatar .bi-person-fill {
  font-size: 1.1rem;
  color: #6b7280;
}

.eg-profile-v2__avatar-upload {
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.eg-profile-v2__avatar-wrap:hover .eg-profile-v2__avatar-upload {
  opacity: 1;
}

.eg-profile-v2__kicker {
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
}

.eg-profile-v2__name {
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
}

.eg-profile-v2__sub {
  font-size: 0.86rem;
  color: #6b7280;
}

.eg-profile-v2__hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.eg-profile-v2__editing-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
}

.eg-profile-v2__section,
.eg-profile-v2__form {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  padding: 0.75rem;
  box-shadow: none;
}

.eg-profile-v2__section h2 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
  color: #111827;
}

.eg-profile-v2__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.9rem;
}

.eg-profile-v2__details>div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f3f4f6;
}

.eg-profile-v2__details span {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.eg-profile-v2__details strong {
  font-size: 0.92rem;
  color: #111827;
  font-weight: 600;
}

.eg-profile-v2__muted {
  color: #64748b;
  font-size: 0.9rem;
}

.eg-profile-v2__barcode {
  display: inline-block;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 0.65rem;
  padding: 0.55rem;
  max-width: 100%;
}

.eg-profile-v2__form {
  margin: 0;
}

.eg-profile-v2__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
}

.eg-profile-v2__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.eg-profile-v2__field--wide {
  grid-column: 1 / -1;
}

.eg-profile-v2__field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}

.eg-profile-v2__field input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  background: #f8fafc;
  color: #111827;
  font-size: 0.9rem;
  padding: 0.45rem 0.55rem;
}

.eg-profile-v2__field input:focus {
  border-color: #60a5fa;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.2);
  outline: none;
}

.eg-profile-v2__field input[readonly] {
  color: #6b7280;
  cursor: default;
}

.eg-profile-v2__form-actions {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.eg-profile-v2__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.32rem;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid transparent;
  padding: 0.28rem 0.68rem;
  cursor: pointer;
}

.eg-profile-v2__btn--primary {
  background: #3b82f6;
  color: #ffffff;
}

.eg-profile-v2__btn--primary:hover {
  background: #2563eb;
  color: #ffffff;
}

.eg-profile-v2__btn--ghost {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #374151;
}

.eg-profile-v2__btn--ghost:hover {
  background: #f8fafc;
  color: #0f172a;
}

.eg-profile-page--modal .eg-profile-v2__hero,
.eg-profile-page--modal .eg-profile-v2__section,
.eg-profile-page--modal .eg-profile-v2__form {
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 767.98px) {
  .eg-profile-v2__hero {
    flex-direction: column;
  }

  .eg-profile-v2__hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .eg-profile-v2__details,
  .eg-profile-v2__grid {
    grid-template-columns: 1fr;
  }
}

/* Auto-minimize sidebar on small/medium screens (tablet and below) */
@media (max-width: 991.98px) {
  .eg-sidebar {
    min-height: calc(100vh - 56px);
    padding: 0.55rem 0.35rem;
    border-bottom: none !important;
    border-right: 1px solid #dbeafe !important;
    width: auto !important;
    max-width: 72px !important;
    flex: 0 0 72px !important;
  }

  .eg-sidebar-brand {
    margin-bottom: 0.3rem;
    padding: 0;
    text-align: center;
  }

  .eg-sidebar-role {
    font-size: 0.52rem !important;
    letter-spacing: 0.04em !important;
  }

  .eg-sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .eg-sidebar-link {
    margin-bottom: 0;
    padding: 0.55rem 0.45rem;
    border-radius: 0.7rem;
    font-size: 0.75rem;
    justify-content: center;
    text-align: center;
  }

  .eg-sidebar-link i {
    font-size: 1.05rem;
    width: 1.1rem;
    margin: 0;
  }

  .eg-sidebar-link span {
    display: none;
  }

  .eg-sidebar + main.col-12 {
    width: auto !important;
    flex: 1 1 0 !important;
    max-width: none !important;
  }

  .eg-sidebar + main {
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
  }
}

@media (max-width: 767.98px) {
  .eg-profile-shell--modal {
    padding: 0.65rem 0.65rem 0.85rem;
  }

  .eg-profile-page--modal .eg-profile-ref-card {
    padding: 0.95rem;
  }

  .eg-profile-page--modal .eg-profile-ref-hero {
    gap: 0.7rem;
  }
}

/* Mobile layout improvements for admin/superadmin pages */
@media (max-width: 767.98px) {
  .eg-topbar {
    padding: 0.35rem 0.6rem;
  }

  .eg-topbar-login {
    padding: 0.55rem 0.85rem !important;
  }

  .eg-topbar-login .eg-system-logo {
    width: 34px !important;
  }

  .eg-system-logo {
    width: 26px;
  }

  .eg-system-wordmark-top {
    font-size: 0.78rem;
  }

  .eg-system-wordmark-bottom {
    font-size: 0.62rem;
  }

  .eg-sidebar {
    min-height: calc(100vh - 56px);
    padding: 0.55rem 0.35rem;
    border-bottom: none !important;
    border-right: 1px solid #dbeafe !important;
    width: auto !important;
    max-width: 72px !important;
    flex: 0 0 72px !important;
  }

  .eg-sidebar-brand {
    margin-bottom: 0.3rem;
    padding: 0;
    text-align: center;
  }

  .eg-sidebar-role {
    font-size: 0.52rem !important;
    letter-spacing: 0.04em !important;
  }

  .eg-sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .eg-sidebar-link {
    margin-bottom: 0;
    padding: 0.55rem 0.45rem;
    border-radius: 0.7rem;
    font-size: 0.75rem;
    justify-content: center;
    text-align: center;
  }

  .eg-sidebar-link i {
    font-size: 1.05rem;
    width: 1.1rem;
    margin: 0;
  }

  .eg-sidebar-link span {
    display: none;
  }

  .eg-sidebar+main.col-12 {
    width: auto !important;
    flex: 1 1 0 !important;
    max-width: none !important;
  }

  .eg-sidebar+main {
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
    width: auto !important;
    max-width: calc(100% - 72px) !important;
    flex: 1 1 0 !important;
  }

  .eg-panel {
    border-radius: 1rem;
    padding: 1rem;
  }

  .eg-metric-card {
    border-radius: 1rem;
    padding: 0.85rem 0.95rem;
  }
}

/* Keep sidebar + content in one row on phones */
@media (max-width: 767.98px) {
  /* Auto-toggled behavior on phones */
  .eg-sidebar-toggle-btn {
    display: none !important;
  }

  #eg-sidebar {
    max-width: 72px !important;
    min-width: 72px !important;
    flex: 0 0 72px !important;
    padding: 0.75rem 0.35rem !important;
  }

  #eg-sidebar .eg-sidebar-brand {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0.6rem !important;
    text-align: center !important;
  }

  #eg-sidebar .eg-sidebar-role {
    display: none !important;
  }

  #eg-sidebar .eg-sidebar-link {
    justify-content: center !important;
    text-align: center !important;
    padding: 0.55rem 0.35rem !important;
    border-radius: 0.6rem !important;
  }

  #eg-sidebar .eg-sidebar-link i {
    margin: 0 !important;
    width: auto !important;
    font-size: 1.1rem !important;
  }

  #eg-sidebar .eg-sidebar-link span {
    display: none !important;
  }

  .container-fluid > .row {
    flex-wrap: nowrap !important;
  }

  .container-fluid > .row > #eg-sidebar {
    flex: 0 0 72px !important;
    max-width: 72px !important;
    min-width: 72px !important;
  }

  .container-fluid > .row > #eg-sidebar + main {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(100% - 72px) !important;
  }
}

/* ============================================================
   Sidebar toggle button
   ============================================================ */
.eg-sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}

.eg-sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.eg-sidebar-toggle-btn:active {
  transform: scale(0.93);
}

.eg-sidebar-toggle-btn-dark {
  background: rgba(29, 78, 216, 0.1);
  color: #1e3a8a;
}

.eg-sidebar-toggle-btn-dark:hover {
  background: rgba(29, 78, 216, 0.2);
}

/* ============================================================
   Sidebar collapsed state  (triggered by body.sidebar-collapsed)
   ============================================================ */

/* Suppress ALL transitions on initial page load to prevent flash */
body.no-sidebar-transition #eg-sidebar,
body.no-sidebar-transition #eg-sidebar+main {
  transition: none !important;
}

#eg-sidebar {
  transition: max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    min-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    flex 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border 0.32s ease;
  overflow: hidden;
}

/* Main content: animate width change in sync with sidebar */
#eg-sidebar+main {
  transition: max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    flex 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  /* Allow smooth flex-grow and prevent wrapping to next line during transition */
  flex: 1 1 0% !important;
  width: auto !important;
  max-width: 100% !important;
}

body.sidebar-collapsed #eg-sidebar {
  max-width: 80px !important;
  min-width: 80px !important;
  flex: 0 0 80px !important;
  padding: 1rem 0.5rem !important;
}

body.sidebar-collapsed #eg-sidebar .eg-sidebar-brand {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-bottom: 1rem;
}

body.sidebar-collapsed #eg-sidebar .eg-sidebar-role {
  display: none;
}

body.sidebar-collapsed #eg-sidebar .eg-sidebar-link {
  justify-content: center;
  padding: 0.75rem 0;
  border-radius: 0.5rem;
}

body.sidebar-collapsed #eg-sidebar .eg-sidebar-link span {
  display: none;
}

body.sidebar-collapsed #eg-sidebar .eg-sidebar-link i {
  margin: 0;
  font-size: 1.25rem;
}

body.sidebar-collapsed #eg-sidebar+main {
  max-width: 100% !important;
  flex: 1 1 0% !important;
}

/* Phone fix: keep collapsed width + content width in sync */
@media (max-width: 767.98px) {
  body.sidebar-collapsed #eg-sidebar {
    max-width: 72px !important;
    min-width: 72px !important;
    flex: 0 0 72px !important;
    padding: 0.75rem 0.35rem !important;
  }

  body.sidebar-collapsed #eg-sidebar + main {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: calc(100% - 72px) !important;
  }
}

/* Small-screen behavior: expanded by default, collapse only when toggled */
@media (max-width: 991.98px) {
  body:not(.sidebar-collapsed) #eg-sidebar {
    max-width: 250px !important;
    min-width: 250px !important;
    flex: 0 0 250px !important;
    padding: 0.75rem 0.6rem !important;
  }

  body:not(.sidebar-collapsed) #eg-sidebar .eg-sidebar-brand {
    justify-content: space-between !important;
    padding: 0 0.5rem !important;
    margin-bottom: 0.75rem !important;
    text-align: left !important;
  }

  body:not(.sidebar-collapsed) #eg-sidebar .eg-sidebar-role {
    display: inline !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.1em !important;
  }

  body:not(.sidebar-collapsed) #eg-sidebar .eg-sidebar-link {
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0.6rem 0.9rem !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
  }

  body:not(.sidebar-collapsed) #eg-sidebar .eg-sidebar-link i {
    margin: 0 !important;
    width: 1.25rem !important;
    font-size: 1.15rem !important;
  }

  body:not(.sidebar-collapsed) #eg-sidebar .eg-sidebar-link span {
    display: inline !important;
  }
}