:root {
  --w2i-navy: #2E3092;
  --w2i-navy-dark: #23256e;
  --w2i-orange: #F58220;
  --w2i-orange-light: #ffb066;
  --w2i-bg: #f4f6fb;
  --w2i-card: #ffffff;
  --w2i-text: #1f2233;
  --w2i-muted: #6b7280;
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  background: var(--w2i-bg);
  color: var(--w2i-text);
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
}

a { text-decoration: none; }

/* ---------- Login Page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--w2i-navy) 0%, var(--w2i-navy-dark) 55%, #14163f 100%);
  padding: 20px;
}

.login-card {
  background: var(--w2i-card);
  border-radius: 18px;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
  display: flex;
}

.login-side {
  background: linear-gradient(160deg, var(--w2i-orange) 0%, #e0640d 100%);
  color: #fff;
  padding: 48px 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.login-side h2 { font-weight: 700; margin: 0; }
.login-side p { opacity: .95; margin: 0; }

.login-form-side {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-logo { max-width: 190px; margin-bottom: 24px; }

@media (max-width: 767px) {
  .login-card { flex-direction: column; }
  .login-side { padding: 32px 28px; }
  .login-form-side { padding: 32px 28px; }
}

/* ---------- App Shell ---------- */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--w2i-navy) 0%, var(--w2i-navy-dark) 100%);
  color: #fff;
  padding: 22px 16px;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease;
}

.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.app-sidebar .brand img { height: 34px; background: #fff; border-radius: 6px; padding: 3px 5px; }
.app-sidebar .brand span { font-weight: 700; font-size: 1.05rem; letter-spacing: .3px; }

.app-sidebar .nav-link {
  color: rgba(255,255,255,.82);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .94rem;
}

.app-sidebar .nav-link i { width: 18px; text-align: center; }

.app-sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-sidebar .nav-link.active { background: var(--w2i-orange); color: #fff; box-shadow: 0 4px 10px rgba(245,130,32,.4); }

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin .25s ease;
}

.app-topbar {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(20,20,50,.05);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-topbar .toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--w2i-navy);
}

.app-content { padding: 24px; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1035;
}

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-topbar .toggle-btn { display: inline-block; }
  .sidebar-backdrop.show { display: block; }
}

@media (max-width: 575px) {
  .app-content { padding: 14px; }
  .app-topbar { padding: 12px 14px; }
}

/* ---------- Cards / Widgets ---------- */
.stat-card {
  background: var(--w2i-card);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(20,20,50,.06);
  border: 1px solid rgba(20,20,50,.04);
  height: 100%;
}

.stat-card .icon-wrap {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 12px;
}

.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .stat-label { color: var(--w2i-muted); font-size: .85rem; }

.bg-navy { background: var(--w2i-navy) !important; }
.bg-orange { background: var(--w2i-orange) !important; }
.text-navy { color: var(--w2i-navy) !important; }
.text-orange { color: var(--w2i-orange) !important; }

.card-panel {
  background: var(--w2i-card);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(20,20,50,.06);
  border: 1px solid rgba(20,20,50,.04);
}

.panel-title {
  font-weight: 700;
  color: var(--w2i-navy);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-w2i {
  background: var(--w2i-navy);
  border-color: var(--w2i-navy);
  color: #fff;
}
.btn-primary-w2i:hover { background: var(--w2i-navy-dark); border-color: var(--w2i-navy-dark); color: #fff; }

.btn-orange {
  background: var(--w2i-orange);
  border-color: var(--w2i-orange);
  color: #fff;
}
.btn-orange:hover { background: #e0640d; border-color: #e0640d; color: #fff; }

.table thead th {
  background: #f0f1f8;
  color: var(--w2i-navy);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: none;
}

.table td, .table th { vertical-align: middle; }

.badge { font-weight: 500; padding: 6px 12px; }

.form-label { font-weight: 500; color: #333; font-size: .9rem; }

/* ---------- Payslip ---------- */
.payslip-box {
  background: #fff;
  max-width: 850px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(20,20,50,.08);
}
.payslip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.payslip-header .banner {
  background: var(--w2i-navy);
  color: #fff;
  padding: 22px 30px;
  font-size: 1.4rem;
  font-weight: 600;
  clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%);
  flex: 1;
  text-align: right;
}
.payslip-header .logo-area { padding: 20px 30px; }
.payslip-header .logo-area img { max-height: 46px; }
.payslip-body { padding: 30px 40px; }
.payslip-id-chip {
  background: var(--w2i-orange);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 6px;
  display: inline-block;
  margin: 14px 0 22px;
}
.payslip-meta div { padding: 4px 0; }
.payslip-meta .lbl { display: inline-block; width: 160px; color: #444; }
.payslip-earnings th { background: var(--w2i-navy); color: #fff; }
.payslip-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 60px;
}
.payslip-footer .orange-strip {
  background: var(--w2i-orange);
  color: #fff;
  padding: 14px 26px;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
  text-align: right;
  font-size: .85rem;
}

@media print {
  .app-sidebar, .app-topbar, .no-print { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body { background: #fff; }
}

@media (max-width: 575px) {
  .payslip-body { padding: 20px; }
  .payslip-header .banner { font-size: 1rem; padding: 16px 18px; }
  .payslip-meta .lbl { width: 130px; }
  .payslip-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
}
