/* ERP Specific Styles */
body.erp-auth-page {
  background: linear-gradient(-45deg, var(--secondary), #e0e7ff, #c7d2fe, var(--secondary));
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.erp-auth-shapes {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.shape {
  position: absolute;
  filter: blur(80px);
  border-radius: 50%;
  opacity: 0.6;
}
.shape-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; left: -100px; animation: float 6s ease-in-out infinite; }
.shape-2 { width: 300px; height: 300px; background: var(--accent); bottom: -50px; right: -50px; animation: float 8s ease-in-out infinite reverse; }

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.erp-auth-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  width: 90%;
  max-width: 450px;
  padding: 40px;
  position: relative;
  z-index: 1;
  max-height: 95vh;
  overflow-y: auto;
}

.erp-auth-card.wide {
  max-width: 800px;
}

/* Custom Scrollbar for auth card */
.erp-auth-card::-webkit-scrollbar { width: 6px; }
.erp-auth-card::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }

.erp-auth-header {
  text-align: center;
  margin-bottom: 30px;
}
.erp-auth-logo {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(0,0,0,0.05);
  overflow: hidden;
}
.erp-auth-header h2 {
  font-family: var(--font-primary);
  font-weight: 800;
  color: #021226;
  margin-bottom: 8px;
}
.erp-auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.erp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media(max-width:600px) { .erp-form-grid { grid-template-columns: 1fr; } }

.erp-file-upload {
  border: 2px dashed rgba(0,0,0,0.2);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8fafc;
}
.erp-file-upload:hover { border-color: var(--primary); background: rgba(11,61,145,0.05); }

.erp-alert {
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.erp-alert-error {
  color: #dc2626;
  background: #fef2f2;
}
.erp-alert-success {
  color: #16a34a;
  background: #f0fdf4;
}
.erp-alert-warning {
  color: #9a3412;
  background: #fff7ed;
}

/* ============================================================
   ERP DASHBOARD LAYOUT
   ============================================================ */
.erp-layout {
  display: flex;
  min-height: 100vh;
  background: #f4f7fe;
  font-family: var(--font-body);
}

/* Sidebar */
.erp-sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

.erp-sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.erp-sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #1a56b8);
  color: white; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 1.2rem;
}

.erp-sidebar-title {
  font-family: var(--font-primary);
  font-weight: 800; font-size: 1.2rem; color: #021226;
  line-height: 1.1;
}

.erp-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px;
}
.erp-sidebar-nav::-webkit-scrollbar { width: 4px; }
.erp-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.erp-nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 8px;
}
.erp-nav-item:hover {
  background: #f8fafc; color: var(--primary);
}
.erp-nav-item.active {
  background: var(--primary); color: white;
  box-shadow: 0 4px 12px rgba(11, 61, 145, 0.2);
}
.erp-nav-item i { width: 20px; text-align: center; font-size: 1.1rem; }

.erp-sidebar-footer {
  padding: 24px; border-top: 1px solid rgba(0,0,0,0.05);
}

/* Main Content */
.erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: #f4f7fe;
}

.erp-header {
  height: 80px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  position: sticky; top: 0; z-index: 90;
}

.erp-header-left h1 {
  font-family: var(--font-primary); font-size: 1.5rem; font-weight: 700; color: #021226;
}

.erp-header-right {
  display: flex; align-items: center; gap: 20px;
}
.erp-notification-btn {
  width: 44px; height: 44px; border-radius: 50%; background: white;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.02); border: none;
}
.erp-notification-btn:hover { color: var(--primary); }
.erp-notification-badge {
  position: absolute; top: 8px; right: 10px; width: 8px; height: 8px;
  background: #ef4444; border-radius: 50%;
}

.erp-user-profile {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.erp-user-profile img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
}
.erp-user-info h4 { font-size: 0.95rem; font-weight: 600; color: #021226; margin-bottom: 2px;}
.erp-user-info p { font-size: 0.8rem; color: var(--text-muted); }

.erp-content-area {
  padding: 40px; flex: 1;
}

/* Modules Base */
.erp-module { display: none; animation: fadeIn 0.4s ease; }
.erp-module.active { display: block; }

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

/* Cards & Widgets */
.erp-card {
  background: white; border-radius: 20px; padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}
.erp-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.erp-card-title { font-size: 1.1rem; font-weight: 700; color: #021226; }

.erp-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 24px; }
.erp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.erp-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }

.stat-widget {
  background: white; border-radius: 20px; padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  display: flex; align-items: center; gap: 20px;
}
.stat-icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.stat-info h3 { font-size: 1.8rem; font-weight: 800; color: #021226; line-height: 1.2; }
.stat-info p { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

.bg-blue-light { background: #eff6ff; color: #3b82f6; }
.bg-green-light { background: #f0fdf4; color: #22c55e; }
.bg-purple-light { background: #faf5ff; color: #a855f7; }
.bg-orange-light { background: #fff7ed; color: #f97316; }

/* Responsive */
.mobile-menu-btn { display: none; border:none; background:none; font-size:1.5rem; color:var(--text-muted); cursor:pointer; }
@media (max-width: 1024px) {
  .erp-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .erp-sidebar { position: fixed; left: -280px; height: 100vh; }
  .erp-sidebar.show { left: 0; }
  .mobile-menu-btn { display: block; }
  .erp-header { padding: 0 20px; }
  .erp-content-area { padding: 20px; }
  .erp-grid-4, .erp-grid-3, .erp-grid-2 { grid-template-columns: 1fr; }
  .erp-user-info { display: none; }
}
/* ============================================================
   NEW ERP DASHBOARD STYLES (GRID LAYOUT)
   ============================================================ */
.erp-top-nav {
  background: white;
  padding: 16px 24px;
  border-radius: 16px;
  margin: 20px auto;
  max-width: 1200px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}
@media(max-width:768px) { .erp-top-nav { margin: 10px; border-radius: 8px;} }

.erp-profile-banner {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 40px;
  color: white;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.erp-profile-banner::before {
  content: '';
  position: absolute;
  top: -50px; left: -50px;
  width: 300px; height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: -1;
  animation: floatProfile 8s ease-in-out infinite;
}
.erp-profile-banner::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -50px;
  width: 300px; height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: -1;
  animation: floatProfile 10s ease-in-out infinite reverse;
}
@keyframes floatProfile {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(20px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

.erp-profile-img-wrapper {
  position: relative;
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.erp-profile-img-wrapper img {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 5px solid white;
  object-fit: cover;
  object-position: top center;
  background: white;
}
.camera-icon {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 44px; height: 44px;
  background: #10b981;
  border: 4px solid white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
.camera-icon:hover {
  transform: scale(1.1);
  background: #059669;
}

.welcome-text { font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.8); margin-bottom: 8px;}
.erp-profile-info h1 { font-family: var(--font-primary); font-size: 2.5rem; font-weight: 800; margin-bottom: 8px; line-height: 1.1; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.mobile-text { font-size: 1rem; font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.9); }
@media(max-width:768px) { 
  .erp-profile-banner { flex-direction: column; text-align: center; gap: 20px; padding: 30px 20px; }
  .erp-profile-img-wrapper { margin: 0 auto; width: 170px; height: 170px; }
  .mobile-text { justify-content: center; } 
  .erp-profile-info h1 { font-size: 2rem;} 
  .badges-row { justify-content: center; flex-wrap: wrap; }
}

.badges-row { display: flex; gap: 16px; }
.badge-item {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.badge-item i { margin-right: 6px; color: #fbbf24; }

.erp-features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media(max-width:1024px) { .erp-features-grid { grid-template-columns: repeat(3, 1fr); } }
@media(max-width:768px) { .erp-features-grid { grid-template-columns: repeat(2, 1fr); gap: 16px;} }
@media(max-width:480px) { .erp-features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.03);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeUpCard 0.6s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}
@keyframes fadeUpCard {
  to { opacity: 1; transform: translateY(0); }
}
.feature-card:hover { 
  transform: translateY(-8px) scale(1.03); 
  border-color: transparent;
}
.feature-card:hover .icon-box {
  animation: bounceIcon 0.5s ease;
}
@keyframes bounceIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Remove blocky left borders, replace with hover glow */
.feature-card.border-yellow:hover { box-shadow: 0 15px 35px rgba(245, 158, 11, 0.15); }
.feature-card.border-purple:hover { box-shadow: 0 15px 35px rgba(139, 92, 246, 0.15); }
.feature-card.border-blue:hover { box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15); }
.feature-card.border-pink:hover { box-shadow: 0 15px 35px rgba(236, 72, 153, 0.15); }
.feature-card.border-red:hover { box-shadow: 0 15px 35px rgba(239, 68, 68, 0.15); }
.feature-card.border-teal:hover { box-shadow: 0 15px 35px rgba(20, 184, 166, 0.15); }
.feature-card.border-orange:hover { box-shadow: 0 15px 35px rgba(249, 115, 22, 0.15); }
.feature-card.border-gray:hover { box-shadow: 0 15px 35px rgba(100, 116, 139, 0.15); }

.icon-box {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
  transition: transform 0.3s;
}
.bg-yellow-light { background: #fef3c7; } .text-yellow { color: #d97706; }
.bg-purple-light { background: #f3e8ff; } .text-purple { color: #7e22ce; }
.bg-blue-light { background: #eff6ff; } .text-blue { color: #2563eb; }
.bg-pink-light { background: #fce7f3; } .text-pink { color: #db2777; }
.bg-red-light { background: #fef2f2; } .text-red { color: #dc2626; }
.bg-teal-light { background: #ccfbf1; } .text-teal { color: #0f766e; }
.bg-orange-light { background: #ffedd5; } .text-orange { color: #c2410c; }
.bg-gray-light { background: #f1f5f9; } .text-gray { color: #475569; }

.text-green { color: #16a34a !important; font-weight: 600 !important; }
.text-red { color: #ef4444 !important; font-weight: 600 !important; }

.text-box h3 { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 4px; line-height:1.2; }
.text-box p { font-size: 0.85rem; color: #64748b; font-weight: 500; margin:0;}

.locked-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.locked-card .icon-box { filter: grayscale(1); opacity: 0.7; }
.locked-card .lock-icon {
  position: absolute; top: 12px; right: 12px;
  color: #ef4444; background: #fef2f2; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
/* ============================================================
   ERP MODALS (A-Z Functionality)
   ============================================================ */
.erp-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: 0.3s ease;
}
.erp-modal-overlay.active { opacity: 1; pointer-events: auto; }

.erp-modal {
  background: white; width: 90%; max-width: 600px;
  border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.95); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.erp-modal-overlay.active .erp-modal { transform: translateY(0) scale(1); }

.erp-modal-header {
  padding: 24px; border-bottom: 1px solid #e2e8f0;
  display: flex; justify-content: space-between; align-items: center;
  background: #f8fafc;
}
.erp-modal-header h3 { font-family: var(--font-primary); font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.erp-modal-close {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: white; color: #64748b; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: 0.2s;
}
.erp-modal-close:hover { background: #ef4444; color: white; }

.erp-modal-body {
  padding: 24px; overflow-y: auto; flex: 1;
}

/* Modal Content Styles */
.modal-list-item {
  padding: 16px; border-radius: 12px; background: #f8fafc;
  margin-bottom: 12px; display: flex; align-items: center; gap: 16px;
  border: 1px solid #e2e8f0;
}
.modal-list-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.modal-badge { background: #fef9c3; color: #ca8a04; border-color: #fef08a; }
.modal-event { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }

/* Leave Form */
.leave-form-group { margin-bottom: 16px; }
.leave-form-label { display: block; font-size: 0.9rem; font-weight: 600; color: #475569; margin-bottom: 8px; }
.leave-form-input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-family: inherit; }
.leave-form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* Logo Image */
.erp-sidebar-logo-img { height: 40px; width: auto; object-fit: contain; }


.erp-auth-logo-img { width: 90%; height: 90%; object-fit: contain; }

/* Calendar Styles */
.cal-day {
  padding: 15px 5px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  background: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.cal-day:hover { border-color: var(--admin-primary); transform: translateY(-2px); }
.cal-holiday { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }
.cal-event { background: #f0fdf4; color: #22c55e; border-color: #86efac; }
.cal-exam { background: #eff6ff; color: #3b82f6; border-color: #93c5fd; }
.cal-empty { background: transparent; border: none; cursor: default; }
.cal-empty:hover { transform: none; border: none; }

/* ============================================================
   ERP.CSS — MOBILE RESPONSIVE ADDITIONS
   ============================================================ */
@media (max-width: 768px) {
  .erp-top-nav > div { flex-wrap: wrap; gap: 10px; }
  .erp-top-nav h2    { font-size: 1rem; }
  .erp-profile-banner { flex-direction: column; text-align: center; padding: 20px; }
  .erp-profile-banner .badges-row { justify-content: center; flex-wrap: wrap; gap: 8px; }
  .erp-features-grid  { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .erp-modal          { width: 96vw; max-height: 90dvh; }
  .admin-table th, .admin-table td { padding: 10px 10px; font-size: 0.82rem; }
  .erp-form-grid      { grid-template-columns: 1fr; gap: 14px; }
  .erp-auth-card      { padding: 24px 16px; }
  .cal-day            { padding: 10px 3px; font-size: 0.8rem; }
}
@media (max-width: 480px) {
  .erp-features-grid  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .feature-card       { padding: 12px 8px; flex-direction: column; text-align: center; gap: 6px; font-size: 0.85rem; }
  .icon-box           { width: 36px !important; height: 36px !important; }
  .erp-profile-info h1 { font-size: 1.15rem; }
  .erp-modal          { border-radius: 16px; }
}
