:root {
  --erp-primary: #6366f1;
  --erp-bg: #f8fafc;
  --erp-sidebar-width: 0px;
  --erp-sidebar-expanded: 260px;
  --erp-sidebar-bg: #10213a;
  --erp-sidebar-bg-light: #173154;
  --navbar-height: 102px;  /* 34px util strip + 68px main nav row */
  --erp-sidebar-gap: 16px;
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --card-hover-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ── App-switcher grid icon (in navbar, after logo) ── */
.erp-app-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  margin: 0 6px 0 2px;
}
.erp-app-switcher:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  transform: scale(1.06);
}
.erp-app-switcher svg {
  width: 16px;
  height: 16px;
}
/* Highlight when sidebar is open */
html.erp-sidebar-visible .erp-app-switcher {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
  color: #a5b4fc;
}

/* Default: sidebar hidden */
.sidebar {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* When sidebar is toggled open */
html.erp-sidebar-visible .sidebar {
  width: var(--erp-sidebar-expanded) !important;
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  z-index: 150;
  visibility: visible;
}

html.erp-sidebar-visible .main-content {
  margin-left: var(--erp-sidebar-expanded) !important;
  width: calc(100% - var(--erp-sidebar-expanded)) !important;
}

.navbar {
  background: #0f172a !important; 
  /* Solid matching color from main site base - rgba(15, 23, 42, 1) */
}

/* ── Accessible focus outlines ── */
*:focus-visible {
  outline: 2px solid var(--erp-primary);
  outline-offset: 2px;
}

.sidebar-nav a:focus-visible {
  outline-color: #38bdf8;
  outline-offset: -2px;
  border-radius: 8px;
}

.unit-card:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

.next-step-item:focus-visible {
  outline-offset: -1px;
  border-radius: 999px;
}

.cta-button:focus-visible,
.erp-hero a:focus-visible,
.login-btn:focus-visible {
  outline-color: #fbbf24;
  outline-offset: 3px;
}

button:focus-visible {
  outline-offset: 2px;
}

body { 
  margin: 0; 
  padding: 0; 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--erp-bg);
  color: #1e293b;
}

body.erp-body {
  overflow: hidden;
}

.erp-container { 
  display: block; 
  height: calc(100vh - var(--navbar-height)); 
  background: #f1f5f9;
  overflow: hidden;
  box-sizing: border-box;
}

/* Sidebar - Dark Navy Design (like reference image) */
.sidebar { 
  width: var(--erp-sidebar-expanded); 
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 26%),
    linear-gradient(180deg, #10213a 0%, #132847 42%, #0b1730 100%);
  border-right: none;
  box-shadow: 10px 0 30px rgba(2, 6, 23, 0.2);
  padding: 1rem 0.5rem; 
  position: fixed; 
  top: calc(var(--navbar-height) + var(--erp-sidebar-gap)); 
  left: 0;
  height: calc(100vh - var(--navbar-height) - var(--erp-sidebar-gap)); 
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  will-change: width, transform;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

/* Expand sidebar on hover - disabled when sidebar panel is open */
.sidebar:hover {
  width: var(--erp-sidebar-expanded);
}

/* Hide text labels when sidebar is hidden (default) */
.sidebar-nav .nav-link > div,
.sidebar-nav .nav-link > span:not(:first-child) {
  opacity: 1;
  width: auto;
  overflow: visible;
  white-space: nowrap;
  transition: opacity 0.12s ease, width 0.15s ease;
  margin: 0 !important;
}

/* Sidebar Header - always expanded style when visible */
.sidebar .sidebar-header {
  display: flex !important;
  text-align: left;
  justify-content: space-between;
  padding: 0.5rem 0.75rem !important;
  margin-top: 1rem !important;
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: rgba(255, 255, 255, 0.8) !important;
  white-space: normal !important;
  overflow: visible !important;
}

.sidebar .sidebar-header span {
  display: block; 
  opacity: 1 !important;
  width: auto;
  visibility: visible !important;
}

/* Sidebar nav links - always show labels when sidebar is visible */
.sidebar .sidebar-nav .nav-link {
  justify-content: flex-start !important;
}

.sidebar .sidebar-nav .nav-link > div,
.sidebar .sidebar-nav .nav-link > span:not(:first-child) {
  opacity: 1;
  width: auto;
}

/* Hide submenu chevron arrow when collapsed */
.sidebar-nav .nav-link.has-submenu::after {
  opacity: 0;
}
.sidebar:hover .sidebar-nav .nav-link.has-submenu::after {
  opacity: 1;
}

/* FoodPro submenu: Hide entirely when sidebar is collapsed (68px) because text items cannot fit.
   They will reappear when the sidebar expands on hover. */
.sidebar:not(:hover) li.pinned-submenu > .submenu {
  display: none !important;
}

/* Remove forced styling for collapsed submenu links as they differ from main nav */
.sidebar:not(:hover) li.pinned-submenu > .submenu .submenu-link {
  /* No special styling needed when hidden */
}

/* Expanded sidebar — original inline submenu behavior */
.sidebar:hover .sidebar-nav .submenu.pin-visible {
  display: block !important;
  opacity: 1 !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Custom Scrollbar - Webkit (Chrome, Edge, Safari) */
.sidebar::-webkit-scrollbar { 
  width: 4px; 
  display: block;
}
.sidebar::-webkit-scrollbar-track { 
  background: transparent; 
  border-radius: 10px; 
}
.sidebar::-webkit-scrollbar-thumb { 
  background: rgba(255, 255, 255, 0.15); 
  border-radius: 10px;
  min-height: 40px;
}
.sidebar::-webkit-scrollbar-thumb:hover { 
  background: rgba(255, 255, 255, 0.25); 
}

.sidebar-header { 
  font-size: 0.65rem; 
  font-weight: 700; 
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  margin-bottom: 0.75rem; 
  margin-top: 1rem;
  /* brighter, higher-contrast header for better readability */
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(0,0,0,0.12);
  padding-left: 0.75rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: color 180ms ease;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; }

.sidebar-nav ul { list-style: none; padding: 0; margin: 0; }

/* Make the modules list stretch and distribute its items evenly top-to-bottom */
.sidebar-nav > ul[aria-label="Modules"] {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Changed from space-between to prevent hiding items */
  flex: 1 1 auto; /* allow it to grow and fill available sidebar height */
  gap: 0.35rem; /* keep a small gutter between items */
}

/* Ensure the collapsed sidebar shows the header label fully (wrap + smaller text) */
.sidebar .sidebar-header { flex-direction: column !important; gap: 4px !important; }


.sidebar-nav .nav-link { 
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.25rem;
  border-radius: 12px; 
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  font-weight: 500; 
  margin-bottom: 0.35rem; 
  text-decoration: none; 
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer; 
  position: relative;
  overflow: hidden;
  border: none;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.sidebar-nav .nav-link > div,
.sidebar-nav .nav-link > span:not(:first-child) {
  transition: opacity 0.25s ease;
  overflow: hidden;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  min-width: 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.80);
  transition: all 0.25s ease;
  flex-shrink: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

/* Hover State - pink highlight */
.sidebar-nav .nav-link:hover { 
  background: linear-gradient(90deg, rgba(236,72,153,0.22), rgba(236,72,153,0.08));
  color: #ffffff;
  transform: none;
}

.sidebar-nav .nav-link:hover i {
  transform: scale(1.1);
  color: #ec4899;
}

/* Active State - pink accent indicator */
.sidebar-nav .nav-link.active { 
  background: linear-gradient(90deg, rgba(236,72,153,0.35), rgba(236,72,153,0.15));
  color: #ffffff;
  border-left: 3px solid #ec4899;
  margin-left: -3px;
  box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.20);
}

.sidebar-nav .nav-link.active i {
  color: #ec4899;
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.55));
}

/* Icon color accents on hover */
.sidebar-nav .nav-link[href*="#hr"]:hover i,
.sidebar-nav .nav-link[href*="#hr"].active i { color: #10b981; }
.sidebar-nav .nav-link[href*="#crm"]:hover i,
.sidebar-nav .nav-link[href*="#crm"].active i { color: #3b82f6; }
.sidebar-nav .nav-link[href*="#accounting"]:hover i,
.sidebar-nav .nav-link[href*="#accounting"].active i { color: #f59e0b; }
.sidebar-nav .nav-link[href*="#inventory"]:hover i,
.sidebar-nav .nav-link[href*="#inventory"].active i { color: #8b5cf6; }
.sidebar-nav .nav-link[href*="#procurement"]:hover i,
.sidebar-nav .nav-link[href*="#procurement"].active i { color: #0d9488; }
.sidebar-nav .nav-link[href*="#school"]:hover i,
.sidebar-nav .nav-link[href*="#school"].active i { color: #ec4899; }
.sidebar-nav .nav-link[href*="#ngo"]:hover i,
.sidebar-nav .nav-link[href*="#ngo"].active i { color: #818cf8; } /* Indigo-400 */
.sidebar-nav .nav-link[href*="#healthcare"]:hover i,
.sidebar-nav .nav-link[href*="#healthcare"].active i { color: #ef4444; }
.sidebar-nav .nav-link[href*="#hotel"]:hover i,
.sidebar-nav .nav-link[href*="#hotel"].active i { color: #f97316; }
.sidebar-nav .nav-link[href*="#foodpro"]:hover i,
.sidebar-nav .nav-link[href*="#foodpro"].active i { color: #0284c7; } /* Sky-600 */
.sidebar-nav .nav-link[href*="#pos"]:hover i,
.sidebar-nav .nav-link[href*="#pos"].active i { color: #a3e635; } /* Lime-400 */
.sidebar-nav .nav-link[href*="#marketplace"]:hover i,
.sidebar-nav .nav-link[href*="#marketplace"].active i { color: #22c55e; }

/* Active states with glow effect */
.sidebar-nav .nav-link[href*="#hr"].active i { filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5)); }
.sidebar-nav .nav-link[href*="#crm"].active i { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5)); }
.sidebar-nav .nav-link[href*="#accounting"].active i { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5)); }
.sidebar-nav .nav-link[href*="#inventory"].active i { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5)); }
.sidebar-nav .nav-link[href*="#foodpro"].active i { filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.5)); }
.sidebar-nav .nav-link[href*="#ngo"].active i { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5)); }

/* Main Content Area */
.main-content { 
  padding: var(--erp-sidebar-gap) 2px 2px;
  margin-left: var(--erp-sidebar-width);
  width: calc(100% - var(--erp-sidebar-width));
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  scroll-padding-top: calc(var(--navbar-height) + 18px);
}

.erp-hero-shell {
  flex-shrink: 0;
}

/* Redesigned ERP hero — Bright Blue Enterprise Theme */
.erp-hero {
  position: relative;
  padding: 3rem 2.5rem;
  border-radius: 24px;
  background: linear-gradient(120deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 20px 40px -4px rgba(37, 99, 235, 0.25);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Background patterns */
.erp-hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  filter: blur(80px);
  pointer-events: none;
}

.erp-hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
}

.erp-hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.erp-hero-content {
  z-index: 2;
}

.erp-hero-title {
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1rem 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.erp-hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 2.2rem 0;
  font-size: 1.15rem;
  max-width: 54ch;
  line-height: 1.6;
  font-weight: 500;
}

.erp-hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.erp-hero-cta .btn-primary {
  background: #ffffff;
  color: #2563eb; /* Blue text */
  padding: 0.9rem 1.6rem;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12);
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.erp-hero-cta .btn-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.18);
}

.erp-hero-cta .btn-outline {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.erp-hero-cta .btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.erp-hero-features {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.erp-hero-features .feature {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

.erp-hero-features .feature i {
  color: #2563eb;
  background: #ffffff;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Visual Side - Glassy Dashboard */
.erp-hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.mock-dashboard {
  width: 100%;
  max-width: 500px;
  border-radius: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15); /* Glass effect */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: perspective(1000px) rotateY(-8deg) rotateX(4deg);
  transition: transform 0.4s ease;
}

.mock-dashboard:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02);
}

.md-chart {
  height: 140px;
  background: rgba(255, 255, 255, 0.5); /* Semi-transparent inner */
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.md-bar {
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  display: block;
}

.md-bar.w-85 {
  background: #ffffff; /* Highlight bar is pure white */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}
.md-bar.w-85::after {
  content: '+12%';
  position: absolute;
  top: -24px; left: 50%; transform: translateX(-50%);
  background: #ef4444; color: white; padding: 2px 6px;
  font-size: 0.7rem; font-weight: 700; border-radius: 4px;
}

.md-bar.w-60 { height: 60%; }
.md-bar.w-45 { height: 45%; }
.md-bar.w-30 { height: 30%; }

@media (max-width: 1100px) {
  .erp-hero-inner { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
  .erp-hero-content { align-items: center; display: flex; flex-direction: column; }
  .erp-hero-subtitle { margin-left: auto; margin-right: auto; }
  .erp-hero-cta { justify-content: center; }
  .mock-dashboard { margin: 0 auto; transform: none; }
}

@media (max-width: 768px) {
  .erp-hero { padding: 2rem 1.5rem; }
  .erp-hero-title { font-size: 1.85rem; }
  .erp-hero-cta { flex-direction: column; width: 100%; }
  .erp-hero-cta .btn-primary, .erp-hero-cta .btn-outline { width: 100%; justify-content: center; }
}

.erp-content-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 20px;
  box-sizing: border-box;
}

.module-section { display: none; }
.module-section.active { display: block; animation: slideIn 0.4s ease-out; }

@keyframes slideIn { 
  from { opacity: 0; transform: translateY(10px); } 
  to { opacity: 1; transform: translateY(0); } 
}

.module-title-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.module-title-area h2 {
  font-size: 1.875rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Unit Gateway Cards — Elegant Animated Module Grid
   ═══════════════════════════════════════════════════════════════ */
.unit-carousel-wrapper {
  position: relative;
  width: 100%;
}

.unit-gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  width: 100%;
}

.unit-carousel-wrapper:hover .unit-gateway-grid {
  /* animation-play-state: paused; — disabled */
}

@keyframes autoScrollUnits {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.unit-gateway-grid::-webkit-scrollbar { height: 6px; }
.unit-gateway-grid::-webkit-scrollbar-track { background: rgba(0,0,0,.05); border-radius: 3px; }
.unit-gateway-grid::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #6366f1, #0ea5e9); border-radius: 3px; }

/* Shimmer sweep animation */
@keyframes cardShimmer {
  0%   { transform: translateX(-120%) skewX(-12deg); }
  100% { transform: translateX(260%)  skewX(-12deg); }
}

/* ── Base card ── */
.unit-card {
  position: relative;
  background: #ffffff;
  background-image: linear-gradient(160deg, #ffffff 0%, #f8faff 100%);
  padding: 1.35rem 1.25rem 1.1rem;
  border-radius: 20px;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 10px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  height: 310px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.32s ease,
              border-color 0.28s ease;
  width: 100%;
  min-width: 0;
  max-width: none;
}

/* Gradient top-accent bar */
.unit-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  border-radius: 20px 20px 0 0;
  opacity: 0.8;
  transition: opacity 0.28s ease, height 0.28s ease;
}

/* Shimmer sweep on hover */
.unit-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.58) 50%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.unit-card:hover {
  transform: translateY(-8px) scale(1.012);
  box-shadow: 0 18px 44px rgba(15,23,42,.13), 0 4px 14px rgba(15,23,42,.07);
  border-color: rgba(99,102,241,0.28);
}

.unit-card:hover::before {
  opacity: 1;
  height: 4px;
}

.unit-card:hover::after {
  opacity: 1;
  animation: cardShimmer 0.65s ease forwards;
}

/* ── Per-module top-bar gradient accents ── */
.unit-card.unit-acc::before         { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.unit-card.unit-agropro::before     { background: linear-gradient(90deg, #16a34a, #4ade80); }
.unit-card.unit-crm::before         { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.unit-card.unit-sch::before         { background: linear-gradient(90deg, #ec4899, #f472b6); }
.unit-card.unit-hr::before          { background: linear-gradient(90deg, #10b981, #34d399); }
.unit-card.unit-inv::before         { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.unit-card.unit-marketing-hub::before { background: linear-gradient(90deg, #ec4899, #f472b6); }
.unit-card.unit-payroll::before     { background: linear-gradient(90deg, #6366f1, #818cf8); }
.unit-card.unit-pos::before         { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.unit-card.unit-propertypro::before { background: linear-gradient(90deg, #6366f1, #a5b4fc); }
.unit-card.unit-ch::before          { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
.unit-card.unit-timetracker::before { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.unit-card.unit-proc::before        { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.unit-card.unit-foodpro::before     { background: linear-gradient(90deg, #10b981, #6ee7b7); }
.unit-card.unit-hc::before          { background: linear-gradient(90deg, #ef4444, #f87171); }
.unit-card.unit-hotel::before       { background: linear-gradient(90deg, #f97316, #fb923c); }
.unit-card.unit-mkt::before         { background: linear-gradient(90deg, #22c55e, #86efac); }
.unit-card.unit-roster::before      { background: linear-gradient(90deg, #6366f1, #818cf8); }
.unit-card.unit-logistics::before   { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.unit-card.unit-carepro::before     { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.unit-card.unit-homesafe::before    { background: linear-gradient(90deg, #f97316, #fbbf24); }
.unit-card.unit-fleettrack::before  { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.unit-card.unit-ai::before          { background: linear-gradient(90deg, #4f46e5, #8b5cf6); }
.unit-card.unit-cyber::before       { background: linear-gradient(90deg, #059669, #10b981); }
.unit-card.unit-design-studio::before { background: linear-gradient(90deg, #ec4899, #f59e0b); }
.unit-card.unit-treasury::before    { background: linear-gradient(90deg, #0ea5e9, #6366f1); }
.unit-card.unit-sc::before          { background: linear-gradient(90deg, #06b6d4, #0ea5e9); }

/* ── Icon wrapper ── */
.unit-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  color: #475569;
  border: 1px solid rgba(15,23,42,.07);
  box-shadow: 0 3px 8px rgba(15,23,42,.09), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  flex-shrink: 0;
}

.unit-card:hover .unit-icon-wrapper {
  transform: translateY(-2px) scale(1.1) rotate(-4deg);
  box-shadow: 0 8px 22px rgba(99,102,241,.22), inset 0 1px 0 rgba(255,255,255,.8);
}

/* ── Per-module icon pastel gradient backgrounds ── */
.unit-acc         .unit-icon-wrapper { background: linear-gradient(135deg,#fef9c3,#fef3c7); color:#d97706; border-color:rgba(251,191,36,.3); }
.unit-agropro     .unit-icon-wrapper { background: linear-gradient(135deg,#dcfce7,#d1fae5); color:#16a34a; border-color:rgba(74,222,128,.3); }
.unit-crm         .unit-icon-wrapper { background: linear-gradient(135deg,#dbeafe,#eff6ff); color:#2563eb; border-color:rgba(96,165,250,.3); }
.unit-sch         .unit-icon-wrapper { background: linear-gradient(135deg,#fce7f3,#fdf2f8); color:#db2777; border-color:rgba(244,114,182,.3); }
.unit-hr          .unit-icon-wrapper { background: linear-gradient(135deg,#d1fae5,#ecfdf5); color:#059669; border-color:rgba(52,211,153,.3); }
.unit-inv         .unit-icon-wrapper { background: linear-gradient(135deg,#ede9fe,#f5f3ff); color:#7c3aed; border-color:rgba(167,139,250,.3); }
.unit-marketing-hub .unit-icon-wrapper { background: linear-gradient(135deg,#fce7f3,#fdf2f8); color:#db2777; border-color:rgba(244,114,182,.3); }
.unit-payroll     .unit-icon-wrapper { background: linear-gradient(135deg,#e0e7ff,#eef2ff); color:#4338ca; border-color:rgba(129,140,248,.3); }
.unit-pos         .unit-icon-wrapper { background: linear-gradient(135deg,#e0f2fe,#f0f9ff); color:#0284c7; border-color:rgba(56,189,248,.3); }
.unit-propertypro .unit-icon-wrapper { background: linear-gradient(135deg,#e0e7ff,#eef2ff); color:#4f46e5; border-color:rgba(165,180,252,.3); }
.unit-ch          .unit-icon-wrapper { background: linear-gradient(135deg,#ede9fe,#f5f3ff); color:#7c3aed; border-color:rgba(196,181,253,.3); }
.unit-timetracker .unit-icon-wrapper { background: linear-gradient(135deg,#cffafe,#ecfeff); color:#0891b2; border-color:rgba(34,211,238,.3); }
.unit-proc        .unit-icon-wrapper { background: linear-gradient(135deg,#ccfbf1,#f0fdfa); color:#0d9488; border-color:rgba(45,212,191,.3); }
.unit-foodpro     .unit-icon-wrapper { background: linear-gradient(135deg,#d1fae5,#ecfdf5); color:#059669; border-color:rgba(110,231,183,.3); }
.unit-hc          .unit-icon-wrapper { background: linear-gradient(135deg,#fee2e2,#fef2f2); color:#dc2626; border-color:rgba(248,113,113,.3); }
.unit-hotel       .unit-icon-wrapper { background: linear-gradient(135deg,#ffedd5,#fff7ed); color:#ea580c; border-color:rgba(251,146,60,.3); }
.unit-mkt         .unit-icon-wrapper { background: linear-gradient(135deg,#dcfce7,#f0fdf4); color:#16a34a; border-color:rgba(134,239,172,.3); }
.unit-roster      .unit-icon-wrapper { background: linear-gradient(135deg,#e0e7ff,#eef2ff); color:#4338ca; border-color:rgba(129,140,248,.3); }
.unit-logistics   .unit-icon-wrapper { background: linear-gradient(135deg,#e0f2fe,#cffafe); color:#0891b2; border-color:rgba(6,182,212,.3); }
.unit-carepro     .unit-icon-wrapper { background: linear-gradient(135deg,#ccfbf1,#f0fdfa); color:#0f766e; border-color:rgba(45,212,191,.3); }
.unit-homesafe    .unit-icon-wrapper { background: linear-gradient(135deg,#ffedd5,#fff7ed); color:#ea580c; border-color:rgba(251,191,36,.3); }
.unit-fleettrack  .unit-icon-wrapper { background: linear-gradient(135deg,#ede9fe,#eef2ff); color:#4f46e5; border-color:rgba(124,58,237,.3); }
.unit-ai          .unit-icon-wrapper { background: linear-gradient(135deg,#ede9fe,#e0e7ff); color:#4f46e5; border-color:rgba(139,92,246,.3); }
.unit-cyber       .unit-icon-wrapper { background: linear-gradient(135deg,#d1fae5,#ecfdf5); color:#059669; border-color:rgba(16,185,129,.3); }
.unit-design-studio .unit-icon-wrapper { background: linear-gradient(135deg,#fce7f3,#fef9c3); color:#db2777; border-color:rgba(236,72,153,.3); }
.unit-treasury    .unit-icon-wrapper { background: linear-gradient(135deg,#e0f2fe,#e0e7ff); color:#0284c7; border-color:rgba(99,102,241,.3); }
.unit-sc          .unit-icon-wrapper { background: linear-gradient(135deg,#cffafe,#e0f2fe); color:#0891b2; border-color:rgba(6,182,212,.3); }

/* ── Typography ── */
.unit-card h3 {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.unit-card p {
  margin: 0;
  font-size: 0.81rem;
  color: #64748b;
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badge ── */
.unit-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.055);
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.08);
  width: fit-content;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.unit-card:hover .unit-badge {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.22);
}

/* ── Footer ── */
.unit-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  font-size: 0.73rem;
  font-weight: 600;
  color: #94a3b8;
  transition: color 0.25s ease;
}

.unit-card:hover .unit-footer { color: #64748b; }

.unit-footer i {
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), color 0.25s ease;
  color: #cbd5e1;
}

.unit-card:hover .unit-footer i { transform: translateX(5px); color: #6366f1; }

/* Module cards v2: stronger visible redesign for the ERP home grid. */
@keyframes unitCardEnter {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes unitAccentFlow {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 0 100%; }
}

.unit-gateway-grid {
  gap: 1.15rem;
  align-items: stretch;
}

.unit-gateway-grid .unit-card {
  --unit-accent: #6366f1;
  --unit-accent-2: #0ea5e9;
  --unit-rgb: 99, 102, 241;
  --unit-soft: #eef2ff;
  isolation: isolate;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "icon badge"
    "title title"
    "copy copy"
    "footer footer";
  gap: 0.78rem 0.85rem;
  min-height: 238px;
  height: auto;
  padding: 1.15rem 1.15rem 1rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(var(--unit-rgb), 0.22);
  background:
    linear-gradient(135deg, rgba(var(--unit-rgb), 0.16) 0%, rgba(var(--unit-rgb), 0.055) 36%, rgba(255,255,255,0) 64%),
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, #f8fafc 100%);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.09), 0 1px 0 rgba(255,255,255,0.9) inset;
  animation: unitCardEnter 0.56s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.unit-gateway-grid .unit-card::before {
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 5px;
  height: auto;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, var(--unit-accent), var(--unit-accent-2), var(--unit-accent));
  background-size: 100% 220%;
  opacity: 1;
  animation: unitAccentFlow 4.8s ease-in-out infinite;
}

.unit-gateway-grid .unit-card::after {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 0%, transparent 42%, rgba(255,255,255,0.62) 50%, transparent 58%, transparent 100%);
  opacity: 0;
  transform: translateX(-58%);
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: -1;
}

.unit-gateway-grid .unit-card:hover,
.unit-gateway-grid .unit-card:focus-visible {
  transform: translateY(-9px);
  border-color: rgba(var(--unit-rgb), 0.42);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.15), 0 0 0 4px rgba(var(--unit-rgb), 0.07);
}

.unit-gateway-grid .unit-card:hover::before,
.unit-gateway-grid .unit-card:focus-visible::before {
  width: 7px;
  height: auto;
}

.unit-gateway-grid .unit-card:hover::after,
.unit-gateway-grid .unit-card:focus-visible::after {
  opacity: 1;
  transform: translateX(62%);
}

.unit-gateway-grid .unit-card:nth-child(1) { animation-delay: 0.02s; }
.unit-gateway-grid .unit-card:nth-child(2) { animation-delay: 0.05s; }
.unit-gateway-grid .unit-card:nth-child(3) { animation-delay: 0.08s; }
.unit-gateway-grid .unit-card:nth-child(4) { animation-delay: 0.11s; }
.unit-gateway-grid .unit-card:nth-child(5) { animation-delay: 0.14s; }
.unit-gateway-grid .unit-card:nth-child(6) { animation-delay: 0.17s; }
.unit-gateway-grid .unit-card:nth-child(7) { animation-delay: 0.20s; }
.unit-gateway-grid .unit-card:nth-child(8) { animation-delay: 0.23s; }

.unit-gateway-grid .unit-card .unit-icon-wrapper {
  grid-area: icon;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--unit-soft), rgba(255,255,255,0.96));
  color: var(--unit-accent);
  border: 1px solid rgba(var(--unit-rgb), 0.26);
  box-shadow: 0 10px 24px rgba(var(--unit-rgb), 0.15), inset 0 1px 0 rgba(255,255,255,0.92);
}

.unit-gateway-grid .unit-card .unit-badge {
  grid-area: badge;
  align-self: center;
  justify-self: start;
  max-width: 100%;
  background: rgba(var(--unit-rgb), 0.1);
  color: var(--unit-accent);
  border-color: rgba(var(--unit-rgb), 0.18);
}

.unit-gateway-grid .unit-card h3 {
  grid-area: title;
  font-size: 1rem;
  line-height: 1.2;
}

.unit-gateway-grid .unit-card p {
  grid-area: copy;
  font-size: 0.82rem;
  line-height: 1.5;
  -webkit-line-clamp: 2;
}

.unit-gateway-grid .unit-card .unit-footer {
  grid-area: footer;
  min-width: 0;
  padding: 0.72rem 0 0;
  border-top: 1px solid rgba(var(--unit-rgb), 0.14);
  color: #64748b;
}

.unit-gateway-grid .unit-card .unit-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-gateway-grid .unit-card .unit-footer i { color: var(--unit-accent); }
.unit-gateway-grid .unit-card:hover .unit-icon-wrapper { transform: translateY(-3px) scale(1.08) rotate(-3deg); }
.unit-gateway-grid .unit-card:hover .unit-footer i { color: var(--unit-accent); transform: translateX(6px); }

.unit-gateway-grid .unit-acc { --unit-accent:#d97706; --unit-accent-2:#f59e0b; --unit-rgb:217,119,6; --unit-soft:#fff7ed; }
.unit-gateway-grid .unit-agropro { --unit-accent:#16a34a; --unit-accent-2:#65a30d; --unit-rgb:22,163,74; --unit-soft:#f0fdf4; }
.unit-gateway-grid .unit-crm { --unit-accent:#2563eb; --unit-accent-2:#06b6d4; --unit-rgb:37,99,235; --unit-soft:#eff6ff; }
.unit-gateway-grid .unit-sch { --unit-accent:#db2777; --unit-accent-2:#f59e0b; --unit-rgb:219,39,119; --unit-soft:#fdf2f8; }
.unit-gateway-grid .unit-hr { --unit-accent:#059669; --unit-accent-2:#14b8a6; --unit-rgb:5,150,105; --unit-soft:#ecfdf5; }
.unit-gateway-grid .unit-inv { --unit-accent:#7c3aed; --unit-accent-2:#2563eb; --unit-rgb:124,58,237; --unit-soft:#f5f3ff; }
.unit-gateway-grid .unit-marketing-hub { --unit-accent:#be185d; --unit-accent-2:#f97316; --unit-rgb:190,24,93; --unit-soft:#fdf2f8; }
.unit-gateway-grid .unit-payroll { --unit-accent:#4f46e5; --unit-accent-2:#0891b2; --unit-rgb:79,70,229; --unit-soft:#eef2ff; }
.unit-gateway-grid .unit-pos { --unit-accent:#0284c7; --unit-accent-2:#22c55e; --unit-rgb:2,132,199; --unit-soft:#f0f9ff; }
.unit-gateway-grid .unit-propertypro { --unit-accent:#4f46e5; --unit-accent-2:#7c3aed; --unit-rgb:79,70,229; --unit-soft:#eef2ff; }
.unit-gateway-grid .unit-ch { --unit-accent:#7c3aed; --unit-accent-2:#ec4899; --unit-rgb:124,58,237; --unit-soft:#f5f3ff; }
.unit-gateway-grid .unit-timetracker { --unit-accent:#0891b2; --unit-accent-2:#2563eb; --unit-rgb:8,145,178; --unit-soft:#ecfeff; }
.unit-gateway-grid .unit-proc { --unit-accent:#0d9488; --unit-accent-2:#65a30d; --unit-rgb:13,148,136; --unit-soft:#f0fdfa; }
.unit-gateway-grid .unit-foodpro { --unit-accent:#15803d; --unit-accent-2:#ca8a04; --unit-rgb:21,128,61; --unit-soft:#f0fdf4; }
.unit-gateway-grid .unit-hc { --unit-accent:#dc2626; --unit-accent-2:#db2777; --unit-rgb:220,38,38; --unit-soft:#fef2f2; }
.unit-gateway-grid .unit-hotel { --unit-accent:#ea580c; --unit-accent-2:#d97706; --unit-rgb:234,88,12; --unit-soft:#fff7ed; }
.unit-gateway-grid .unit-mkt { --unit-accent:#16a34a; --unit-accent-2:#0284c7; --unit-rgb:22,163,74; --unit-soft:#f0fdf4; }
.unit-gateway-grid .unit-roster { --unit-accent:#4f46e5; --unit-accent-2:#db2777; --unit-rgb:79,70,229; --unit-soft:#eef2ff; }
.unit-gateway-grid .unit-logistics { --unit-accent:#0e7490; --unit-accent-2:#2563eb; --unit-rgb:14,116,144; --unit-soft:#ecfeff; }
.unit-gateway-grid .unit-carepro { --unit-accent:#0f766e; --unit-accent-2:#059669; --unit-rgb:15,118,110; --unit-soft:#f0fdfa; }
.unit-gateway-grid .unit-homesafe { --unit-accent:#c2410c; --unit-accent-2:#dc2626; --unit-rgb:194,65,12; --unit-soft:#fff7ed; }
.unit-gateway-grid .unit-treasury { --unit-accent:#0369a1; --unit-accent-2:#4f46e5; --unit-rgb:3,105,161; --unit-soft:#f0f9ff; }
.unit-gateway-grid .unit-fleettrack { --unit-accent:#4338ca; --unit-accent-2:#0891b2; --unit-rgb:67,56,202; --unit-soft:#eef2ff; }
.unit-gateway-grid .unit-ai { --unit-accent:#6d28d9; --unit-accent-2:#2563eb; --unit-rgb:109,40,217; --unit-soft:#f5f3ff; }
.unit-gateway-grid .unit-design-studio { --unit-accent:#c026d3; --unit-accent-2:#f97316; --unit-rgb:192,38,211; --unit-soft:#fdf4ff; }
.unit-gateway-grid .unit-cyber { --unit-accent:#047857; --unit-accent-2:#0f172a; --unit-rgb:4,120,87; --unit-soft:#ecfdf5; }

.sidebar-nav .nav-link.has-submenu::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.3s;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
}

.sidebar:hover .sidebar-nav .nav-link.has-submenu::after {
  opacity: 1;
}

.sidebar-nav .nav-link.has-submenu.open::after {
  transform: rotate(180deg);
}

.sidebar-nav .submenu {
  display: none;
  list-style: none;
  padding-left: 2.5rem;
  margin-bottom: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 1.2rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar-nav li.pinned-submenu {
  position: relative;
}

.sidebar-nav .submenu.pin-visible {
  /* controlled by collapsed/expanded rules above */
}

.sidebar:hover .sidebar-nav .submenu {
  opacity: 1;
  max-height: 9999px;
}

.sidebar-nav .submenu.open {
  display: block;
  opacity: 1;
  max-height: 9999px;
  animation: slideDown 0.3s ease-out;
}

.sidebar-nav .submenu-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.42rem 0.5rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  border-radius: 7px;
}

.sidebar-nav .submenu-link:hover {
  color: #ffffff;
  background: linear-gradient(90deg, #ff0f9b 0%, #ff4bb8 100%);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.95), 0 4px 12px rgba(255, 15, 155, 0.35);
  padding-left: 0.75rem;
}

.sidebar-nav .submenu-link.active {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.14);
  font-weight: 600;
}

.sidebar-nav .submenu-link::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
  transition: background 0.2s;
}

.sidebar-nav .submenu-link:hover::before {
  background: rgba(255, 255, 255, 0.65);
}

.sidebar-nav .submenu-link.active::before {
  background: #818cf8;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Landing Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.next-steps-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 2.5rem;
  background: linear-gradient(90deg, rgba(15,23,42,0.02), rgba(37,99,235,0.03));
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
}

.next-step-item {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #0f172a;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.next-step-item span.next-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.75rem;
}

.next-step-item span.next-step-label {
  font-weight: 600;
  white-space: nowrap;
}

.next-step-item:hover {
  background: rgba(148, 163, 184, 0.14);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-info h4 { margin: 0; font-size: 2rem; font-weight: 800; color: #1e293b; }
.stat-info p { margin: 0; color: #64748b; font-size: 0.875rem; font-weight: 500; }

/* Module Section Handling */
.module-section { 
  display: none; 
  animation: fadeIn 0.4s ease-out;
  position: relative;
}

.module-section.active { 
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.module-title-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.module-section iframe { 
  width: 100%; 
  min-height: 85vh; 
  border-radius: 20px; 
  border: 1px solid rgba(99,102,241,0.25); 
  background: #fff; 
  box-shadow: 0 0 0 1px rgba(99,102,241,0.15), var(--card-shadow);
  display: block;
  -webkit-clip-path: inset(0 round 20px);
  clip-path: inset(0 round 20px);
}

/* Module loading skeleton */
.module-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: #f8fafc;
  border-radius: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.module-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.module-loader-bar {
  width: 260px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.module-loader-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--erp-primary), #38bdf8);
  animation: loaderSlide 1.2s ease-in-out infinite;
}

@keyframes loaderSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.module-loader-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.module-loader-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 70%;
  max-width: 520px;
  margin-top: 0.5rem;
}

.module-loader-skeleton span {
  display: block;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.module-loader-skeleton span:nth-child(1) { width: 100%; }
.module-loader-skeleton span:nth-child(2) { width: 80%; }
.module-loader-skeleton span:nth-child(3) { width: 60%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 1100px) {
  .sidebar { 
    width: 100%; 
    height: auto; 
    top: 0; 
    position: relative; 
    border-right: none; 
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
  }
  .sidebar-nav ul {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .sidebar-nav .nav-link { margin-bottom: 0; }
  .main-content { padding: 1rem 1rem 0.75rem; margin-left: 0; width: 100%; }

  /* Modules: 3 columns on tablet */
  .unit-gateway-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .unit-card {
    min-width: 0;
    max-width: none;
    padding: 1.2rem;
  }

  /* Next-steps strip wraps more gracefully */
  .next-steps-strip {
    border-radius: 16px;
    padding: 0.5rem;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--navbar-height);
    left: -100%;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    background: white;
    flex-direction: column;
    padding: 2rem;
    transition: 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex !important;
  }

  .nav-menu.active {
    left: 0;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .nav-auth-buttons {
    display: none !important;
  }

  /* Modules: 2 columns on mobile */
  .unit-gateway-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-left: 0;
  }

  .unit-card {
    min-width: 0;
    max-width: none;
    padding: 1.2rem;
    border-radius: 14px;
  }

  .unit-card h3 {
    font-size: 0.85rem;
  }

  .unit-card p {
    font-size: 0.7rem;
    line-height: 1.35;
  }

  /* Smaller icon wrapper on mobile */
  .unit-icon-wrapper {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  /* Stack next-steps vertically */
  .next-steps-strip {
    flex-direction: column;
    border-radius: 14px;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .next-step-item {
    flex: 1 1 auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }

  /* Stat cards stack better */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }
}

/* Compact Footer for ERP */

/* ── Actions Band ── */
.erp-actions-band {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.4rem 1.5rem;
  margin: 3rem 0 0; /* Added generous top margin */
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ff 100%);
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.erp-actions-band-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  background: white;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.erp-actions-band-item i {
  font-size: 0.9rem;
  color: var(--erp-primary);
  transition: transform 0.2s ease;
}

.erp-actions-band-item:hover {
  background: var(--erp-primary);
  color: white;
  border-color: var(--erp-primary);
  box-shadow: 0 6px 20px rgba(99,102,241,0.25);
  transform: translateY(-2px);
}

.erp-actions-band-item:hover i {
  color: white;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .erp-actions-band {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 1.2rem 1rem;
  }
  .erp-actions-band-item {
    justify-content: center;
    padding: 0.75rem 1rem;
  }
}

.footer { padding: 0; }
.footer-content { gap: 2rem; margin-bottom: 0; }
.footer-section h3 { margin-bottom: 0.75rem; font-size: 1.15rem; color: var(--erp-primary); }
.footer-section p, .footer-section a { margin-bottom: 0.5rem; line-height: 1.6; font-size: 0.95rem; }
.footer-bottom { padding-top: 0; }

/* Sidebar Logo Area */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.sidebar-logo i {
  font-size: 1.5rem;
  color: #6366f1;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
}

/* Tooltip for collapsed sidebar */
.sidebar-nav .nav-link .tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--erp-sidebar-bg);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sidebar:not(:hover) .sidebar-nav .nav-link:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Colored sidebar dividers */
.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  margin: 1rem 0;
}

/* User profile section at bottom */
.sidebar-profile {
  margin-top: auto;
  padding: 1rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-profile-info {
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.sidebar-profile-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.sidebar-profile-role {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  white-space: nowrap;
}

/* Mobile sidebar adjustments */
@media (max-width: 768px) {
  :root {
    --navbar-height: 56px; /* util-bar hidden on mobile */
  }
  .sidebar {
    width: 0;
    z-index: 999;
  }
  
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* App-switcher: touch-friendly size on mobile */
  .erp-app-switcher {
    width: 40px;
    height: 40px;
  }
}

/* Legacy collapsed-state overrides — hide text when sidebar is narrow */
.sidebar:not(:hover) .sidebar-header {
  opacity: 0;
  visibility: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar:not(:hover) .sidebar-profile-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}




/* ---------------------------------------------------- */
/* Sidebar Status Visibility Rules                      */
/* ---------------------------------------------------- */

/* Default: Collapsed State */
.sidebar:not(:hover) .status-text {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
}

.sidebar:not(:hover) .status-dot {
  display: none !important; /* Hide dot in favor of check icon when collapsed */
}

.sidebar:not(:hover) .status-icon {
  display: flex !important;
  font-size: 1.4rem;
  color: #10b981;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 auto;
}

/* Expanded State */
.sidebar:hover .status-text {
  display: inline-block !important;
  opacity: 1 !important;
  width: auto !important;
  white-space: nowrap;
}

.sidebar:hover .status-dot {
  display: inline-block !important;
}

.sidebar:hover .status-icon {
  display: none !important; /* Hide check icon when expanded to show full pill */
}

/* Ensure container centers the icon when collapsed */
.sidebar:not(:hover) .sidebar-status > div > div {
  justify-content: center;
}

/* ══════════════════════════════════════════════════
   MODERN SIDEBAR ENHANCEMENTS
   - Per-module always-on icon colours with pill bg
   - Larger, clearer nav labels
   - Styled submenu group separators
   ══════════════════════════════════════════════════ */

/* Per-module icon colours — icon symbol coloured, no background in normal state */
.sidebar-nav .nav-link[href*="#hr"] i            { color: #10b981; background: rgba(16,185,129,0.12); }
.sidebar-nav .nav-link[href*="#crm"] i           { color: #3b82f6; background: rgba(59,130,246,0.12); }
.sidebar-nav .nav-link[href*="#accounting"] i    { color: #f59e0b; background: rgba(245,158,11,0.12); }
.sidebar-nav .nav-link[href*="#inventory"] i     { color: #8b5cf6; background: rgba(139,92,246,0.12); }
.sidebar-nav .nav-link[href*="#procurement"] i   { color: #14b8a6; background: rgba(20,184,166,0.12); }
.sidebar-nav .nav-link[href*="#treasury"] i      { color: #34d399; background: rgba(52,211,153,0.12); }
.sidebar-nav .nav-link[href*="#school"] i        { color: #ec4899; background: rgba(236,72,153,0.12); }
.sidebar-nav .nav-link[href*="#ngo"] i           { color: #818cf8; background: rgba(129,140,248,0.12); }
.sidebar-nav .nav-link[href*="#healthcare"] i    { color: #f87171; background: rgba(248,113,113,0.12); }
.sidebar-nav .nav-link[href*="#hotel"] i         { color: #fb923c; background: rgba(251,146,60,0.12); }
.sidebar-nav .nav-link[href*="#foodpro"] i       { color: #22d3ee; background: rgba(34,211,238,0.12); }
.sidebar-nav .nav-link[href*="#agropro"] i       { color: #4ade80; background: rgba(74,222,128,0.12); }
.sidebar-nav .nav-link[href*="#pos"] i           { color: #a3e635; background: rgba(163,230,53,0.12); }
.sidebar-nav .nav-link[href*="#marketplace"] i   { color: #22c55e; background: rgba(34,197,94,0.12); }
.sidebar-nav .nav-link[href*="#logistics"] i     { color: #38bdf8; background: rgba(56,189,248,0.12); }
.sidebar-nav .nav-link[href*="#carepro"] i       { color: #2dd4bf; background: rgba(45,212,191,0.12); }
.sidebar-nav .nav-link[href*="#church"] i        { color: #c084fc; background: rgba(192,132,252,0.12); }
.sidebar-nav .nav-link[href*="#homecare"] i      { color: #fb923c; background: rgba(251,146,60,0.12); }

/* On hover — add a subtle tinted pill behind each coloured icon */
.sidebar-nav .nav-link[href*="#hr"]:hover i, .sidebar-nav .nav-link[href*="#hr"].active i { background: rgba(16,185,129,0.12); }
.sidebar-nav .nav-link[href*="#crm"]:hover i, .sidebar-nav .nav-link[href*="#crm"].active i { background: rgba(59,130,246,0.12); }
.sidebar-nav .nav-link[href*="#accounting"]:hover i, .sidebar-nav .nav-link[href*="#accounting"].active i { background: rgba(245,158,11,0.12); }
.sidebar-nav .nav-link[href*="#inventory"]:hover i, .sidebar-nav .nav-link[href*="#inventory"].active i { background: rgba(139,92,246,0.12); }
.sidebar-nav .nav-link[href*="#procurement"]:hover i, .sidebar-nav .nav-link[href*="#procurement"].active i { background: rgba(20,184,166,0.12); }
.sidebar-nav .nav-link[href*="#treasury"]:hover i, .sidebar-nav .nav-link[href*="#treasury"].active i { background: rgba(52,211,153,0.12); }
.sidebar-nav .nav-link[href*="#school"]:hover i, .sidebar-nav .nav-link[href*="#school"].active i { background: rgba(236,72,153,0.12); }
.sidebar-nav .nav-link[href*="#ngo"]:hover i, .sidebar-nav .nav-link[href*="#ngo"].active i { background: rgba(129,140,248,0.12); }
.sidebar-nav .nav-link[href*="#healthcare"]:hover i, .sidebar-nav .nav-link[href*="#healthcare"].active i { background: rgba(248,113,113,0.12); }
.sidebar-nav .nav-link[href*="#hotel"]:hover i, .sidebar-nav .nav-link[href*="#hotel"].active i { background: rgba(251,146,60,0.12); }
.sidebar-nav .nav-link[href*="#foodpro"]:hover i, .sidebar-nav .nav-link[href*="#foodpro"].active i { background: rgba(34,211,238,0.12); }
.sidebar-nav .nav-link[href*="#agropro"]:hover i, .sidebar-nav .nav-link[href*="#agropro"].active i { background: rgba(74,222,128,0.12); }
.sidebar-nav .nav-link[href*="#pos"]:hover i, .sidebar-nav .nav-link[href*="#pos"].active i { background: rgba(163,230,53,0.12); }
.sidebar-nav .nav-link[href*="#marketplace"]:hover i, .sidebar-nav .nav-link[href*="#marketplace"].active i { background: rgba(34,197,94,0.12); }
.sidebar-nav .nav-link[href*="#logistics"]:hover i, .sidebar-nav .nav-link[href*="#logistics"].active i { background: rgba(56,189,248,0.12); }
.sidebar-nav .nav-link[href*="#carepro"]:hover i, .sidebar-nav .nav-link[href*="#carepro"].active i { background: rgba(45,212,191,0.12); }
.sidebar-nav .nav-link[href*="#church"]:hover i, .sidebar-nav .nav-link[href*="#church"].active i { background: rgba(192,132,252,0.12); }
.sidebar-nav .nav-link[href*="#homecare"]:hover i, .sidebar-nav .nav-link[href*="#homecare"].active i { background: rgba(251,146,60,0.12); }

/* Hover & active glow and scale */
.sidebar-nav .nav-link:hover i { transform: scale(1.1); }
.sidebar-nav .nav-link.active i { filter: brightness(1.2) drop-shadow(0 0 5px currentColor); }

/* Main label text inside nav-link div */
.sidebar-nav .nav-link > div > span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Sub-label text (e.g. "Human Resources", "powered by Elinom") */
.sidebar-nav .nav-link > div > span:last-child {
  font-size: 0.72rem !important;
  opacity: 0.65;
}

/* Submenu group separator headers (uppercase labels like BANKING, SALES & REVENUE) */
.sidebar-nav .submenu li[style*="pointer-events:none"],
.sidebar-nav .submenu li[style*="pointer-events: none"] {
  font-size: 0.7rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: 0.1em !important;
  padding: 6px 8px 2px !important;
  margin-top: 4px;
}

/* Wider submenu left gutter for accounting (long text items) */
#accountingSubmenu {
  padding-left: 0.5rem;
}

/* Accounting submenu — section-coloured dot (colour injected via JS --acct-dot) */
#accountingSubmenu .submenu-link::before {
  background: var(--acct-dot, rgba(255, 255, 255, 0.22));
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE OVERRIDES — Dashboard-specific
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .unit-gateway-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}
@media (max-width: 480px) {
  .unit-gateway-grid {
    grid-template-columns: 1fr !important;
  }
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  .main-content { padding: 12px; }
  .card-body { padding: 12px; }
}
