/* ============================================================
   BIMANO FINTAX HRMS — UNIFIED PAYROLL MODULE STYLESHEET
   100% Faithful to Demo UI/UX: Integrated Horizontal Sub-Nav,
   Cream Background, Forest Headings, Gold Accents, Accounting Tables
   NO DUPLICATE VERTICAL SIDEBAR — Integrates into single HRMS Shell
   ============================================================ */

:root {
  --ink: #0B211B;
  --forest: #12463A;
  --forest-2: #1A6650;
  --moss: #2F8A6B;
  --gold: #B98B1D;
  --gold-soft: #F4E6BE;
  --paper: #F6F4EC;
  --surface: #FFFFFF;
  --line: #DCD7C7;
  --line-soft: #EBE7DB;
  --muted: #6B6A5E;
  --red: #9E3226;
  --red-soft: #FBE9E5;
  --blue: #2A5A8A;
  --ok: #1A6650;
  --radius: 4px;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, "Courier New", monospace;

  /* Aliases for backwards compatibility */
  --bpm-ink: var(--ink);
  --bpm-forest: var(--forest);
  --bpm-forest-2: var(--forest-2);
  --bpm-gold: var(--gold);
  --bpm-gold-soft: var(--gold-soft);
  --bpm-paper: var(--paper);
  --bpm-surface: var(--surface);
  --bpm-line: var(--line);
  --bpm-line-soft: var(--line-soft);
  --bpm-muted: var(--muted);
  --bpm-red: var(--red);
  --bpm-ok: var(--ok);
  --bpm-radius: var(--radius);
  --bpm-sans: var(--sans);
  --bpm-serif: var(--serif);
  --bpm-mono: var(--mono);
}

.bpm-module {
  font-family: var(--sans);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px 40px;
  box-shadow: 0 1px 6px rgba(11, 33, 27, 0.05);
}

.bpm-module * {
  box-sizing: border-box;
}

.bpm-module button,
.bpm-module input,
.bpm-module select,
.bpm-module textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.bpm-module button {
  cursor: pointer;
}

.bpm-module a {
  color: var(--forest-2);
}

.bpm-module .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.bpm-module .hide {
  display: none !important;
}

/* ---------- INTEGRATED HORIZONTAL SUB-NAVIGATION ---------- */
.bpm-subnav {
  background: linear-gradient(135deg, #12463A, #0B211B);
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(11, 33, 27, 0.12);
}

.bpm-subnav-items {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.bpm-subnav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 4px;
  color: #C4D2CC;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 2px solid transparent;
}

.bpm-subnav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bpm-subnav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-bottom-color: var(--gold);
}

.bpm-subnav-item .ic {
  font-size: 13px;
  opacity: 0.85;
}

.bpm-subnav-brand {
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--gold-soft);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 8px;
}

/* ---------- HEADER ROW & PERIOD PICKER ---------- */
.bpm-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.bpm-header-row h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--forest);
  margin: 0;
}

.bpm-header-row .sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.bpm-period-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bpm-period-pill select,
.bpm-period-select {
  border: 0;
  background: transparent;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  color: var(--forest);
  font-size: 13px;
  font-family: inherit;
}

/* ---------- STATS / CARDS / GRIDS ---------- */
.bpm-module .grid {
  display: grid;
  gap: 14px;
}

.bpm-module .g2 {
  grid-template-columns: repeat(2, 1fr);
}

.bpm-module .g3 {
  grid-template-columns: repeat(3, 1fr);
}

.bpm-module .g4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1080px) {
  .bpm-module .g4 { grid-template-columns: repeat(2, 1fr); }
  .bpm-module .g3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .bpm-module .g2, .bpm-module .g3, .bpm-module .g4 { grid-template-columns: 1fr; }
}

.bpm-module .stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.bpm-module .stat:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--forest-2);
}

.bpm-module .stat.gold:before {
  background: var(--gold);
}

.bpm-module .stat.red:before {
  background: var(--red);
}

.bpm-module .stat .k {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.bpm-module .stat .v {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.bpm-module .stat .n {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.bpm-module .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.bpm-module .card > h3 {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  font-weight: 700;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.bpm-module .card > h3 .tools {
  display: flex;
  gap: 7px;
  align-items: center;
}

.bpm-module .card .body {
  padding: 18px;
}

.bpm-module .card .body.tight {
  padding: 0;
}

/* ---------- TABLES ---------- */
.bpm-module table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bpm-module th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  white-space: nowrap;
}

.bpm-module td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.bpm-module tr:last-child td {
  border-bottom: 0;
}

.bpm-module tbody tr:hover {
  background: #FBFAF5;
}

.bpm-module td.r, .bpm-module th.r {
  text-align: right;
}

.bpm-module td.c, .bpm-module th.c {
  text-align: center;
}

.bpm-module .tbl-wrap {
  overflow-x: auto;
}

.bpm-module .tot-row td {
  background: var(--paper);
  font-weight: 700;
  border-top: 2px solid var(--forest);
}

/* ---------- TAGS / NOTES / BUTTONS ---------- */
.bpm-module .tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bpm-module .tag.ok {
  background: #E2F0EA;
  color: var(--ok);
}

.bpm-module .tag.warn {
  background: var(--gold-soft);
  color: #7A5A00;
}

.bpm-module .tag.err {
  background: var(--red-soft);
  color: var(--red);
}

.bpm-module .tag.mute {
  background: #EEECE3;
  color: var(--muted);
}

.bpm-module .tag.blue {
  background: #E4EDF6;
  color: var(--blue);
}

.bpm-module .empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}

.bpm-module .empty b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 5px;
  font-family: var(--serif);
}

.bpm-module .note {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  font-size: 12.5px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 14px;
  color: #4A3800;
}

.bpm-module .note.info {
  background: #E9F1EC;
  border-left-color: var(--forest-2);
  color: var(--forest);
}

.bpm-module .note.danger {
  background: var(--red-soft);
  border-left-color: var(--red);
  color: var(--red);
}

.bpm-module .linkbtn {
  background: none;
  border: 0;
  color: var(--forest-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.bpm-module .linkbtn.red {
  color: var(--red);
}

.bpm-module .field {
  margin-bottom: 16px;
}

.bpm-module .field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.bpm-module .field input,
.bpm-module .field select,
.bpm-module .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
}

.bpm-module .field input:focus,
.bpm-module .field select:focus,
.bpm-module .field textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(26, 102, 80, 0.14);
}

.bpm-module .inline-in {
  width: 88px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-align: right;
  font-family: var(--mono);
}

.bpm-module .inline-in.wide {
  width: 100%;
  text-align: left;
  font-family: var(--sans);
}

.bpm-module .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.bpm-module .btn:hover {
  background: var(--forest-2);
  border-color: var(--forest-2);
}

.bpm-module .btn.wide {
  width: 100%;
  padding: 11px;
}

.bpm-module .btn.ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--line);
}

.bpm-module .btn.ghost:hover {
  background: var(--paper);
  color: var(--forest);
}

.bpm-module .btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #2A1F00;
}

.bpm-module .btn.gold:hover {
  filter: brightness(1.07);
}

.bpm-module .btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.bpm-module .btn.sm {
  padding: 5px 11px;
  font-size: 12px;
}

.bpm-module .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- PAYSLIP (Double-Bordered Statement) ---------- */
.slip {
  background: #fff;
  color: #000;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid #000;
  font-family: var(--sans);
  font-size: 12px;
}

.slip .sh {
  padding: 14px 18px;
  border-bottom: 2px solid #000;
  text-align: center;
}

.slip .sh .co {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.slip .sh .ad {
  font-size: 11px;
  margin-top: 3px;
  color: #333;
  line-height: 1.4;
}

.slip .sh .ttl {
  margin-top: 9px;
  display: inline-block;
  border: 1px solid #000;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #F0EFE8;
}

.slip .meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #000;
}

.slip .meta > div {
  padding: 9px 14px;
}

.slip .meta > div:first-child {
  border-right: 1px solid #000;
}

.slip .meta .l {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2.5px 0;
  font-size: 11.5px;
  border-bottom: 1px dotted #CCC;
}

.slip .meta .l:last-child {
  border-bottom: 0;
}

.slip .meta .l span:first-child {
  color: #444;
}

.slip .meta .l span:last-child {
  font-weight: 600;
  text-align: right;
}

.slip table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.slip table th {
  background: #F0EFE8;
  border-bottom: 1px solid #000;
  border-top: 0;
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #000;
}

.slip table td {
  padding: 5px 12px;
  border-bottom: 1px dotted #DDD;
}

.slip .cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #000;
}

.slip .cols > div:first-child {
  border-right: 1px solid #000;
}

.slip .net {
  padding: 12px 14px;
  border-bottom: 1px solid #000;
  background: #F7F6F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.slip .net .w {
  font-size: 11.5px;
  font-style: italic;
  color: #333;
  max-width: 60%;
}

.slip .net .a {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--mono);
}

.slip .sf {
  padding: 10px 14px;
  font-size: 10px;
  color: #444;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.slip-tools {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ---------- MODAL ---------- */
.bpm-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(11, 33, 27, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px;
  z-index: 9999;
  overflow-y: auto;
}

.bpm-modal {
  background: var(--surface);
  border-radius: 6px;
  width: 100%;
  max-width: 860px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.bpm-modal.narrow {
  max-width: 520px;
}

.bpm-modal .mh {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.bpm-modal .mh h4 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

.bpm-modal .mh button {
  background: none;
  border: 0;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
}

.bpm-modal .mb {
  padding: 20px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.bpm-modal .mf {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  background: var(--paper);
}

/* Modal Form Elements */
.bpm-modal .note {
  background: rgba(13, 92, 70, 0.08);
  border-left: 4px solid #0d5c46;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  color: #1a382e;
  margin-bottom: 20px;
  line-height: 1.5;
}
.bpm-modal .note b {
  color: #0d5c46;
}
.bpm-modal .grid {
  display: grid;
  gap: 16px;
}
.bpm-modal .grid.g2 {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 600px) {
  .bpm-modal .grid.g2 {
    grid-template-columns: 1fr;
  }
}
.bpm-modal .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bpm-modal .field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bpm-modal .field input,
.bpm-modal .field select,
.bpm-modal .field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #111827;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.bpm-modal .field input:focus,
.bpm-modal .field select:focus,
.bpm-modal .field textarea:focus {
  border-color: #0d5c46;
  box-shadow: 0 0 0 3px rgba(13, 92, 70, 0.15);
}
.bpm-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  background: #0d5c46;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.bpm-modal .btn:hover {
  background: #08382b;
}
.bpm-modal .btn.ghost {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
.bpm-modal .btn.ghost:hover {
  background: #e5e7eb;
}

@media print {
  body { background: #fff !important; }
  .no-print, .sidebar, .topbar, .bpm-subnav, .slip-tools { display: none !important; }
  .bpm-module { padding: 0 !important; border: 0 !important; background: transparent !important; }
  .slip { border: 1px solid #000 !important; max-width: none !important; }
  @page { size: A4; margin: 12mm; }
}
