/* ==========================================================================
   NEF ERP — Payroll Module
   Design layer over Bootstrap 5. Blue-and-white enterprise theme.

   Principles
   - Data density over decoration. This is a screen people work in for hours.
   - One accent (NEF Blue). Colour is reserved for state, never for mood.
   - Tabular figures everywhere a number appears, so columns align optically.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand — a single blue ramp, from the navy chrome to the action accent */
  --nef-navy-900: #07223d;
  --nef-navy-800: #0b2e4f;
  --nef-navy-700: #123f68;
  --nef-blue-600: #0f5aa8;
  --nef-blue-500: #1668c1;   /* primary action */
  --nef-blue-400: #2e90fa;
  --nef-blue-200: #a9cdf2;
  --nef-blue-100: #dbeafe;
  --nef-blue-050: #eef5fd;

  /* Neutrals */
  --nef-white:    #ffffff;
  --nef-canvas:   #f3f7fb;
  --nef-surface:  #ffffff;
  --nef-line:     #dbe4f0;
  --nef-line-soft:#eaf0f7;
  --nef-ink:      #0e1b2c;
  --nef-ink-muted:#5a6b80;
  --nef-ink-faint:#8496a8;

  /* State */
  --nef-success:  #0e8f63;
  --nef-success-bg:#e6f6f0;
  --nef-warning:  #b26a00;
  --nef-warning-bg:#fdf3e3;
  --nef-danger:   #c0392b;
  --nef-danger-bg:#fdeceb;
  --nef-info-bg:  var(--nef-blue-050);

  /* Geometry */
  --nef-radius:    8px;
  --nef-radius-sm: 5px;
  --nef-radius-lg: 12px;
  --nef-sidebar-w: 248px;
  --nef-header-h:  58px;

  /* Elevation — restrained; enterprise screens should read flat and calm */
  --nef-shadow-sm: 0 1px 2px rgba(11, 46, 79, .06);
  --nef-shadow:    0 1px 3px rgba(11, 46, 79, .08), 0 4px 12px rgba(11, 46, 79, .05);
  --nef-shadow-lg: 0 8px 28px rgba(11, 46, 79, .12);

  /* Type */
  --nef-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nef-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Bootstrap variable overrides — everything Bootstrap paints follows the brand */
  --bs-primary: #1668c1;
  --bs-primary-rgb: 22, 104, 193;
  --bs-body-color: var(--nef-ink);
  --bs-body-bg: var(--nef-canvas);
  --bs-border-color: var(--nef-line);
  --bs-border-radius: var(--nef-radius);
  --bs-font-sans-serif: var(--nef-font);
  --bs-link-color: var(--nef-blue-500);
  --bs-link-hover-color: var(--nef-blue-600);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--nef-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--nef-ink);
  background: var(--nef-canvas);
  font-feature-settings: "cv02", "cv03", "cv04";
  -webkit-font-smoothing: antialiased;
}

/* Numbers get tabular figures so every column lines up. */
.nef-num, td.nef-num, .nef-metric__value, .nef-money, table.nef-table td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.011em; color: var(--nef-ink); margin: 0; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible focus everywhere — keyboard users are first-class here. */
:focus-visible {
  outline: 2px solid var(--nef-blue-400);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--nef-blue-100); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. Application shell
   -------------------------------------------------------------------------- */
.nef-app {
  display: grid;
  grid-template-columns: var(--nef-sidebar-w) 1fr;
  grid-template-rows: var(--nef-header-h) 1fr;
  grid-template-areas: "brand header" "sidebar main";
  min-height: 100vh;
}

.nef-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: var(--nef-navy-900);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nef-brand__mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--nef-blue-400), var(--nef-blue-600));
  font-weight: 700; font-size: 13px; letter-spacing: -.02em;
  flex: none;
}

.nef-brand__text { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.nef-brand__text small {
  display: block; font-weight: 400; font-size: 11px;
  color: var(--nef-blue-200); letter-spacing: .04em; text-transform: uppercase;
}

/* --- header --- */
.nef-header {
  grid-area: header;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--nef-white);
  border-bottom: 1px solid var(--nef-line);
}

.nef-header__title { font-size: 15px; font-weight: 600; }
.nef-header__crumb { font-size: 12px; color: var(--nef-ink-faint); }
.nef-header__spacer { flex: 1; }

.nef-header__user {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--nef-line);
  border-radius: 999px;
  background: var(--nef-white);
  cursor: pointer;
}
.nef-header__user:hover { background: var(--nef-blue-050); border-color: var(--nef-blue-200); }

.nef-avatar {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  background: var(--nef-blue-500);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* --- sidebar --- */
.nef-sidebar {
  grid-area: sidebar;
  background: var(--nef-navy-800);
  padding: 14px 10px 24px;
  overflow-y: auto;
}

.nef-nav__group {
  padding: 16px 12px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(169, 205, 242, .62);
}

.nef-nav__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  margin-bottom: 1px;
  border-radius: var(--nef-radius-sm);
  color: #cfe0f2;
  font-size: 13.5px;
  transition: background .12s ease, color .12s ease;
}
.nef-nav__link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

.nef-nav__link--active {
  background: var(--nef-blue-500);
  color: #fff;
  font-weight: 550;
  box-shadow: inset 3px 0 0 var(--nef-blue-400);
}

.nef-nav__icon { width: 16px; text-align: center; opacity: .85; flex: none; }

.nef-nav__badge {
  margin-left: auto;
  background: rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* --- main --- */
.nef-main {
  grid-area: main;
  padding: 22px 24px 56px;
  overflow-x: hidden;
}

.nef-page-head {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.nef-page-head h1 { font-size: 21px; letter-spacing: -.02em; }
.nef-page-head p { margin: 3px 0 0; color: var(--nef-ink-muted); font-size: 13px; }
.nef-page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 992px) {
  .nef-app {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "header" "main";
  }
  .nef-sidebar { display: none; }
  .nef-sidebar.is-open {
    display: block;
    position: fixed; inset: var(--nef-header-h) auto 0 0;
    width: var(--nef-sidebar-w); z-index: 40;
    box-shadow: var(--nef-shadow-lg);
  }
  .nef-main { padding: 16px 14px 48px; }
}

/* --------------------------------------------------------------------------
   4. Cards & panels
   -------------------------------------------------------------------------- */
.nef-card {
  background: var(--nef-surface);
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius);
  box-shadow: var(--nef-shadow-sm);
}

.nef-card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--nef-line-soft);
}
.nef-card__title { font-size: 13.5px; font-weight: 600; }
.nef-card__sub { font-size: 12px; color: var(--nef-ink-muted); }
.nef-card__tools { margin-left: auto; display: flex; gap: 6px; }
.nef-card__body { padding: 16px; }
.nef-card__body--flush { padding: 0; }

/* --- metric tiles --- */
.nef-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.nef-metric {
  position: relative;
  background: var(--nef-surface);
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius);
  padding: 14px 16px 15px;
  overflow: hidden;
}
/* A 3px blue keyline is the only ornament a tile gets. */
.nef-metric::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--nef-blue-500);
}
.nef-metric--success::before { background: var(--nef-success); }
.nef-metric--warning::before { background: var(--nef-warning); }
.nef-metric--danger::before  { background: var(--nef-danger); }

.nef-metric__label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--nef-ink-faint);
}
.nef-metric__value {
  font-size: 25px; font-weight: 620; letter-spacing: -.028em;
  margin-top: 5px; line-height: 1.15;
}
.nef-metric__value small { font-size: 15px; font-weight: 500; color: var(--nef-ink-muted); }
.nef-metric__foot { margin-top: 5px; font-size: 12px; color: var(--nef-ink-muted); }

.nef-delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.nef-delta--up   { color: var(--nef-success); }
.nef-delta--down { color: var(--nef-danger); }

/* --------------------------------------------------------------------------
   5. The payroll pipeline — the signature element
   Payroll genuinely is an ordered sequence, so numbering here carries meaning:
   a step cannot start before the one to its left has finished.
   -------------------------------------------------------------------------- */
.nef-pipeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.nef-step {
  position: relative;
  flex: 1 0 128px;
  min-width: 128px;
  padding: 12px 12px 12px 14px;
  background: var(--nef-white);
  border: 1px solid var(--nef-line);
  border-right: none;
}
.nef-step:first-child { border-radius: var(--nef-radius) 0 0 var(--nef-radius); }
.nef-step:last-child  { border-right: 1px solid var(--nef-line); border-radius: 0 var(--nef-radius) var(--nef-radius) 0; }

/* the notch that turns the row into a rail of chevrons */
.nef-step::after {
  content: "";
  position: absolute; top: 50%; right: -9px;
  width: 16px; height: 16px;
  transform: translateY(-50%) rotate(45deg);
  background: inherit;
  border-top: 1px solid var(--nef-line);
  border-right: 1px solid var(--nef-line);
  z-index: 2;
}
.nef-step:last-child::after { display: none; }

.nef-step__index {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--nef-ink-faint);
  font-variant-numeric: tabular-nums;
}
.nef-step__name { font-size: 12.5px; font-weight: 600; margin-top: 2px; line-height: 1.3; }
.nef-step__meta { font-size: 11px; color: var(--nef-ink-muted); margin-top: 3px; }

.nef-step--done {
  background: var(--nef-blue-050);
  border-color: var(--nef-blue-200);
}
.nef-step--done::after { border-color: var(--nef-blue-200); }
.nef-step--done .nef-step__index { color: var(--nef-blue-600); }

.nef-step--active {
  background: var(--nef-blue-500);
  border-color: var(--nef-blue-500);
  color: #fff;
}
.nef-step--active::after { border-color: var(--nef-blue-500); }
.nef-step--active .nef-step__index { color: rgba(255, 255, 255, .72); }
.nef-step--active .nef-step__meta  { color: rgba(255, 255, 255, .82); }

.nef-step--error {
  background: var(--nef-danger-bg);
  border-color: #f0c0bb;
}
.nef-step--error::after { border-color: #f0c0bb; }
.nef-step--error .nef-step__name { color: var(--nef-danger); }

/* --------------------------------------------------------------------------
   6. Tables
   -------------------------------------------------------------------------- */
.nef-table-wrap { overflow-x: auto; }

table.nef-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table.nef-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--nef-blue-050);
  color: var(--nef-navy-700);
  font-size: 11px; font-weight: 650;
  letter-spacing: .055em; text-transform: uppercase;
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--nef-line);
  white-space: nowrap;
}

table.nef-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--nef-line-soft);
  vertical-align: middle;
}

table.nef-table tbody tr:hover td { background: var(--nef-blue-050); }
table.nef-table tbody tr:last-child td { border-bottom: none; }

table.nef-table .text-end, table.nef-table th.text-end { text-align: right; }

table.nef-table tfoot td {
  padding: 11px 14px;
  background: var(--nef-blue-050);
  border-top: 2px solid var(--nef-blue-200);
  font-weight: 650;
}

/* zebra is off by default; enable per-table where rows are dense */
table.nef-table--zebra tbody tr:nth-child(even) td { background: #fafcfe; }
table.nef-table--zebra tbody tr:nth-child(even):hover td { background: var(--nef-blue-050); }

.nef-cell-primary { font-weight: 600; }
.nef-cell-sub { display: block; font-size: 11.5px; color: var(--nef-ink-faint); }

/* --------------------------------------------------------------------------
   7. Badges, chips, status
   -------------------------------------------------------------------------- */
.nef-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.nef-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.nef-badge--draft    { background: #eef1f5; color: #566476; }
.nef-badge--info     { background: var(--nef-blue-050); color: var(--nef-blue-600); }
.nef-badge--progress { background: var(--nef-warning-bg); color: var(--nef-warning); }
.nef-badge--success  { background: var(--nef-success-bg); color: var(--nef-success); }
.nef-badge--danger   { background: var(--nef-danger-bg); color: var(--nef-danger); }
.nef-badge--locked   { background: var(--nef-navy-800); color: #cfe0f2; }

/* --------------------------------------------------------------------------
   8. Buttons & controls
   -------------------------------------------------------------------------- */
.nef-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 560;
  border-radius: var(--nef-radius-sm);
  border: 1px solid transparent;
  background: var(--nef-white);
  color: var(--nef-ink);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
  white-space: nowrap;
}
.nef-btn:hover { text-decoration: none; }
.nef-btn:disabled, .nef-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.nef-btn--primary {
  background: var(--nef-blue-500);
  border-color: var(--nef-blue-500);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 104, 193, .28);
}
.nef-btn--primary:hover:not(:disabled) { background: var(--nef-blue-600); border-color: var(--nef-blue-600); color: #fff; }

.nef-btn--ghost { border-color: var(--nef-line); color: var(--nef-ink); }
.nef-btn--ghost:hover:not(:disabled) { background: var(--nef-blue-050); border-color: var(--nef-blue-200); }

.nef-btn--danger { border-color: #eec3be; color: var(--nef-danger); background: var(--nef-white); }
.nef-btn--danger:hover:not(:disabled) { background: var(--nef-danger-bg); }

.nef-btn--sm { padding: 4px 10px; font-size: 12px; }

.nef-field { margin-bottom: 14px; }
.nef-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--nef-ink-muted);
  margin-bottom: 5px;
}
.nef-label .nef-req { color: var(--nef-danger); margin-left: 2px; }

.nef-input, .nef-select, .nef-textarea {
  width: 100%;
  padding: 7px 11px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--nef-ink);
  background: var(--nef-white);
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius-sm);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.nef-input:focus, .nef-select:focus, .nef-textarea:focus {
  outline: none;
  border-color: var(--nef-blue-400);
  box-shadow: 0 0 0 3px rgba(46, 144, 250, .16);
}
.nef-input[aria-invalid="true"] { border-color: var(--nef-danger); }

.nef-help { font-size: 11.5px; color: var(--nef-ink-faint); margin-top: 4px; }
.nef-error { font-size: 11.5px; color: var(--nef-danger); margin-top: 4px; }

/* --------------------------------------------------------------------------
   9. Formula builder
   -------------------------------------------------------------------------- */
.nef-formula {
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 16px;
}
@media (max-width: 900px) { .nef-formula { grid-template-columns: 1fr; } }

.nef-formula__editor {
  font-family: var(--nef-font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  min-height: 108px;
  padding: 12px 14px;
  background: #fbfdff;
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius-sm);
  resize: vertical;
  tab-size: 2;
}
.nef-formula__editor:focus {
  outline: none;
  border-color: var(--nef-blue-400);
  box-shadow: 0 0 0 3px rgba(46, 144, 250, .16);
}

.nef-token {
  display: inline-block;
  padding: 3px 8px;
  margin: 0 4px 5px 0;
  font-family: var(--nef-font-mono);
  font-size: 11.5px;
  border-radius: 4px;
  border: 1px solid var(--nef-line);
  background: var(--nef-white);
  cursor: pointer;
  transition: all .1s ease;
}
.nef-token:hover { background: var(--nef-blue-050); border-color: var(--nef-blue-400); color: var(--nef-blue-600); }
.nef-token--fn  { background: var(--nef-blue-050); border-color: var(--nef-blue-200); color: var(--nef-blue-600); }
.nef-token--op  { font-weight: 600; }

.nef-palette { max-height: 190px; overflow-y: auto; padding-right: 4px; }
.nef-palette__title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--nef-ink-faint);
  margin: 12px 0 6px;
}
.nef-palette__title:first-child { margin-top: 0; }

.nef-result {
  padding: 12px 14px;
  border-radius: var(--nef-radius-sm);
  border: 1px solid var(--nef-line);
  background: var(--nef-blue-050);
  font-variant-numeric: tabular-nums;
}
.nef-result--ok    { border-color: #b9e3d3; background: var(--nef-success-bg); }
.nef-result--error { border-color: #f0c0bb; background: var(--nef-danger-bg); color: var(--nef-danger); }
.nef-result__value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

/* --------------------------------------------------------------------------
   10. Payslip
   -------------------------------------------------------------------------- */
.nef-payslip {
  max-width: 820px; margin: 0 auto;
  background: #fff;
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius);
  overflow: hidden;
}

.nef-payslip__head {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 26px;
  background: var(--nef-navy-800);
  color: #fff;
}
.nef-payslip__head h2 { color: #fff; font-size: 17px; }
.nef-payslip__head .period { color: var(--nef-blue-200); font-size: 12.5px; margin-top: 2px; }

.nef-payslip__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--nef-line-soft);
  border-bottom: 1px solid var(--nef-line);
}
.nef-payslip__meta > div { background: #fff; padding: 11px 16px; }
.nef-payslip__meta dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--nef-ink-faint); margin: 0;
}
.nef-payslip__meta dd { margin: 3px 0 0; font-size: 13px; font-weight: 550; }

.nef-payslip__columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--nef-line-soft);
}
@media (max-width: 700px) { .nef-payslip__columns { grid-template-columns: 1fr; } }
.nef-payslip__columns > section { background: #fff; padding: 0; }

.nef-payslip__net {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 26px;
  background: var(--nef-blue-050);
  border-top: 2px solid var(--nef-blue-200);
}
.nef-payslip__net .amount {
  font-size: 27px; font-weight: 680; letter-spacing: -.03em;
  color: var(--nef-navy-800);
  font-variant-numeric: tabular-nums;
}
.nef-payslip__words { font-size: 12px; color: var(--nef-ink-muted); font-style: italic; }

.nef-payslip__foot {
  padding: 14px 26px;
  font-size: 11px; color: var(--nef-ink-faint);
  border-top: 1px solid var(--nef-line-soft);
}

/* --------------------------------------------------------------------------
   11. States: empty, loading, alerts
   -------------------------------------------------------------------------- */
.nef-empty { padding: 44px 24px; text-align: center; }
.nef-empty__icon {
  width: 42px; height: 42px; margin: 0 auto 12px;
  border-radius: 10px;
  background: var(--nef-blue-050);
  color: var(--nef-blue-500);
  display: grid; place-items: center; font-size: 19px;
}
.nef-empty h3 { font-size: 14.5px; margin-bottom: 5px; }
.nef-empty p { font-size: 13px; color: var(--nef-ink-muted); max-width: 380px; margin: 0 auto 14px; }

.nef-alert {
  display: flex; gap: 11px;
  padding: 11px 14px;
  border-radius: var(--nef-radius-sm);
  border: 1px solid;
  font-size: 13px;
  margin-bottom: 14px;
}
.nef-alert--info    { background: var(--nef-info-bg);    border-color: var(--nef-blue-200); color: var(--nef-navy-700); }
.nef-alert--success { background: var(--nef-success-bg); border-color: #b9e3d3; color: #0a6b4b; }
.nef-alert--warning { background: var(--nef-warning-bg); border-color: #f0d5a8; color: #8a5200; }
.nef-alert--danger  { background: var(--nef-danger-bg);  border-color: #f0c0bb; color: #96291d; }
.nef-alert strong { font-weight: 650; }

.nef-skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafd 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: nef-shimmer 1.3s ease infinite;
  border-radius: 4px;
  height: 13px;
}
@keyframes nef-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.nef-spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nef-spin .65s linear infinite;
}
@keyframes nef-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   12. Charts (dependency-free bars)
   -------------------------------------------------------------------------- */
.nef-bars { display: flex; flex-direction: column; gap: 11px; }
.nef-bar__top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.nef-bar__track { height: 7px; border-radius: 4px; background: var(--nef-line-soft); overflow: hidden; }
.nef-bar__fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--nef-blue-500), var(--nef-blue-400));
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.nef-sparkline { display: flex; align-items: flex-end; gap: 4px; height: 76px; }
.nef-sparkline__col {
  flex: 1;
  background: var(--nef-blue-200);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: background .12s ease;
}
.nef-sparkline__col:hover { background: var(--nef-blue-500); }
.nef-sparkline__col--last { background: var(--nef-blue-500); }

/* --------------------------------------------------------------------------
   13. Print — payslips and registers must print cleanly
   -------------------------------------------------------------------------- */
@media print {
  .nef-sidebar, .nef-header, .nef-brand, .nef-page-head__actions, .nef-no-print { display: none !important; }
  .nef-app { display: block; }
  .nef-main { padding: 0; }
  body { background: #fff; font-size: 11pt; }
  .nef-payslip { border: none; max-width: none; }
  .nef-payslip__head { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
  .nef-payslip__head h2, .nef-payslip__head .period { color: #000 !important; }
  .nef-card { break-inside: avoid; box-shadow: none; }
}

/* --------------------------------------------------------------------------
   14. Authentication screens
   A split layout: the brand panel carries the weight so the form itself can
   stay plain. Nothing on a sign-in form should compete with the fields.
   -------------------------------------------------------------------------- */
.nef-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.nef-auth__brand {
  position: relative;
  background: linear-gradient(150deg, var(--nef-navy-900) 0%, var(--nef-navy-700) 55%, var(--nef-blue-600) 100%);
  color: #fff;
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* A faint grid — payroll is a ledger, and the backdrop says so quietly. */
.nef-auth__brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 10%, transparent 72%);
  pointer-events: none;
}

.nef-auth__brand > * { position: relative; z-index: 1; }

.nef-auth__logo { display: flex; align-items: center; gap: 11px; margin-bottom: auto; }
.nef-auth__logo .nef-brand__mark { width: 34px; height: 34px; font-size: 13px; }
.nef-auth__logo span { font-weight: 600; font-size: 15px; }

.nef-auth__pitch { max-width: 430px; }
.nef-auth__pitch h1 {
  color: #fff;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -.03em;
  margin-bottom: 14px;
}
.nef-auth__pitch p { color: #b9d4ee; font-size: 14.5px; line-height: 1.6; margin: 0; }

.nef-auth__stats {
  display: flex; gap: 34px; flex-wrap: wrap;
  margin-top: 34px; padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.nef-auth__stats dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: rgba(169, 205, 242, .8); margin: 0;
}
.nef-auth__stats dd {
  margin: 4px 0 0; font-size: 19px; font-weight: 620;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}

.nef-auth__panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  background: var(--nef-white);
}

.nef-auth__form { width: 100%; max-width: 372px; }
.nef-auth__form h2 { font-size: 22px; letter-spacing: -.022em; }
.nef-auth__form > p { color: var(--nef-ink-muted); font-size: 13.5px; margin: 6px 0 26px; }

.nef-auth__submit { width: 100%; padding: 10px; font-size: 14px; margin-top: 6px; }

.nef-auth__meta {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--nef-line-soft);
  font-size: 12px; color: var(--nef-ink-faint);
}

.nef-input-group { position: relative; }
.nef-input-group .nef-input { padding-right: 68px; }
.nef-input-group__action {
  position: absolute; top: 50%; right: 6px;
  transform: translateY(-50%);
  border: none; background: none;
  font-size: 11.5px; font-weight: 600;
  color: var(--nef-blue-500);
  padding: 4px 7px; border-radius: 4px; cursor: pointer;
}
.nef-input-group__action:hover { background: var(--nef-blue-050); }

/* Password strength — four segments, filled as the rules are met. */
.nef-strength { display: flex; gap: 4px; margin-top: 7px; }
.nef-strength__seg {
  height: 3px; flex: 1; border-radius: 2px;
  background: var(--nef-line);
  transition: background .18s ease;
}
.nef-strength__seg--weak   { background: var(--nef-danger); }
.nef-strength__seg--fair   { background: var(--nef-warning); }
.nef-strength__seg--strong { background: var(--nef-success); }

.nef-rules { list-style: none; padding: 0; margin: 9px 0 0; font-size: 11.5px; }
.nef-rules li { color: var(--nef-ink-faint); padding-left: 17px; position: relative; line-height: 1.75; }
.nef-rules li::before { content: "\25CB"; position: absolute; left: 2px; }
.nef-rules li.is-met { color: var(--nef-success); }
.nef-rules li.is-met::before { content: "\2713"; }

@media (max-width: 900px) {
  .nef-auth { grid-template-columns: 1fr; }
  .nef-auth__brand { padding: 26px 24px; min-height: auto; }
  .nef-auth__pitch h1 { font-size: 24px; }
  .nef-auth__stats { display: none; }
  .nef-auth__panel { padding: 30px 22px 56px; }
}

/* --------------------------------------------------------------------------
   15. Layout utilities used by the activity screens
   -------------------------------------------------------------------------- */
.nef-toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.nef-toolbar .nef-input, .nef-toolbar .nef-select { width: auto; min-width: 168px; }
.nef-toolbar__spacer { flex: 1; }

.nef-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--nef-line-soft);
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius);
  overflow: hidden;
}
.nef-split > div { background: #fff; padding: 13px 16px; }
.nef-split dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--nef-ink-faint); margin: 0;
}
.nef-split dd {
  margin: 4px 0 0; font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nef-split dd.is-negative { color: var(--nef-danger); }
.nef-split dd.is-positive { color: var(--nef-success); }

.nef-stack { display: flex; flex-direction: column; gap: 12px; }

/* --------------------------------------------------------------------------
   16. Notifications
   -------------------------------------------------------------------------- */
.nef-bell {
  position: relative;
  width: 32px; height: 32px;
  border: 1px solid var(--nef-line);
  border-radius: 50%;
  background: var(--nef-white);
  color: var(--nef-ink-muted);
  font-size: 15px; line-height: 1;
  cursor: pointer; flex: none;
}
.nef-bell:hover { background: var(--nef-blue-050); border-color: var(--nef-blue-200); color: var(--nef-blue-600); }

.nef-bell__count {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px;
  background: var(--nef-danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px;
  font-variant-numeric: tabular-nums;
}

.nef-notice {
  padding: 11px 13px;
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius-sm);
  background: var(--nef-white);
}
.nef-notice--unread { border-left: 3px solid var(--nef-blue-500); background: var(--nef-blue-050); }
.nef-notice__title { font-size: 13px; font-weight: 600; }
.nef-notice__body  { font-size: 12.5px; color: var(--nef-ink-muted); margin-top: 2px; }
.nef-notice__meta  { font-size: 11px; color: var(--nef-ink-faint); margin-top: 5px; }

/* --------------------------------------------------------------------------
   17. Security screen — MFA enrolment
   -------------------------------------------------------------------------- */
.nef-qr {
  display: grid; place-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius);
}
.nef-qr img { width: 190px; height: 190px; image-rendering: pixelated; }

.nef-secret {
  font-family: var(--nef-font-mono);
  font-size: 13px;
  letter-spacing: .09em;
  word-break: break-all;
  padding: 10px 12px;
  background: var(--nef-blue-050);
  border: 1px solid var(--nef-blue-200);
  border-radius: var(--nef-radius-sm);
}

.nef-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  font-family: var(--nef-font-mono);
  font-size: 13px;
}
.nef-codes span {
  padding: 7px 9px;
  background: var(--nef-white);
  border: 1px solid var(--nef-line);
  border-radius: var(--nef-radius-sm);
  text-align: center;
  letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   18. Tabs, used by the master data and audit screens
   -------------------------------------------------------------------------- */
.nef-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 1px solid var(--nef-line);
  margin-bottom: 16px;
}
.nef-tab {
  padding: 8px 14px;
  border: none; background: none;
  font-size: 13px; font-weight: 550;
  color: var(--nef-ink-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.nef-tab:hover { color: var(--nef-blue-600); background: var(--nef-blue-050); }
.nef-tab--active { color: var(--nef-blue-600); border-bottom-color: var(--nef-blue-500); }

.nef-json {
  font-family: var(--nef-font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  padding: 9px 11px;
  background: #fbfdff;
  border: 1px solid var(--nef-line-soft);
  border-radius: 4px;
}
