@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.08);
  --secondary: #10b981;
  --secondary-hover: #059669;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Base resets */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  font-size: 13px; /* Smaller base font for roughly 75-80% scaling */
}

body {
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Screen management */
.screen { display: none; height: 100vh; width: 100%; transition: opacity 0.3s ease; }
.screen.active { display: flex; animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* LOGIN SCREEN */
#login-screen {
  background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              #f1f5f9;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-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.5);
  padding: 32px;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.02);
  text-align: center;
}

.logo { 
  font-size: 6.5rem; 
  color: var(--primary); 
  margin-bottom: 24px; 
  filter: drop-shadow(0 15px 25px rgba(99, 102, 241, 0.3));
  animation: float 4s ease-in-out infinite;
  display: inline-block;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.login-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #1e1b4b;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #1e1b4b 0%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
  font-weight: 500;
}

/* LOGIN FORM ENHANCEMENTS */
.login-card .form-group {
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

.login-card .form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  margin-left: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-card .form-group label i {
  color: var(--primary);
  font-size: 0.9rem;
}

.login-card .form-input, 
.login-card input[type="text"], 
.login-card input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(241, 245, 249, 0.5);
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  outline: none;
}

.login-card .form-input:hover,
.login-card input:hover {
  background: rgba(241, 245, 249, 0.8);
}

.login-card .form-input:focus,
.login-card input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-2px);
}

.btn-login {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}

.btn-login:active {
  transform: translateY(-1px);
}

.btn-login i {
  transition: transform 0.3s ease;
}

.btn-login:hover i {
  transform: translateX(5px);
}

.login-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.login-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: #f1f5f9;
  color: #475569;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%; width: 0; height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::after { width: 300%; height: 300%; }

.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4); }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4); }
.btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4); }
.btn-accent { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4); }

.btn-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #fff; border: 1.2px solid #e2e8f0;
  color: var(--text-muted); transition: all 0.2s;
  font-size: 0.85rem;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); transform: scale(1.05); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, 0.05); }

/* SIDEBAR */
.sidebar {
  width: 240px; background: var(--bg-sidebar); border-right: 1px solid #e2e8f0;
  display: flex; flex-direction: column; padding: 16px; z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800; color: var(--primary);
  margin-bottom: 24px; padding-left: 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  text-decoration: none; color: var(--text-muted); border-radius: 12px;
  font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active { background: var(--primary-light); color: var(--primary); }

/* TOP BAR */
.top-bar {
  height: 60px; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 32px; }
.stat-card {
  background: #fff; padding: 24px; border-radius: 20px; border: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 20px; transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.stat-icon.blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); color: #3b82f6; }
.stat-icon.green { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: #10b981; }
.stat-icon.orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); color: #f59e0b; }
.stat-icon.purple { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: #8b5cf6; }
.stat-icon.gray { background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); color: #64748b; }

.stat-info .label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.stat-info .value { display: block; font-size: 1.65rem; font-weight: 800; color: var(--text-main); line-height: 1; }

/* BADGES */
.badge {
  padding: 4px 10px; border-radius: 6px; font-size: 0.65rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase;
}
.badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.badge-approved { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }
.badge-rejected { background: #fff1f2; color: #be123c; border: 1px solid #ffe4e6; }

/* TABLE */
.card { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-header h3 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 12px 20px; background: #f8fafc; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
td { padding: 12px 20px; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem; vertical-align: middle; }
.td-actions { text-align: right; }

/* SEARCH CONTAINER */
.search-container {
  display: flex; align-items: center; gap: 8px; background: #f8fafc;
  padding: 2px; border-radius: 10px; border: 1.2px solid #e2e8f0; transition: all 0.2s;
}
.search-container:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.search-container i { color: var(--text-muted); margin-left: 10px; }
.search-container input { border: none; background: transparent; padding: 6px 4px; font-family: inherit; font-size: 0.85rem; outline: none; flex-grow: 1; }
.btn-search { background: var(--primary); color: white; border: none; padding: 6px 14px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.85rem; }

/* MODALS */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px);
  display: none; z-index: 1000; justify-content: center; align-items: center; padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal { background: #fff; width: 100%; max-width: 650px; border-radius: 24px; animation: slideUp 0.3s ease-out; overflow: hidden; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 24px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 32px; overflow-y: auto; max-height: 85vh; }

/* FORM */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.8rem; color: #475569; }
.form-input { width: 100%; padding: 10px 14px; border: 1.2px solid #e2e8f0; border-radius: 10px; font-size: 0.9rem; transition: all 0.2s; outline: none; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }

/* USER PROFILE */
.user-profile { display: flex; align-items: center; gap: 16px; }
.user-info { display: flex; flex-direction: column; align-items: flex-end; }
.user-info .name { font-size: 1rem; font-weight: 700; color: #1e293b; }
.user-info .role { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: capitalize; }
.avatar { width: 44px; height: 44px; background: var(--primary-light); color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transition: all 0.2s; }
.avatar:hover { background: var(--primary); color: #fff; transform: rotate(5deg); }

.menu-toggle {
  display: none; cursor: pointer; font-size: 1.25rem; color: var(--text-main);
  width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: 12px; transition: background 0.2s; background: #f8fafc;
}

.sidebar-overlay { 
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 95; 
}

/* RESPONSIVE */
@media (max-width: 992px) {
  .top-bar { padding: 0 20px; }
  .menu-toggle { display: flex; }
  .sidebar { position: fixed; left: -280px; top: 0; bottom: 0; width: 280px; box-shadow: 20px 0 50px rgba(0,0,0,0.1); z-index: 100; }
  .sidebar.active { left: 0; }
  .sidebar-overlay.active { display: block; }
}

@media (max-width: 576px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 24px 20px; }
  .user-info { display: none; }
  .card-header { flex-direction: column; align-items: stretch; }
  .search-container { width: 100%; }
}

.content-scroll { flex-grow: 1; overflow-y: auto; padding: 20px; scroll-behavior: smooth; }
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); animation: slideLeft 0.3s forwards; }
@keyframes slideLeft { from { transform: translateX(100%); } to { transform: translateX(0); } }
