*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --navy: #0f2340;
  --navy2: #1a3158;
  --navy3: #1e3d6e;
  --blue: #2563eb;
  --blue-lt: #dbeafe;
  --green: #16a34a;
  --green-lt: #dcfce7;
  --red: #dc2626;
  --red-lt: #fee2e2;
  --amber: #d97706;
  --amber-lt: #fef3c7;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --white: #fff;
  --font: "DM Sans", system-ui, sans-serif;
  --r: 8px;
  --r2: 12px;
  --r3: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.18);
  --sw: 248px;
}
html {
  font-size: 14px;
}
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--blue);
  text-decoration: none;
}
#app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sw);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.25s ease;
  overflow: hidden;
}
.sb-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-logo-ico {
  width: 34px;
  height: 34px;
  border-radius: var(--r);
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sb-logo h1 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.sb-logo span {
  font-size: 10px;
  opacity: 0.45;
}
.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar {
  display: none;
}
.sb-sec {
  padding: 10px 14px 2px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.28);
  margin-top: 4px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.sb-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-left-color: #60a5fa;
}
.sb-item .si {
  font-size: 14px;
  width: 17px;
  text-align: center;
  flex-shrink: 0;
}
.sb-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
}
.sb-user {
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 9px;
}
.sb-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  color: #fff;
}
.sb-uinfo {
  flex: 1;
  min-width: 0;
}
.sb-uname {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-urole {
  font-size: 10px;
  opacity: 0.4;
  text-transform: capitalize;
}
.sb-out {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 15px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.sb-out:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}
.main {
  margin-left: var(--sw);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar h2 {
  font-size: 15.5px;
  font-weight: 700;
}
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
#menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-600);
  padding: 5px;
  border-radius: var(--r);
}
.content {
  padding: 20px 22px;
  flex: 1;
}
.page {
  display: none;
}
.page.active {
  display: block;
}
#login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a70 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--r3);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}
.login-hdr {
  background: linear-gradient(135deg, #0f2340, #1e3d6e);
  padding: 28px 30px 24px;
}
.login-hdr .lico {
  font-size: 28px;
  margin-bottom: 8px;
}
.login-hdr h1 {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 3px;
}
.login-hdr p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12.5px;
}
.login-body {
  padding: 24px 30px 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7.5px 14px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.2;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover {
  background: var(--navy3);
}
.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-success:hover {
  filter: brightness(0.9);
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(0.9);
}
.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-outline:hover {
  background: var(--gray-50);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border: none;
}
.btn-ghost:hover {
  background: var(--gray-100);
}
.btn-sm {
  padding: 5.5px 12px;
  font-size: 12px;
}
.btn-xs {
  padding: 3.5px 8px;
  font-size: 11px;
}
.btn-full {
  width: 100%;
  justify-content: center;
  padding: 10px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.card-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 7px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 11px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r2);
  padding: 15px 16px;
  transition: box-shadow 0.15s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
}
.stat-ico {
  font-size: 18px;
  margin-bottom: 6px;
}
.stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}
.stat-lbl {
  font-size: 10.5px;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.stat-sub {
  font-size: 10.5px;
  color: var(--gray-400);
  margin-top: 1px;
}
.stat-dark {
  background: var(--navy);
  border-color: var(--navy);
  cursor: pointer;
}
.stat-dark .stat-val,
.stat-dark .stat-lbl,
.stat-dark .stat-sub {
  color: #fff;
}
.stat-dark .stat-lbl {
  opacity: 0.55;
}
.tbl-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  border: 1px solid var(--gray-200);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
thead {
  background: var(--gray-50);
}
th {
  text-align: left;
  padding: 9px 13px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  font-weight: 700;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 10px 13px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background 0.1s;
}
tbody tr:hover td {
  background: var(--gray-50);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.b-pending {
  background: #fef3c7;
  color: #78350f;
  text-transform: capitalize;
}
.b-pending::before {
  background: #f59e0b;
  text-transform: capitalize;
}
.b-approved {
  background: #dcfce7;
  color: #14532d;
  text-transform: capitalize;
}
.b-approved::before {
  background: #16a34a;
  text-transform: capitalize;
}
.b-rejected {
  background: #fee2e2;
  color: #7f1d1d;
  text-transform: capitalize;
}
.b-rejected::before {
  background: #dc2626;
  text-transform: capitalize;
}
.b-cancelled {
  background: var(--gray-100);
  color: var(--gray-500);
  text-transform: capitalize;
}
.b-cancelled::before {
  background: var(--gray-400);
  text-transform: capitalize;
}
.rbadge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}
.r-employee {
  background: #dbeafe;
  color: #1e40af;
}
.r-manager {
  background: #ede9fe;
  color: #5b21b6;
}
.r-hr {
  background: #fce7f3;
  color: #9d174d;
}
.r-it_admin {
  background: #d1fae5;
  color: #065f46;
}
.fg {
  margin-bottom: 13px;
}
.fg label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fc {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-800);
  transition:
    border 0.15s,
    box-shadow 0.15s;
}
.fc:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.frow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fhelp {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--r2);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.2s;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}
.modal-hdr {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-hdr h3 {
  font-size: 14.5px;
  font-weight: 800;
}
.modal-cls {
  background: none;
  border: none;
  font-size: 17px;
  color: var(--gray-400);
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
}
.modal-cls:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.modal-body {
  padding: 18px 20px;
}
.modal-ftr {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--gray-50);
  border-radius: 0 0 var(--r2) var(--r2);
}
.alert {
  padding: 10px 13px;
  border-radius: var(--r);
  font-size: 12.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}
.alert-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.alert.hidden {
  display: none !important;
}
.bal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.bal-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r2);
  padding: 16px;
  transition: box-shadow 0.15s;
}
.bal-card:hover {
  box-shadow: var(--shadow-md);
}
.bal-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}
.bal-val {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1px;
}
.bal-sub {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.bal-bar {
  background: var(--gray-100);
  border-radius: 99px;
  height: 4px;
  overflow: hidden;
}
.bal-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.bal-nums {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--gray-400);
  margin-top: 5px;
}
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--gray-400);
}
.empty-ico {
  font-size: 32px;
  margin-bottom: 8px;
}
.empty p {
  font-size: 13px;
}
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.progress {
  background: var(--gray-100);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
}
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-row {
  display: flex;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12.5px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-lbl {
  width: 125px;
  color: var(--gray-400);
  flex-shrink: 0;
  font-weight: 500;
}
.detail-val {
  flex: 1;
  font-weight: 600;
}
.tag {
  display: inline-block;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
}
.pw-note {
  font-size: 12px;
  color: var(--amber);
  background: #fef3c7;
  padding: 9px 12px;
  border-radius: var(--r);
  margin-bottom: 13px;
  border-left: 3px solid var(--amber);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.overlay-bg {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}
.overlay-bg.open {
  display: block;
}
.days-preview {
  background: var(--blue-lt);
  color: #1e3a8a;
  border-radius: var(--r);
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
  display: none;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .frow {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 14px;
  }
  .topbar {
    padding: 10px 14px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  #menu-btn {
    display: block !important;
  }
}

/* Active navigation item styles */
.sb-item.active {
  background: var(--primary, #3b82f6) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sb-item.active .si {
  /* Icon stays white */
}

.sb-item:hover {
  opacity: 0.8;
}

.sb-item.active:hover {
  background: var(--primary, #3b82f6) !important;
}

/* Alternative: Different colors for different sections */
.sb-item.active-dashboard { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-apply { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-my-leaves { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-handbooks { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-my-documents { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-directory { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-approvals { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-all-leaves { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-employees { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-balances-mgmt { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-doc-management { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-reset-users { background: #3b82f6 !important; color: #fff !important; }
.sb-item.active-profile { background: #3b82f6 !important; color: #fff !important; }
