:root {
  --brand: #2563eb;
  --brand-dark: #1e3a8a;
  --brand-2: #1d4ed8;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6eaf1;
  --bg: #f4f6fb;
  --radius: .85rem;
  --radius-sm: .55rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 6px 22px rgba(15, 23, 42, .09);

  /* Align Bootstrap's theme colour to the brand */
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1e40af;
  --bs-body-color: #0f172a;
  --bs-border-color: #e6eaf1;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .94rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5 { font-weight: 650; letter-spacing: -.011em; color: #0b1220; }
a { text-decoration: none; }
a:hover { text-decoration: none; }

/* ---- Buttons ---- */
.btn { --bs-btn-border-radius: .5rem; font-weight: 500; }
.btn-primary {
  --bs-btn-bg: #2563eb; --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8;
  --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .35);
}
.btn-outline-primary {
  --bs-btn-color: #2563eb; --bs-btn-border-color: #cdd9f7;
  --bs-btn-hover-bg: #2563eb; --bs-btn-hover-border-color: #2563eb;
  --bs-btn-active-bg: #1e40af;
}
.btn-sm { --bs-btn-border-radius: .45rem; }

/* ---- Navbar ---- */
.app-navbar {
  background: linear-gradient(100deg, var(--brand-dark), var(--brand));
  box-shadow: 0 2px 14px rgba(15, 23, 42, .16);
}
.app-navbar .navbar-brand { font-weight: 650; letter-spacing: -.01em; }
.app-navbar .nav-link { color: rgba(255, 255, 255, .82); border-radius: .5rem; padding-top: .4rem; padding-bottom: .4rem; font-weight: 500; }
.app-navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.app-navbar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .2); font-weight: 600; }
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

/* ---- Desktop: nav group dropdowns open on hover (driven by footer JS) ---- */
.dropdown-menu { --bs-dropdown-border-radius: .7rem; --bs-dropdown-link-active-bg: #eff4ff; --bs-dropdown-link-active-color: #1e40af; box-shadow: var(--shadow); border-color: var(--line); }
.dropdown-item { border-radius: .45rem; padding: .4rem .7rem; font-weight: 500; }
.dropdown-menu { padding: .35rem; }
@media (min-width: 992px) {
  .app-navbar .nav-item.dropdown > .dropdown-menu { border: 0; }
  .app-navbar .nav-item.dropdown > .dropdown-menu.show { animation: navDropIn .15s ease; }
}
@keyframes navDropIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Cards ---- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card-header {
  background: #fff; border-bottom: 1px solid var(--line);
  font-weight: 600; color: #1e293b; padding: .85rem 1.1rem;
}
.card-header.bg-white { background: #fff !important; }
.card-footer { background: #fff; border-top: 1px solid var(--line); }

/* ---- Stat tiles ---- */
.stat-tile {
  border-radius: var(--radius); padding: 1.15rem 1.25rem; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease;
}
a .stat-tile:hover, .stat-tile.link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-tile .stat-icon {
  width: 46px; height: 46px; border-radius: .7rem;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.stat-tile .stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-tile .stat-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* ---- Tables ---- */
.table { --bs-table-border-color: var(--line); }
.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th, .table > thead.table-light th {
  background: #f7f9fc; color: #64748b;
  text-transform: uppercase; font-size: .72rem; letter-spacing: .045em;
  font-weight: 600; border-bottom: 1px solid var(--line); padding: .6rem .75rem; white-space: nowrap;
}
.table tbody td { padding: .68rem .75rem; border-color: var(--line); }
.table-hover > tbody > tr:hover > * { background: #f5f8ff; }
.card > .table-responsive:last-child .table, .card .table.mb-0 { margin-bottom: 0; }
.card > .table-responsive:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); overflow: hidden; }

/* ---- Forms ---- */
.form-label { font-weight: 500; font-size: .85rem; color: #334155; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: var(--radius-sm); border-color: #d9e0ec; font-size: .92rem;
}
.form-control:focus, .form-select:focus { border-color: #93b4f6; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.input-group-text { border-radius: var(--radius-sm); }

/* ---- Badges ---- */
.badge { font-weight: 600; letter-spacing: .01em; padding: .34em .6em; border-radius: .5rem; }

/* ---- Modals ---- */
.modal-content { border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-footer { border-top: 1px solid var(--line); }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; }

/* ---- Payslip ---- */
.payslip { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.payslip .pay-net { font-size: 1.95rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -.02em; }
.payslip table td { padding: .35rem .25rem; }
.payslip .ded { color: #b91c1c; }

/* ---- Misc ---- */
.text-mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.cutoff-pill { font-size: .72rem; }
main.container-fluid { max-width: 1400px; }
footer { color: #94a3b8; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background: radial-gradient(1200px 600px at 20% -10%, #3b6fe0 0%, transparent 60%),
              linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.login-card { width: 100%; max-width: 410px; border: 0; border-radius: 1rem; box-shadow: 0 30px 70px rgba(2, 12, 40, .4); }
