/* ============================================================
   Nexus HCM — Sistem Identiti Visual (Fasa 3)
   [CHANGE] what: design-system foundation — tokens + reusable .nx-* components
            · why: brand identity approved 2026-07-24 (corporate navy/brass/serif)
            · verify: link on any page, inspect --nx-* vars + .nx-* classes render
   Static, build-free CSS. The single source of truth for the identity —
   every screen skins against these tokens. Colours, type and the ledger
   figure treatment match the approved preview exactly.
   ============================================================ */

:root {
  /* brand */
  --nx-navy:      #14294B;   /* primary — trust, institution, finance */
  --nx-navy-deep: #0E1E38;
  --nx-steel:     #2C5488;   /* interactive, links */
  --nx-brass:     #A9863E;   /* accent — spent sparingly (net pay, one CTA) */
  --nx-brass-soft:#C8A55A;

  /* neutrals — cool, blue-biased (chosen, not defaulted) */
  --nx-ink:       #1A2230;
  --nx-slate:     #5A6472;
  --nx-line:      #D8DDE4;
  --nx-paper:     #EDF0F4;
  --nx-surface:   #FFFFFF;
  --nx-surface-2: #F5F7FA;
  --nx-on-navy:   #EEF2F8;

  /* semantic status — separate from the accent */
  --nx-good:  #2C6E52;  --nx-good-bg: #E2EEE8;
  --nx-warn:  #B5701E;  --nx-warn-bg: #F5E9D6;
  --nx-crit:  #A83228;  --nx-crit-bg: #F3E0DD;

  /* type — serif display, sans body, mono figures */
  --nx-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --nx-sans:  system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --nx-mono:  ui-monospace, "Cascadia Code", "SF Mono", "Consolas", "Roboto Mono", monospace;

  --nx-radius:    4px;
  --nx-radius-sm: 2px;
  --nx-shadow:    0 1px 2px rgba(20,41,75,.06), 0 8px 28px rgba(20,41,75,.08);
}

/* ---- brand wordmark ---- */
.nx-wordmark {
  font-family: var(--nx-serif); font-weight: 600; font-size: 24px;
  letter-spacing: -.01em; color: var(--nx-ink); line-height: 1;
}
.nx-wordmark .nx-hcm {
  font-family: var(--nx-sans); font-size: 9px; font-weight: 700;
  letter-spacing: .26em; color: var(--nx-brass); margin-left: 8px; vertical-align: middle;
}

/* ---- buttons ---- */
.nx-btn {
  font-family: var(--nx-sans); font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; border-radius: var(--nx-radius);
  padding: 10px 18px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; transition: filter .15s, border-color .15s, color .15s;
}
.nx-btn--primary { background: var(--nx-navy); color: var(--nx-on-navy); }
.nx-btn--primary:hover { filter: brightness(1.12); }
.nx-btn--ghost { background: transparent; color: var(--nx-ink); border-color: var(--nx-line); }
.nx-btn--ghost:hover { border-color: var(--nx-navy); color: var(--nx-navy); }
.nx-btn:focus-visible { outline: 2px solid var(--nx-steel); outline-offset: 2px; }
.nx-btn--block { width: 100%; }

/* ---- panels ---- */
.nx-panel { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: var(--nx-radius); overflow: hidden; }
.nx-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--nx-surface-2); border-bottom: 1px solid var(--nx-line);
}
.nx-panel__title { font-size: 13px; font-weight: 700; color: var(--nx-ink); }
.nx-panel__meta { font-family: var(--nx-mono); font-size: 11.5px; color: var(--nx-slate); }
.nx-panel__body { padding: 20px 22px; }

/* ---- stat ---- */
.nx-stat__n { font-family: var(--nx-mono); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--nx-ink); }
.nx-stat__n--warn { color: var(--nx-warn); }
.nx-stat__n--crit { color: var(--nx-crit); }
.nx-stat__k { font-size: 12px; color: var(--nx-slate); margin-top: 6px; }

/* ---- statutory stamp (KWSP / PERKESO / SIP / LHDN) ---- */
.nx-stamp {
  font-family: var(--nx-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--nx-navy); border: 1px solid var(--nx-navy); border-radius: var(--nx-radius-sm);
  padding: 4px 9px; background: transparent; display: inline-block;
}

/* ---- status pill ---- */
.nx-pill {
  font-family: var(--nx-mono); font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 600; padding: 2px 8px; border-radius: var(--nx-radius-sm); display: inline-block;
}
.nx-pill--good { color: var(--nx-good); background: var(--nx-good-bg); }
.nx-pill--warn { color: var(--nx-warn); background: var(--nx-warn-bg); }
.nx-pill--crit { color: var(--nx-crit); background: var(--nx-crit-bg); }

/* ---- money figure (mono, tabular — the ledger discipline anywhere) ---- */
.nx-money { font-family: var(--nx-mono); font-variant-numeric: tabular-nums; color: var(--nx-ink); white-space: nowrap; }
.nx-money__rm { color: var(--nx-slate); }

/* ---- ledger (money always mono, tabular, right-aligned) ---- */
.nx-ledger { width: 100%; border-collapse: collapse; }
.nx-ledger td { padding: 9px 0; font-size: 14.5px; border-bottom: 1px solid var(--nx-line); color: var(--nx-ink); }
.nx-ledger tr:last-child td { border-bottom: 0; }
.nx-ledger .nx-amt { text-align: right; font-family: var(--nx-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nx-ledger .nx-amt--neg { color: var(--nx-slate); }
.nx-net { font-family: var(--nx-mono); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--nx-brass); }

/* ---- form field ---- */
.nx-field { font-family: var(--nx-sans); }
.nx-field label { display: block; font-size: 12px; font-weight: 600; color: var(--nx-slate); margin-bottom: 6px; }
.nx-field input {
  width: 100%; font: inherit; font-size: 14px; padding: 11px 13px;
  border: 1px solid var(--nx-line); border-radius: var(--nx-radius);
  background: var(--nx-surface-2); color: var(--nx-ink);
}
.nx-field input:focus { outline: 2px solid var(--nx-steel); outline-offset: 1px; border-color: var(--nx-steel); }
