/* ================================================================== *
 *  XPLOCC Payroll HRMS — application stylesheet
 *  Hand-written, dependency-free, responsive. Slate neutrals with an
 *  orange brand accent.
 * ================================================================== */
:root {
  --accent:        #ea580c;
  --accent-dark:   #c2410c;
  --accent-soft:   #fff1e8;
  --sidebar-bg:    #16202e;
  --sidebar-bg-2:  #1e2c3e;
  --sidebar-text:  #aebacb;
  --sidebar-active:#ffffff;
  --ink:           #1f2a37;
  --ink-soft:      #5b6675;
  --muted:         #8a94a3;
  --line:          #e6e9ee;
  --line-soft:     #eef1f5;
  --bg:            #f4f6f9;
  --card:          #ffffff;
  --ok:            #15803d;  --ok-bg:#e7f6ec;
  --warn:          #b45309;  --warn-bg:#fdf2e3;
  --err:           #b91c1c;  --err-bg:#fdeaea;
  --info:          #1d4ed8;  --info-bg:#e8effd;
  --shadow:        0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-lg:     0 10px 30px rgba(16,24,40,.12);
  --radius:        10px;
  --radius-sm:     7px;
  --sidebar-w:     256px;
  --topbar-h:      62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 650; color: var(--ink); }
p { margin: 0 0 10px; }

/* ------------------------------------------------------------------ *
 *  App shell / layout
 * ------------------------------------------------------------------ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.sidebar__logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #fb923c);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .5px;
  flex: 0 0 auto;
}
.sidebar__title { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.1; }
.sidebar__title small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-text); margin-top: 2px; }

.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: 12px 12px 24px; }
.sidebar__nav::-webkit-scrollbar { width: 8px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.menu, .menu__sub { list-style: none; margin: 0; padding: 0; }
.menu__item { margin: 2px 0; }
.menu__link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--sidebar-text); cursor: pointer;
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
  user-select: none;
}
.menu__link:hover { background: var(--sidebar-bg-2); color: #fff; }
.menu__link i { width: 18px; text-align: center; font-size: 15px; flex: 0 0 auto; }
.menu__link .menu__caret { margin-left: auto; transition: transform .2s; font-size: 11px; }
.menu__item.is-open > .menu__link .menu__caret { transform: rotate(90deg); }
.menu__item.is-active > .menu__link,
.menu__link.is-active {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: #fff; box-shadow: 0 4px 12px rgba(234,88,12,.35);
}
.menu__sub { max-height: 0; overflow: hidden; transition: max-height .25s ease; padding-left: 12px; }
.menu__item.is-open > .menu__sub { max-height: 520px; }
.menu__sub .menu__link { padding: 8px 12px 8px 14px; font-size: 13px; }
.menu__sub .menu__link::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .45; flex: 0 0 auto;
}
.menu__group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: #5d6b7e; padding: 16px 12px 6px; font-weight: 700;
}

/* ------------------------------------------------------------------ *
 *  Main column
 * ------------------------------------------------------------------ */
.main { flex: 1 1 auto; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.topbar__toggle {
  display: none; border: 0; background: transparent; cursor: pointer;
  font-size: 20px; color: var(--ink); padding: 6px; border-radius: 8px;
}
.topbar__toggle:hover { background: var(--line-soft); }
.topbar__title { font-size: 17px; font-weight: 650; }
.topbar__spacer { flex: 1 1 auto; }
.topbar__user { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 5px 8px; border-radius: 9px; }
.topbar__user:hover { background: var(--line-soft); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.topbar__user-meta { line-height: 1.15; }
.topbar__user-meta b { font-size: 13.5px; font-weight: 650; }
.topbar__user-meta span { display: block; font-size: 11.5px; color: var(--muted); }

.user-menu { position: relative; }
.user-menu__pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; display: none; z-index: 40;
}
.user-menu.is-open .user-menu__pop { display: block; }
.user-menu__pop a {
  display: flex; gap: 10px; align-items: center; padding: 9px 11px;
  color: var(--ink); border-radius: 7px; font-size: 13.5px;
}
.user-menu__pop a:hover { background: var(--line-soft); }
.user-menu__pop a.danger { color: var(--err); }
.user-menu__pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 5px 2px; }

.content { padding: 24px 22px 48px; flex: 1 1 auto; }
.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; }
.page-head p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.page-head__actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ *
 *  Cards & grids
 * ------------------------------------------------------------------ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { padding: 15px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.card__head h3 { font-size: 15px; }
.card__head .card__head-actions { margin-left: auto; display: flex; gap: 8px; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 15px;
}
.stat__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.stat__icon--a { background: var(--accent-soft); color: var(--accent-dark); }
.stat__icon--b { background: var(--info-bg); color: var(--info); }
.stat__icon--c { background: var(--warn-bg); color: var(--warn); }
.stat__icon--d { background: var(--ok-bg); color: var(--ok); }
.stat__value { font-size: 24px; font-weight: 750; line-height: 1; }
.stat__label { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ------------------------------------------------------------------ *
 *  Tables
 * ------------------------------------------------------------------ */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.tbl thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); background: #fafbfc; font-weight: 700; position: sticky; top: 0;
}
table.tbl tbody tr:hover { background: #fafbfd; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl-empty { text-align: center; color: var(--muted); padding: 34px 16px; }

/* ------------------------------------------------------------------ *
 *  Buttons
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; line-height: 1.2; transition: filter .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn i { font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn--secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--secondary:hover:not(:disabled) { background: var(--line-soft); }
.btn--danger { background: #fff; color: var(--err); border-color: #f3c3c3; }
.btn--danger:hover:not(:disabled) { background: var(--err-bg); }
.btn--ghost { background: transparent; color: var(--ink-soft); }
.btn--ghost:hover:not(:disabled) { background: var(--line-soft); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--icon { padding: 7px; width: 32px; height: 32px; }
.btn--block { width: 100%; }
.btn--success { background: var(--ok); color: #fff; }
.btn--success:hover:not(:disabled) { filter: brightness(.93); }

/* ------------------------------------------------------------------ *
 *  Badges / pills
 * ------------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.pill--ok   { background: var(--ok-bg);   color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--err  { background: var(--err-bg);  color: var(--err); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--muted{ background: var(--line-soft); color: var(--ink-soft); }
.pill--dot::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }

/* ------------------------------------------------------------------ *
 *  Forms
 * ------------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 15px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field label .req { color: var(--err); }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234,88,12,.13); }
.textarea { resize: vertical; min-height: 80px; }
.field__hint { font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.toolbar { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 240px; max-width: 360px; position: relative; }
.toolbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search .input { padding-left: 34px; }

/* ------------------------------------------------------------------ *
 *  Modal
 * ------------------------------------------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 60; overflow-y: auto;
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: #fff; border-radius: 13px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; margin: auto 0; animation: pop .18s ease;
}
.modal--lg { max-width: 820px; }
.modal--sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal__head h3 { font-size: 16px; }
.modal__close { margin-left: auto; border: 0; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; border-radius: 7px; width: 30px; height: 30px; }
.modal__close:hover { background: var(--line-soft); color: var(--ink); }
.modal__body { padding: 20px; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* ------------------------------------------------------------------ *
 *  Toast
 * ------------------------------------------------------------------ */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--info);
  border-radius: 9px; box-shadow: var(--shadow-lg); padding: 12px 16px; min-width: 260px; max-width: 360px;
  display: flex; gap: 10px; align-items: flex-start; animation: slideIn .2s ease; font-size: 13.5px;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok  { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast i { font-size: 16px; margin-top: 1px; }
.toast.ok i { color: var(--ok); } .toast.err i { color: var(--err); } .toast i { color: var(--info); }

/* ------------------------------------------------------------------ *
 *  Misc utilities
 * ------------------------------------------------------------------ */
.loader { display: inline-block; width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.loader--center { display: block; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}
.flex { display: flex; } .flex-between { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.gap-1{gap:8px}.gap-2{gap:16px}.wrap{flex-wrap:wrap}.items-center{align-items:center}
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; border: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }

/* ------------------------------------------------------------------ *
 *  Login
 * ------------------------------------------------------------------ */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.auth__aside {
  background: linear-gradient(150deg, #16202e 0%, #243447 60%, #2f2419 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth__aside::after {
  content:""; position:absolute; width: 360px; height: 360px; border-radius:50%;
  background: radial-gradient(circle, rgba(234,88,12,.5), transparent 70%);
  right: -90px; bottom: -90px;
}
.auth__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.auth__brand .sidebar__logo { width: 40px; height: 40px; font-size: 17px; }
.auth__pitch h2 { font-size: 30px; color: #fff; line-height: 1.2; max-width: 440px; }
.auth__pitch p { color: #c4cdda; max-width: 420px; margin-top: 14px; font-size: 14.5px; }
.auth__features { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.auth__features div { display: flex; gap: 11px; align-items: center; color: #d9e0ea; font-size: 14px; }
.auth__features i { color: #fb923c; }
.auth__foot { color: #8995a6; font-size: 12.5px; position: relative; z-index: 1; }

.auth__main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth__card { width: 100%; max-width: 380px; }
.auth__hero { display: none; }
.auth__hero {
  position: relative; overflow: hidden; text-align: center; color: #fff;
  padding: calc(34px + env(safe-area-inset-top, 0px)) 24px 82px;
  background: linear-gradient(160deg, #f97316 0%, #ea580c 45%, #c2410c 100%);
}
.auth__hero::before, .auth__hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none;
}
.auth__hero::before { width: 220px; height: 220px; right: -70px; top: -80px; }
.auth__hero::after { width: 160px; height: 160px; left: -60px; bottom: -70px; }
.auth__hero > * { position: relative; z-index: 1; }
.auth__hero-logo {
  width: 84px; height: 84px; padding: 10px; border-radius: 24px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); box-shadow: 0 10px 24px rgba(120,40,0,.25);
}
.auth__hero-name { margin-top: 14px; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: .2px; overflow-wrap: anywhere; }
.auth__hero-tag { margin-top: 4px; font-size: 13.5px; color: rgba(255,255,255,.88); }
.auth__hero-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.auth__hero-chips span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.16); font-size: 12px; font-weight: 600;
}
.auth__card h1 { font-size: 23px; }
.auth__card > p { color: var(--muted); margin: 6px 0 26px; }
.auth__demo { margin-top: 22px; padding: 14px; background: var(--accent-soft); border: 1px dashed #f3b58a; border-radius: 9px; font-size: 12.5px; color: #7c3a13; }
.auth__demo b { color: var(--accent-dark); }
.auth__demo code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ------------------------------------------------------------------ *
 *  Payslip print layout
 * ------------------------------------------------------------------ */
.payslip { font-size: 13px; color: var(--ink); }
.payslip__top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 16px; gap: 16px; }
.payslip__brand { display: flex; align-items: center; gap: 10px; }
.payslip__logo { max-height: 48px; max-width: 160px; object-fit: contain; }
.payslip__org { font-size: 19px; font-weight: 750; }
.payslip__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.payslip__col { padding: 0; }
.payslip__col + .payslip__col { border-left: 1px solid var(--line); }
.payslip__col h4 { background: #fafbfc; padding: 9px 14px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.payslip__line { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.payslip__line.total { font-weight: 700; background: #fafbfc; border-top: 1px solid var(--line); }
.payslip__net { margin-top: 16px; background: var(--accent-soft); border: 1px solid #f3b58a; border-radius: 9px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.payslip__net b { font-size: 22px; color: var(--accent-dark); }

/* Alternate payslip headers -- which one renders is chosen on Document
   Setup (hrms_document_settings.payslip_header_style) and built by
   HRMS.renderPayslipHeader in common.js. .payslip__top (above) is
   'baseline', the original/default layout. */
.payslip__top-centered { text-align: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.payslip__top-centered .payslip__logo { max-height: 52px; max-width: 170px; margin: 0 auto 10px; display: block; }
.payslip__top-centered .payslip__org { font-size: 21px; font-weight: 800; }
.payslip__top-centered .payslip__rule { height: 3px; width: 64px; background: var(--accent); margin: 14px auto 0; border-radius: 2px; }
.payslip__top-centered .payslip__emprow { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-size: 12.5px; gap: 12px; flex-wrap: wrap; }

.payslip__top-banner { background: linear-gradient(90deg, var(--accent-dark), var(--accent)); color: #fff; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.payslip__top-banner .payslip__brand { display: flex; align-items: center; gap: 10px; }
.payslip__top-banner .payslip__logo { max-height: 44px; max-width: 150px; background: #fff; border-radius: 6px; padding: 4px 8px; }
.payslip__top-banner .payslip__org { color: #fff; }
.payslip__top-banner .muted { color: rgba(255,255,255,.85); }
.payslip__top-banner .text-right { color: #fff; }

.payslip__top-compact { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.payslip__top-compact .payslip__brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.payslip__top-compact .payslip__logo { max-height: 30px; max-width: 100px; object-fit: contain; }
.payslip__top-compact .payslip__org { font-size: 15px; font-weight: 700; }
.payslip__top-compact .payslip__sep { color: var(--line); }
.payslip__top-compact .text-right { font-size: 11.5px; }

.payslip__top-letterhead { text-align: center; padding-bottom: 14px; margin-bottom: 16px; }
.payslip__top-letterhead .payslip__logo { max-height: 50px; max-width: 160px; margin: 0 auto 10px; display: block; }
.payslip__top-letterhead .payslip__org { font-size: 18px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.payslip__top-letterhead .payslip__addr { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.payslip__top-letterhead .payslip__rule2 { height: 1px; background: var(--ink); margin-top: 14px; }
.payslip__top-letterhead .payslip__rule3 { height: 1px; background: var(--ink); margin-top: 2px; }
.payslip__top-letterhead .payslip__empbox { margin-top: 16px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; background: #fafbfc; text-align: left; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ *
 *  Responsive
 * ------------------------------------------------------------------ */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 45; }
.sidebar-overlay.is-open { display: block; }

@media (max-width: 992px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__aside { display: none; }
  /* Small screens lose the left brand panel, so the form gets its own branded header and floats on a card. */
  .auth__main { display: block; padding: 0 0 32px; }
  .auth__hero { display: block; }
  .auth__card {
    position: relative; z-index: 1; width: auto; max-width: 440px; margin: -52px 16px 0; padding: 26px 22px 22px;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  }
  .auth__card h1 { font-size: 22px; }
  .auth__card > p { margin-bottom: 20px; }
  .auth__app { margin-top: 20px; }
}
@media (min-width: 500px) and (max-width: 992px) {
  .auth__card { margin-left: auto; margin-right: auto; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar__toggle { display: inline-flex; }
  .content { padding: 18px 15px 40px; }
  .kv { grid-template-columns: 120px 1fr; }
  .payslip__cols { grid-template-columns: 1fr; }
  .payslip__col + .payslip__col { border-left: 0; border-top: 1px solid var(--line); }
  .topbar__user-meta { display: none; }
}
@media (max-width: 520px) {
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

/* ------------------------------------------------------------------ *
 *  Print
 * ------------------------------------------------------------------ */
@media print {
  .sidebar, .topbar, .sidebar-overlay, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}

/* ------------------------------------------------------------------ *
 *  Permission picker (roles modal)
 * ------------------------------------------------------------------ */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.perm-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.perm-card__name { font-weight: 650; font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.perm-card__opts { display: flex; flex-direction: column; gap: 7px; }
.perm-card__opts .check { font-size: 13px; }

/* ------------------------------------------------------------------ *
 *  Posting-history timeline
 * ------------------------------------------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding: 0 0 16px 28px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 0 2px #fff; }
.timeline__title { font-weight: 600; font-size: 14px; color: var(--ink); }

/* ------------------------------------------------------------------ *
 *  Simple horizontal bar chart (monthly attendance) — no JS deps
 * ------------------------------------------------------------------ */
.barchart { display: flex; flex-direction: column; gap: 12px; }
.barchart__row { display: grid; grid-template-columns: 124px 1fr 44px; align-items: center; gap: 12px; }
.barchart__label { font-size: 13px; color: #334155; }
.barchart__track { height: 16px; background: #eef2f6; border-radius: 9px; overflow: hidden; }
.barchart__fill { display: block; height: 100%; border-radius: 9px; min-width: 3px; transition: width .45s ease; }
.barchart__val { font-weight: 650; font-size: 13px; text-align: right; color: var(--ink); }
.barchart__empty { color: var(--muted, #64748b); padding: 8px 0; }
@media (max-width: 560px) { .barchart__row { grid-template-columns: 88px 1fr 34px; gap: 8px; } }

/* ------------------------------------------------------------------ *
 *  Dashboard mini-lists & flag groups
 * ------------------------------------------------------------------ */
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-list li { font-size: 14px; }
.mini-list--split li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.flag-group { margin-bottom: 14px; }
.flag-group:last-child { margin-bottom: 0; }
.flag-group__title { font-weight: 650; font-size: 13px; color: #334155; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.flag-group__title i { color: var(--accent); }

/* employer contributions block on the payslip */
.payslip__employer { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ------------------------------------------------------------------ *
 *  Document setup (letterhead / stamp / signature)
 * ------------------------------------------------------------------ */
.asset-preview { margin-bottom: 8px; }
.asset-preview img { max-width: 100%; max-height: 180px; border: 1px solid var(--line); border-radius: 8px; background:
 #fff; padding: 6px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch-row input { width: 16px; height: 16px; }

.header-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.header-style-tile { border: 2px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.header-style-tile:hover { border-color: #d7dde5; }
.header-style-tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234,88,12,.12); }
.header-style-tile__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.header-style-tile__label i { color: var(--muted); }
.header-style-tile.is-selected .header-style-tile__label i { color: var(--accent); }
.header-style-tile__preview { pointer-events: none; }
@media (max-width: 640px) { .header-style-grid { grid-template-columns: 1fr; } }

.subhead { font-weight: 650; font-size: 13px; color: #334155; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 6px; }
.subhead i { color: var(--accent); }

/* ------------------------------------------------------------------ *
 *  Attendance: tabs, monthly matrix, status cells
 * ------------------------------------------------------------------ */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted, #64748b); cursor: pointer; }
.tab:hover { color: var(--ink, #0f172a); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.tbl--matrix th, .tbl--matrix td { padding: 5px 6px; font-size: 12.5px; white-space: nowrap; }
.tbl--matrix th.att-d, .tbl--matrix td.att-cell, .tbl--matrix td.att-d { text-align: center; min-width: 26px; width: 26px; }
.att-cell { font-weight: 600; color: #334155; border-radius: 3px; }
.sticky-col { position: sticky; left: 0; background: var(--surface, #fff); z-index: 1; }
.att-P  { background: #dcfce7; color: #166534; }
.att-A  { background: #fee2e2; color: #991b1b; }
.att-H  { background: #fef9c3; color: #854d0e; }
.att-L  { background: #dbeafe; color: #1e40af; }
.att-Ho { background: #e2e8f0; color: #475569; }
.att-W  { background: #f1f5f9; color: #94a3b8; }
.att-flag-late { box-shadow: inset 0 0 0 2px #d97706; }
.att-flag-ot   { box-shadow: inset 0 0 0 2px #2563eb; }
.att-combo { font-size: 9.5px; font-weight: 700; letter-spacing: -0.3px; }
.att-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 13px; }
.att-legend span { display: inline-flex; align-items: center; gap: 6px; }
.att-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

/* brief highlight when a field is auto-filled (e.g. basic from a pay scale) */
.is-flash { animation: flashField 0.6s ease; }
@keyframes flashField { 0% { background: #fef9c3; } 100% { background: transparent; } }

/* inline info callout (e.g. increment preview) */
.callout { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface-2, #fafafa); font-size: 14px; }
.callout i { color: var(--accent); margin-top: 2px; }

/* ---- Birthday banner (dashboard) ---- */
.bday-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px;
  border-radius: 12px; color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, #f59e0b 55%, #ec4899 100%);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18));
  animation: bday-pop .5s cubic-bezier(.2,1.4,.4,1) both;
}
.bday-banner__emoji { font-size: 34px; line-height: 1; animation: bday-wiggle 1.6s ease-in-out .4s 3; }
.bday-banner__text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.bday-banner__text b { font-size: 17px; }
.bday-banner__close {
  background: rgba(255,255,255,.2); color: #fff; border: 0; width: 30px; height: 30px; border-radius: 50%;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.bday-banner__close:hover { background: rgba(255,255,255,.35); }
@keyframes bday-pop { from { transform: scale(.92) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bday-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .bday-banner, .bday-banner__emoji { animation: none; } }

/* ---- "Get the Android app" badge (login page + dashboard sidebar) ---- */
.app-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px;
  background: #0b0d10; color: #fff; border: 1px solid #a6a6a6; border-radius: 9px;
  text-decoration: none; line-height: 1.15;
}
.app-badge:hover { background: #15181d; color: #fff; }
.app-badge__icon { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.app-badge__icon i { font-size: 22px; color: #3ddc84; }
.app-badge__icon b { font-size: 8px; font-weight: 800; letter-spacing: .6px; color: #3ddc84; }
.app-badge__text { display: flex; flex-direction: column; text-align: left; }
.app-badge__text small { font-size: 10px; color: #d7dbe0; }
.app-badge__text strong { font-size: 15px; font-weight: 650; letter-spacing: .1px; }
.auth__app { margin-top: 26px; text-align: center; }
.sidebar__footer { flex: 0 0 auto; padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar__footer .app-badge { width: 100%; justify-content: center; }

/* ------------------------------------------------------------------ *
 *  Employees page: summary chips, filter panel, wrapped sortable table,
 *  phone cards, pagination
 * ------------------------------------------------------------------ */
.emp-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.emp-stat {
  display: flex; flex-direction: column; min-width: 112px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); font: inherit; text-align: left; color: var(--ink);
}
.emp-stat b { font-size: 21px; line-height: 1.15; }
.emp-stat span { font-size: 12px; color: var(--muted); }
.emp-stat:hover { border-color: #f3b58a; }
.emp-stat.is-on { border-color: var(--accent); background: var(--accent-soft); }

.emp-filters { padding: 14px 16px; margin-bottom: 14px; }
.emp-filters__top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.emp-filters__top .search { flex: 1 1 260px; max-width: 420px; position: relative; }
.emp-filters__top .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.emp-filters__top .search .input { padding-left: 34px; }
.emp-badge {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
.emp-filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px 12px; margin-top: 12px; }
.emp-filters__grid .field { margin: 0; }
.emp-filters__grid label { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.emp-filters__grid .field--range { display: flex; flex-direction: column; }
.emp-filters__grid .range { display: flex; gap: 6px; align-items: center; }
.emp-filters__grid .range .input { min-width: 0; padding-left: 8px; padding-right: 6px; }
.emp-filters [hidden] { display: none !important; }
.emp-filters .f-more { display: none; }
.emp-filters.is-open .f-more { display: block; }
.emp-filters .f-hide-mobile { display: inline-flex; }

.emp-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.emp-bar__count { font-size: 13px; color: var(--ink-soft); }
.emp-bar__ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.emp-bar .select { width: auto; padding-top: 6px; padding-bottom: 6px; }
.emp-bar .emp-sort-mobile { display: none; }
.emp-pager { display: flex; gap: 6px; align-items: center; }
.emp-pager .btn[disabled] { opacity: .45; pointer-events: none; }

/* a table whose long values wrap instead of running off to the right */
table.tbl.tbl--wrap th, table.tbl.tbl--wrap td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; padding: 12px 10px; }
table.tbl.tbl--wrap td.nw, table.tbl.tbl--wrap th.nw { white-space: nowrap; overflow-wrap: normal; }
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--accent-dark); }
table.tbl th.sortable::after { content: '↕'; margin-left: 5px; font-size: 11px; opacity: .35; }
table.tbl th.sortable.is-asc::after { content: '↑'; opacity: 1; color: var(--accent); }
table.tbl th.sortable.is-desc::after { content: '↓'; opacity: 1; color: var(--accent); }
.emp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.emp-cards { display: none; padding: 12px; gap: 10px; flex-direction: column; }
.emp-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); }
.emp-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.emp-card__head b { font-size: 15px; overflow-wrap: anywhere; }
.emp-card__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 12px 0; font-size: 13px; }
.emp-card__meta small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.emp-card__meta div { overflow-wrap: anywhere; }
.emp-card__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .emp-table { display: none; }
  .emp-cards { display: flex; }
  .emp-bar .emp-sort-mobile { display: inline-block; }
  .emp-filters .f-primary { display: none; }
  .emp-filters.is-open .f-primary { display: block; }
  .emp-filters .f-hide-mobile { display: none; }
  .emp-filters__top .search { max-width: none; }
  .emp-filters__grid { grid-template-columns: 1fr 1fr; }
  .emp-filters__grid .field--range { grid-column: 1 / -1; }
  .emp-stat { min-width: calc(50% - 5px); }
}
