/* Arkedge HR Portal — Ledger design system */

/* Design refresh, phase 1 (2026-11-25): Fraunces for page titles + Inter for
   everything else. Zilla Slab and IBM Plex Mono are no longer loaded — the
   phase-1 block at the END of this file maps any leftover use of them (37
   inline styles use the mono for figures) onto Inter / Fraunces. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --ink:        #16332E;   /* deep ledger teal */
  --ink-soft:   #2A4C45;
  --paper:      #FAF8F3;   /* warm paper */
  --paper-line: #E8E2D4;   /* faint ledger rule */
  --gold:       #B8933F;   /* muted gold accent */
  --gold-soft:  #EFE2C4;
  --text:       #23281F;
  --text-muted: #5F6459;   /* darkened: the 11.5px captions need the contrast */
  --danger:     #A33B2E;
  --ok:         #3E6B4F;
  --radius: 6px;

  /* ── Spacing scale ──────────────────────────────────────────────────────
     Everything used to be a one-off number — 6, 8, 12, 14, 16, 18, 20, 28,
     32 — chosen a screen at a time. Nothing lined up with anything else, and
     that is most of why the portal felt slightly restless to look at even
     when each individual screen was fine. These are the only gaps used from
     here on; a 4px base, so any two of them are always in proportion. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  /* Corner radii, three sizes rather than a scattering of values. */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;

  /* A hairline for the inside of dense tables. The full --paper-line is right
     for the edge of a card, but fifteen columns of it in one table reads as a
     grid of cages rather than rows of figures. */
  --rule: #EFEAE0;

  /* Depth, barely. Every card was a flat 1px box, so a page of cards was a
     page of outlines with nothing sitting in front of anything else. These
     are deliberately almost invisible — enough to separate a card from the
     paper, not enough to notice as a shadow. */
  --lift-1: 0 1px 2px rgba(22,51,46,.04);
  --lift-2: 0 2px 8px rgba(22,51,46,.06);
  --lift-bar: 0 6px 14px -10px rgba(22,51,46,.35);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--paper);
  color:var(--text);
  font-family:'Inter', system-ui, sans-serif;
  /* 1.5 is fine for a paragraph you read once. This is a screen people are on
     for hours, and the extra tenth is the difference between scanning a
     column of figures comfortably and squinting at it. */
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3{
  font-family:'Zilla Slab', serif;
  font-weight:600;
  margin:0 0 4px;
  color:var(--ink);
}

.mono{ font-family:'IBM Plex Mono', monospace; }

a{ color:var(--ink); }

/* ---------- Top bar ---------- */
.topbar{
  background:var(--topbar-bg, var(--ink));
  color:var(--topbar-text, var(--paper));
  padding:16px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky; top:0; z-index:100;
}
/* THREE COLUMNS, SO THE MIDDLE ONE IS THE MIDDLE OF THE BAR. Fung: "i dont
   want the date to pull to the right, stay in the middle and maybe shorten the
   company name instead." Both side tracks are minmax(0, 1fr) — equal, and
   allowed to be SMALLER than their content, which is what stops a long company
   name pushing the picker off centre. They clip rather than overflow, because
   an overflowing track paints over its neighbour instead of moving it. */
.topbar.topbar--three{
  display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center; column-gap:14px;
}
.topbar.topbar--three > *{ min-width:0; }
/* The company name gives way instead of the picker moving. It is trimmed with
   an ellipsis and carries the full name as its tooltip; the switcher's own
   list shows every company in full, so nothing is actually lost. 300px is
   about forty characters — enough for most names whole, and short enough that
   the longest one cannot take the bar over. */
.topbar .company-pill{
  list-style:none; cursor:pointer; font-size:12.5px; padding:6px 12px;
  border-radius:4px; display:flex; align-items:center; gap:8px;
  line-height:1.45; max-width:min(300px, 100%);
}
.topbar .company-pill-name,
.topbar span.company-pill-name{
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  display:block; max-width:300px;
}
@media (max-width:900px){
  /* On a small screen a squeezed name is worse than a taller bar, so the three
     columns become a wrapping flex and the picker takes its own line. */
  .topbar.topbar--three{
    display:flex; flex-wrap:wrap; column-gap:14px; row-gap:10px;
  }
  .topbar.topbar--three > *:first-child{ flex:1 1 auto; }
  .topbar #nav-period-form{ margin:0 auto; }
  .topbar .who{ margin-left:auto; }
  .topbar .company-pill{ max-width:100%; }
  .topbar .company-pill-name,
  .topbar span.company-pill-name{ max-width:none; white-space:normal; overflow:visible; }
}
.topbar .brand{
  display:flex; align-items:center; gap:10px;
}
.topbar .brand-mark{
  width:34px; height:34px; border-radius:4px;
  background:var(--gold);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  font-family:'Zilla Slab',serif; font-weight:700; font-size:16px;
}
.topbar .brand-name{ font-family:'Zilla Slab',serif; font-size:17px; font-weight:600; color:var(--topbar-text, var(--paper));}
.topbar .brand-sub{ font-size:11.5px; color:var(--topbar-text-muted, #B9C9C4); letter-spacing:.03em; }
.topbar .who{ font-size:13px; color:var(--topbar-text-muted, #DCE7E3); display:flex; align-items:center; gap:14px;}
.topbar a.logout{ color:var(--topbar-accent, var(--gold)); text-decoration:none; font-size:13px; }
.topbar a.logout:hover{ text-decoration:underline; }
.settings-icon{ color:inherit; text-decoration:none; display:flex; align-items:center; justify-content:center;
                 width:32px; height:32px; border-radius:6px; border:1px solid var(--topbar-pill-border,#3d5a53); }
.settings-icon:hover{ background:rgba(255,255,255,.08); }

/* ---------- Layout shell ---------- */
/* HOW WIDE THE PAGE IS ALLOWED TO GET. Fung, on a 34" monitor: "my screen is
   34\" the window adapt need to go beyond" — 1400px left about a thousand
   pixels of nothing down each side of a 3440px window.
   2100px is a deliberate stop rather than 100%: past it a single line of
   explanation becomes long enough that the eye loses its place coming back for
   the next one. The payroll table is the one thing allowed past this, because
   it is a reference table rather than something anybody reads a line at a time
   — see the --pr-pull note in payslips.php. */
.wrap{ max-width:2100px; margin:0 auto; padding:32px 24px 64px; }

/* PROSE KEEPS ITS LINE LENGTH EVEN WHEN THE PAGE DOES NOT. A box of
   explanation stretched across 2,100px is one 260-character line, and the eye
   loses its place coming back for the next one. Tables, forms and anything
   laid out in columns are untouched — this is only for the boxes that are
   nothing but sentences, found by asking whether the box contains a table.
   (:has is already used elsewhere in this stylesheet, so it is not a new
   dependency.) */
.wrap .ledger:not(:has(table)):not(:has(.grid)) > p,
.wrap .ledger:not(:has(table)):not(:has(.grid)) > .hint,
.wrap .note, .wrap .subline{ max-width:108ch; }

/* ---------- Login page ---------- */
.login-shell{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  background:
    linear-gradient(var(--paper-line) 1px, transparent 1px) 0 0/100% 28px,
    var(--paper);
}
.login-card{
  background:var(--paper);
  border:1px solid var(--paper-line);
  border-top:4px solid var(--gold);
  border-radius:var(--radius);
  padding:36px 34px 30px;
  width:360px;
  max-width:90vw;
  box-shadow:0 2px 18px rgba(22,51,46,0.08);
}
.login-card .brand-mark{
  width:42px;height:42px;border-radius:6px;background:var(--ink);color:var(--gold);
  display:flex;align-items:center;justify-content:center;font-family:'Zilla Slab',serif;
  font-weight:700;font-size:19px;margin-bottom:14px;
}
.login-card h1{ font-size:20px; margin-bottom:2px;}
.login-card .tagline{ font-size:13px; color:var(--text-muted); margin-bottom:24px; }

.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; color:var(--text-muted); margin-bottom:5px; }
.field input{
  width:100%; padding:10px 12px;
  border:1px solid #D8D2C2; border-radius:var(--radius);
  background:#fff; font-size:14px; font-family:'Inter',sans-serif;
  color:var(--text);
}
.field input:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
/* A multi-line field (the payslip footer message, for one) looks and behaves
   like the single-line ones beside it — same width, border, font and gold
   focus ring. Left to the browser it came out narrow, in the wrong typeface,
   and plainly a different kind of box from its neighbours. */
.field textarea{
  width:100%; padding:10px 12px;
  border:1px solid #D8D2C2; border-radius:var(--radius);
  background:#fff; font-size:14px; font-family:'Inter',sans-serif;
  color:var(--text); line-height:1.55; resize:vertical;
}
.field textarea:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
/* Checkboxes/radios inside a .field shouldn't inherit the text-input look
   above (width:100%, padding, border) — that stretched them into big empty
   bordered boxes. Reset them back to their natural small square size. */
.field input[type="checkbox"], .field input[type="radio"]{
  width:16px; height:16px; padding:0; border:1px solid #D8D2C2; background:#fff;
  accent-color: var(--gold); flex-shrink:0;
}
.field input[type="checkbox"]:focus, .field input[type="radio"]:focus{
  outline:none; box-shadow:none;
}

/* ℹ️ hover tooltip — keeps long explanatory sentences out of the layout.
   Usage: <span class="info-tip" tabindex="0">ℹ️<span class="info-tip-text">…</span></span> */
.info-tip{ position:relative; display:inline-block; cursor:help; font-size:13px; }
.info-tip .info-tip-text{
  /* Kept in the layout but invisible, so it can escape clipping parents.
     visibility (not display) lets it sit above overflow:hidden containers. */
  visibility:hidden; opacity:0; pointer-events:none;
  position:absolute; left:50%; transform:translateX(-50%); bottom:calc(100% + 8px);
  width:300px; max-width:70vw; background:var(--ink); color:var(--paper); font-size:12px; font-weight:400;
  line-height:1.5; padding:10px 12px; border-radius:8px; z-index:9999; text-transform:none; letter-spacing:normal;
  box-shadow:0 8px 20px rgba(0,0,0,.2); white-space:normal; transition:opacity .12s ease;
}
.info-tip:hover .info-tip-text, .info-tip:focus .info-tip-text,
.info-tip:focus-within .info-tip-text{ visibility:visible; opacity:1; pointer-events:auto; }

/* A tooltip inside a scrolling or clipping box would otherwise be cut off.
   Any ancestor that commonly clips gets overflow allowed when a tip is hovered. */
.ledger:has(.info-tip:hover), .ee-panel:has(.info-tip:hover),
td:has(.info-tip:hover), th:has(.info-tip:hover),
.field:has(.info-tip:hover){ overflow:visible !important; }

/* Tips near the top of a container flip below the icon instead of above. */
.info-tip.tip-below .info-tip-text{ bottom:auto; top:calc(100% + 8px); }

.btn{
  display:inline-block; padding:10px 18px; border-radius:var(--radius);
  border:1px solid var(--ink); background:var(--ink); color:var(--paper);
  font-size:14px; font-weight:500; cursor:pointer; font-family:'Inter',sans-serif;
}
.btn:hover{ background:var(--ink-soft); }
.btn-block{ width:100%; text-align:center; }
.btn-ghost{ background:transparent; color:var(--ink); }
.btn-ghost:hover{ background:var(--gold-soft); }

/* ---------- The "back" link: ONE shape, everywhere ----------
   Fung: "why is some back button take the whole column, which is bigger than
   the rest. scan thru and make sure all back button are standardize".

   Two separate things were wrong, and both came from every page writing its own
   size inline instead of sharing one:

   1. THE STRETCHED ONE. On the two import pages the link sits in a flex box
      with flex-direction:column. A flex item is stretched along the CROSS axis
      by default — which in a column is the width — so "← Back to leave
      applications" was rendered 1,352px wide: the whole column, exactly as
      Fung described. display:inline-block does not save you here, because the
      stretch is the flex container's doing, not the item's.
   2. TWO SIZES. The link at the top of a page was written 13px/7px-14px and the
      one at the bottom 14px/10px-18px, so the same button was 37px tall in one
      place and 44px in another — often on the SAME page.

   So the size lives here once, and the width is pinned three ways
   (width:auto, max-width:max-content, flex:0 0 auto) plus align-self so no
   parent box — flex row, flex column or grid — can stretch it again. Any new
   page gets it right by writing class="btn btn-ghost btn-back" and no style
   attribute at all. */
.btn-back{
  display:inline-flex; align-items:center; gap:6px;
  width:auto; max-width:max-content; flex:0 0 auto; align-self:flex-start;
  justify-self:start;
  padding:8px 16px; font-size:13.5px; font-weight:500;
  text-decoration:none; white-space:nowrap;
}

/* ---------- Long tables scroll inside their own box ----------
   A table of two hundred rows used to make the PAGE two hundred rows tall, so
   the filters, the pager and the "back" link all sat below several screens of
   scrolling, and the column headings scrolled away after the first dozen rows —
   leaving you reading a wall of dates and amounts with nothing saying which
   column was which.

   assets/portal.js adds .tall-table to any box holding more rows than fit, so
   the table scrolls on its own and the page stays roughly one screen. Nothing
   is hidden: the same rows are all there, just reachable without losing the
   controls around them. */
/* THE SELECTOR HERE IS DELIBERATE — read before simplifying it.
   `.ledger` (further down this file) sets `overflow:hidden` to keep its rounded
   corners clean. Both selectors carry one class, so the LATER one won, and a
   long table inside a ledger got `max-height:70vh` from here and
   `overflow-y:hidden` from there. The rows past the first 70% of the screen
   were not scrollable — they were CLIPPED, and there was no way to reach them
   from the page at all.
   Fung, on the Leave requests list: "this page cant be scrolled down".
   `.ledger.tall-table` is two classes, so it wins wherever it sits in the file,
   and overflow-y is named explicitly rather than left to a shorthand that an
   inline `overflow-x:auto` (which many of these boxes carry, for wide tables)
   can half-override. */
.tall-table,
.ledger.tall-table{
  max-height:70vh;
  overflow-y:auto;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.tall-table thead th{
  position:sticky; top:0; z-index:3;
  background:#fff;
  /* a real line rather than a border, which sticky positioning drops */
  box-shadow:inset 0 -1px 0 var(--paper-line);
}
/* The candidates page groups its list into one box per client, so no single
   table is long but the stack of them is. Same treatment, applied to the
   stack. */
.cd-groups{ max-height:72vh; overflow:auto; -webkit-overflow-scrolling:touch; }

/* A long "add one of these" form folded away under its own heading, so it
   costs nothing until someone wants it. The heading looks and behaves like a
   heading; the arrow is what says it opens. */
.form-fold > summary{
  list-style:none; display:flex; align-items:center; gap:8px;
  padding:8px 0; user-select:none;
}
.form-fold > summary::-webkit-details-marker{ display:none; }
.form-fold > summary::before{
  content:"▸"; color:var(--gold); font-size:13px; transition:transform .12s ease;
}
.form-fold[open] > summary::before{ transform:rotate(90deg); }
.form-fold > summary:hover{ color:var(--gold); }

/* On paper the whole table should print, so the cap comes off. */
@media print{
  .tall-table, .ledger.tall-table, .cd-groups{ max-height:none; overflow:visible; }
  .tall-table thead th{ position:static; }
}

/* ---------- Text size, chosen by the person reading ----------
   Settings → Text size (also on My Profile) writes one of these onto <html>,
   and assets/portal.js puts it back on every page after that.

   It scales the page content as a whole rather than nudging individual font
   sizes, so a table's headings, its figures and the space around them stay in
   proportion — a page at Large looks like the same page, just nearer. The top
   bar is deliberately left alone: it is already comfortable, it has to stay
   put while the page scrolls, and scaling it eats screen height on a laptop.

   Standard is the size the portal has always been and is the default, so
   nothing moves for anyone who never opens this setting — and, because the
   default needs no rule, there is no flicker while the page loads. Larger
   text means more scrolling, which is why it is offered rather than imposed. */
html[data-text-size="compact"] .wrap{ zoom:0.94; }
html[data-text-size="large"]   .wrap{ zoom:1.10; }
html[data-text-size="xlarge"]  .wrap{ zoom:1.20; }

/* The chosen size is filled in, so it is obvious which one is active. */
.text-size-picker .mini-btn[aria-pressed="true"]{
  background:var(--ink); color:var(--paper); border-color:var(--ink);
}

/* ---------- Reach and readability ----------
   Measured across all 250 pages with tools/ux_sweep.js, which is what these
   numbers come from rather than taste.

   32px is the smallest control most people can hit reliably first time, and
   the difference between a 27px row of buttons and a 32px one is the
   difference between clicking "Approve" and clicking the row underneath it. */
button, .btn, .mini-btn, .icon-btn,
input[type="submit"], input[type="button"]{
  min-height:32px;
  /* inline-flex so a short label still fills the taller button rather than
     sitting against the top edge of it */
  align-items:center; justify-content:center;
}
button, .mini-btn, .icon-btn, input[type="submit"], input[type="button"]{ display:inline-flex; }
select, input[type="date"], input[type="month"], input[type="time"]{ min-height:34px; }

/* Small secondary buttons, in one place instead of inline on each page. */
.mini-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  font-size:12px; padding:6px 12px; border-radius:5px;
  border:1px solid var(--paper-line); background:#fff; color:var(--text);
  cursor:pointer; font-family:'Inter',sans-serif; white-space:nowrap;
}
.mini-btn:hover{ background:var(--gold-soft); }

/* Anything that ENDS something — employment, a record — has to look unlike
   the button that merely saves. Same size, different colour, so it is never
   hit by muscle memory while working down a list. */
.mini-btn-danger, .btn-danger{ color:var(--danger); border-color:#E5B8AE; background:#FDF6F4; }
.mini-btn-danger:hover, .btn-danger:hover{ background:#F7E5E1; }

/* Icon-only buttons still need a full-size target and a name for screen
   readers (the aria-label on the element supplies the name). */
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:32px; min-height:32px; padding:0 4px;
  border:none; background:none; cursor:pointer; font-size:16px; border-radius:5px;
  color:var(--text-muted);
}
.icon-btn:hover{ background:var(--paper-line); }
.icon-btn-danger{ color:var(--danger); }
.icon-btn-danger:hover{ background:#F7E5E1; }

/* Keyboard users could not see where they were: the only focus styling in the
   portal was on login inputs. :focus-visible shows the ring for keyboard
   focus only, so it never appears as an outline round a just-clicked button. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:2px;
  border-radius:3px;
}

/* Skip link — first thing a keyboard lands on, hidden until focused. */
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:1000;
  background:var(--ink); color:var(--paper); padding:10px 16px;
  text-decoration:none; font-size:14px; border-radius:0 0 var(--radius) 0;
}
.skip-link:focus{ left:0; }

/* The warning shown when leaving a form with unsaved typing is the browser's
   own; this is the small in-page hint that the form has been touched. */
.dirty-hint{
  position:fixed; right:18px; bottom:18px; z-index:400;
  background:var(--ink); color:var(--paper); font-size:12.5px;
  padding:9px 14px; border-radius:20px; box-shadow:0 4px 14px rgba(22,51,46,.25);
  pointer-events:none; opacity:0; transition:opacity .15s ease;
}
.dirty-hint.on{ opacity:.94; }

.error-banner{
  background:#F7E5E1; border:1px solid #E5B8AE; color:var(--danger);
  font-size:13px; padding:9px 12px; border-radius:var(--radius); margin-bottom:16px;
}

/* ---------- Headings ----------
   Section headings on this portal used to be styled <div>s. They looked right
   and were invisible to anything that navigates by structure: a screen reader
   had no heading list to jump through, and the document outline held only each
   page's single <h1>. They are real <h2> elements now, carrying the same class,
   so nothing moved by a pixel — the rules below were always doing the work. */

/* ---------- Dashboard ---------- */
.section-title{
  font-family:'Zilla Slab', serif; font-size:15px; font-weight:600;
  color:var(--ink); margin:0 0 12px; display:flex; align-items:center; gap:8px;
}
.hello{ font-size:23px; margin-bottom:var(--s-1); letter-spacing:-.01em; line-height:1.25; }
.subline{ color:var(--text-muted); font-size:13.5px; margin-bottom:var(--s-5); max-width:78ch; }

.ledger{
  border:1px solid var(--paper-line);
  border-radius:var(--radius-md);
  overflow:hidden;
  background:#fff;
  box-shadow:var(--lift-1);
}
.ledger-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:var(--s-3) var(--s-4);
  border-bottom:1px solid var(--rule);
  text-decoration:none; color:var(--text);
}
.ledger-row:last-child{ border-bottom:none; }
.ledger-row:hover{ background:#FCFAF5; }   /* gold on every hover was shouting */
.ledger-row .period{ font-weight:500; font-size:14px; }
.ledger-row .meta{ font-size:12px; color:var(--text-muted); }
.ledger-row .amt{ font-family:'IBM Plex Mono',monospace; font-size:14.5px; font-weight:500; color:var(--ink); }
.ledger-row .chev{ color:var(--text-muted); margin-left:14px; }

.empty-state{
  text-align:center; padding:48px 20px; color:var(--text-muted); font-size:13.5px;
}

/* ---------- Payslip detail ---------- */
.payslip{
  background:#fff;
  border:1px solid var(--paper-line);
  border-radius:var(--radius);
  position:relative;
  overflow:hidden;
}
.payslip::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:4px;
  background-image: radial-gradient(circle, var(--paper) 3px, transparent 3px);
  background-size: 14px 4px;
  background-color:var(--gold);
}
.payslip-head{
  /* Roomier header, and a wide gap so the logo column can never collide with
     the company name and address beside it. */
  padding:30px 34px 24px;
  border-bottom:1px dashed var(--paper-line);
  display:flex; justify-content:space-between; align-items:flex-start; gap:24px;
}
.payslip-head .co{ font-size:12.5px; color:var(--text-muted); line-height:1.65; }
.payslip-head .co + .co{ margin-top:3px; }
.payslip-head h2{ font-size:19px; margin-bottom:4px; line-height:1.3; }
.payslip-head .period-badge{
  background:var(--gold-soft); color:var(--ink); font-size:12px; font-weight:500;
  padding:5px 14px; border-radius:20px; white-space:nowrap;
}
.payslip-body{ padding:28px 34px 30px; }
.pl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 32px; }

/* Three across, for a long form that would otherwise be a scroll. The columns
   narrow rather than the page widening, so it still fits a laptop; below
   1100px it drops to two and below 700px to one, because three columns of
   half-width boxes is worse than scrolling. */
.pl-grid--3{ grid-template-columns:repeat(3, 1fr); gap:0 24px; }
@media (max-width:1100px){ .pl-grid--3{ grid-template-columns:1fr 1fr; } }
@media (max-width:700px){ .pl-grid--3{ grid-template-columns:1fr; } }
/* ---------- A form whose fields are as wide as they need to be ----------
   The candidate form was one two-column grid, so a date picker and a postal
   address were handed the same half of the page: the date sat in a box three
   times longer than the value it holds, while longer fields still felt cramped.

   TWELVE columns is the base. It was six, which divides into halves, thirds and
   two-thirds but NOT into quarters — and four short fields on one row is what
   was asked for ("put 4 things into one column if possible"): applied position,
   client company, candidate code and HR in-charge read as one line, and so do
   gender, nationality, marital status and available start date. Twelve divides
   into all of them, so each field declares the width it actually needs and the
   rows fill themselves.

   The classes say the fraction rather than a column count, because "sp2 is a
   third" only made sense while the grid had six columns and quietly meant
   something else the moment it didn't.

   This is NOT a compaction: the gap and the field padding are unchanged, and
   fields that were already full width (style="grid-column:1/-1") still are,
   since 1/-1 spans whatever the grid has.

   Below 1100px it becomes two columns and below 700px one, where every field
   takes the full row — four short boxes across a phone is worse than
   scrolling. */
.cd-grid{ display:grid; grid-template-columns:repeat(12, 1fr); gap:0 28px; }
/* The default, FIRST so the width classes below win on the fields that carry
   one: anything untagged gets a third rather than a twelfth, which would be a
   sliver too narrow to type in. */
.cd-grid > .field{ grid-column:span 4; }
/* A dropdown fills its column like every text box does. Left to itself a
   <select> is only as wide as its longest option, so "-- select --" sat in a
   stub half the width of the box beside it and the row looked ragged. Scoped to
   this grid deliberately: other screens set their own widths inline. */
.cd-grid .field select{
  width:100%; padding:10px 12px;
  border:1px solid #D8D2C2; border-radius:var(--radius);
  background:#fff; font-size:14px; font-family:'Inter',sans-serif; color:var(--text);
}
.cd-grid .field select:focus{ outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.cd-grid > .w-quarter  { grid-column:span 3;  }  /* four across — codes, names, dates */
.cd-grid > .w-third    { grid-column:span 4;  }  /* three across — dates, money       */
.cd-grid > .w-half     { grid-column:span 6;  }  /* two across — long lists           */
.cd-grid > .w-twothirds{ grid-column:span 8;  }  /* addresses                         */
.cd-grid > .w-full     { grid-column:span 12; }  /* the whole row                     */
/* Every span is reset at each breakpoint, the untagged default included. Miss
   that one and a field still asking for four columns makes the grid invent
   implicit extra columns to hold it — so a "one column" phone layout silently
   renders as several, with the tagged fields squeezed into the first. */
@media (max-width:1100px){
  .cd-grid{ grid-template-columns:repeat(2, 1fr); gap:0 24px; }
  .cd-grid > .field,
  .cd-grid > .w-quarter, .cd-grid > .w-third,
  .cd-grid > .w-half, .cd-grid > .w-twothirds{ grid-column:span 1; }
  .cd-grid > .w-full{ grid-column:span 2; }
}
@media (max-width:700px){
  .cd-grid{ grid-template-columns:1fr; gap:18px; }
  .cd-grid > .field,
  .cd-grid > .w-quarter, .cd-grid > .w-third, .cd-grid > .w-half,
  .cd-grid > .w-twothirds, .cd-grid > .w-full{ grid-column:span 1; }
}

.pl-col-title{ font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:10px; font-weight:600;}
.pl-line{ display:flex; justify-content:space-between; padding:7px 0; font-size:14px; border-bottom:1px solid var(--paper-line); }
.pl-line .val{ font-family:'IBM Plex Mono',monospace; }
.pl-net{
  margin-top:20px; padding-top:16px; border-top:2px solid var(--ink);
  display:flex; justify-content:space-between; align-items:center;
}
.pl-net .label{ font-family:'Zilla Slab',serif; font-size:15px; font-weight:600; color:var(--ink); }
.pl-net .value{ font-family:'IBM Plex Mono',monospace; font-size:22px; font-weight:500; color:var(--ink); }

@media print{
  .topbar, .no-print{ display:none !important; }
  body{ background:#fff; }
  .payslip{ border:none; }
}

/* ---------- Admin tabs ---------- */
.company-tabs{
  display:flex; gap:4px; flex-wrap:wrap; border-bottom:2px solid var(--paper-line);
  margin-bottom:0; padding-bottom:0;
}
.company-tab{
  display:flex; align-items:center; gap:8px;
  padding:10px 18px; font-size:13.5px; font-weight:500; color:var(--text-muted);
  text-decoration:none; border-bottom:3px solid transparent; margin-bottom:-2px;
}
.company-tab img{ height:18px; width:auto; max-width:28px; object-fit:contain; }
.company-tab:hover{ color:var(--ink); }
.company-tab.active{ color:var(--ink); border-bottom-color:var(--gold); font-weight:600; }
.company-tab.add-tab{ color:var(--gold); font-weight:500; }

.subnav{
  display:flex; gap:var(--s-2); margin:0 0 var(--s-5); flex-wrap:wrap;
  /* sticky does NOTHING without a top, and this had none — the only thing
     setting one was a script inside includes/admin_subnav.php, so the bar
     scrolled away on every page that draws its own. 0 is the floor; the real
     offset (the top bar's measured height) is set by assets/portal.js. */
  position:sticky; top:0; z-index:90; background:var(--paper,#fff);
  /* A deliberate breath, not a weld. This went 14px → 6px → 0, and 0 turned
     out to be a mistake in the other direction: the pills touching the blue
     header read as a rendering fault rather than a design. 10px is small
     enough that nobody reads it as a gap and large enough that the two bars
     are clearly two bars. The shadow below does the separating work that the
     old empty stripe was accidentally doing. */
  /* Equal above and below — the same measurement on both sides of the pills,
     so the bar reads as a band with the tabs centred in it rather than as tabs
     that have drifted upward. 16px: 12 still had them sitting closer to the
     header than to their own rule. The 24px below the rule is separate — that
     is the gap to the page, not part of the bar. */
  padding:var(--s-4) 0; justify-content:flex-start;
  border-bottom:1px solid var(--paper-line);
}
/* The shadow appears only once the bar is actually stuck to the header —
   assets/portal.js adds .is-pinned as it passes. At rest the bar is simply
   part of the page and casting a shadow there would look like a mistake. */
.subnav.is-pinned{ box-shadow:var(--lift-bar); border-bottom-color:transparent; }
.subnav--static{ box-shadow:none !important; }
/* A secondary row of tabs that scrolls away with the page instead of pinning.
   Everything else about it matches the main bar. */
.subnav--static{ position:static !important; top:auto !important; }

.subnav-item{
  padding:7px 14px; font-size:13px; color:var(--text-muted); text-decoration:none;
  border-radius:var(--radius-pill); border:1px solid var(--paper-line);
  background:#fff;
  transition:background .12s ease, color .12s ease, border-color .12s ease;
}
.subnav-item:hover{ background:var(--gold-soft); color:var(--ink); }
.subnav-item.active{ background:var(--ink); color:var(--paper); border-color:var(--ink); }

.pill{ font-size:11.5px; padding:2px 8px; border-radius:var(--radius-pill); background:var(--gold-soft); color:var(--ink); }

@media (max-width:640px){
  .pl-grid{ grid-template-columns:1fr; gap:18px; }
  .wrap{ padding:20px 16px 48px; }
}

/* ---------- Mobile pass — phones (<=640px) ---------- */
@media (max-width:640px){
  /* Any table wider than the screen scrolls sideways inside its own box
     instead of blowing out the page layout or forcing the whole page to
     scroll horizontally. */
  table{ font-size:12px; }
  .ledger{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .ledger table{ min-width:560px; }

  /* Admin top bar: stack the three sections (logo / month picker / sign out)
     instead of squeezing them into one row. */
  .topbar[style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
    row-gap:10px;
    padding:12px 14px;
  }
  .topbar{ flex-wrap:wrap; row-gap:10px; padding:12px 14px; }
  .topbar .who{ gap:8px; flex-wrap:wrap; }
  #nav-period-form{ justify-self:start !important; }

  /* Tab bars and subnav pills wrap onto multiple lines cleanly and don't
     require horizontal scrolling to find the tab you want. */
  .tabs, .ee-tabs, .subnav, .company-tabs{ overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
  .tab, .ee-tab, .subnav-item, .company-tab{ flex-shrink:0; }

  /* Buttons and form rows get more finger-friendly tap targets. */
  .btn, .mini-btn, input, select, textarea{ font-size:15px !important; }
  .field input, .field select{ padding:11px 12px; }

  /* Payslip header: stack company details above the amount instead of
     squeezing them side by side. */
  .payslip-head{ flex-direction:column; gap:10px; }

  .hello{ font-size:19px; }
}

/* ---------- Dense data tables ----------
   These carry most of the portal's information, and most of its visual noise.
   Three changes, all of them subtraction:

   1. Row rules use the hairline (--rule), not the card-edge line. The heavy
      rule repeated fifteen times across a payroll table turned rows of figures
      into a grid of boxes.
   2. Column headings sit on the paper rather than white, so the heading band
      reads as part of the furniture rather than as the first row of data.
   3. A row lights up on hover. On a table forty rows deep, keeping your place
      across twelve columns is the actual difficulty, and this solves it for
      free.

   Applied by table class rather than to every <table>, so a small two-column
   layout table inside a form is left alone. */
.at-table td, .lb-table td, .cd-table td, .leave-table td, .audit-table td,
.at-table th, .lb-table th, .cd-table th, .leave-table th, .audit-table th{
  border-bottom-color:var(--rule);
}
.at-table thead th, .lb-table thead th, .cd-table thead th,
.leave-table thead th, .audit-table thead th{
  background:#FCFAF6;
  border-bottom:1px solid var(--paper-line);
}
.at-table tbody tr:hover, .lb-table tbody tr:hover, .cd-table tbody tr:hover,
.leave-table tbody tr:hover, .audit-table tbody tr:hover{
  background:#FCFAF5;
}
/* A totals row is a conclusion, not another row of data. */
.at-table tr.totals td, .lb-table tr.totals td, .cd-table tr.totals td{
  border-top:1px solid var(--ink);
  background:#FCFAF6;
}

/* ---------- Buttons ----------
   A little give on press, and a focus ring that matches the field one, so
   keyboard users get the same treatment everywhere. */
.btn{ transition:background .12s ease, border-color .12s ease, transform .06s ease; }
.btn:active{ transform:translateY(1px); }
.mini-btn, .icon-btn{ transition:background .12s ease, border-color .12s ease; }

/* ---------- Grouped action bar ----------
   A row of loose buttons of wildly different widths ("Download total report
   (Excel) — Aug 2026" next to a tiny "CSV") reads as clutter: nothing tells you
   which buttons belong together, and the uneven boxes make the page look
   unfinished.

   Instead: a quiet heading naming what the group does ("Download"), and beneath
   it buttons of one uniform size. The eye reads the heading once and then scans
   a tidy row of equal choices. Reusable anywhere the same problem appears. */
.action-groups{
  display:flex; flex-wrap:wrap; gap:var(--s-6, 32px);
  margin:0 0 var(--s-6, 32px);
}
.action-group{ display:flex; flex-direction:column; gap:var(--s-3, 12px); }
.action-group__title{
  margin:0; font-size:11.5px; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-muted, #5F6459);
}
.action-group__title span{
  font-weight:500; letter-spacing:.02em; text-transform:none;
  color:var(--text-muted, #5F6459); opacity:.85;
}
.action-group__row{ display:flex; flex-wrap:wrap; gap:var(--s-2, 8px); }
/* One uniform box per choice, so a two-letter label and a three-word one
   still line up. */
.action-group .btn{
  min-width:118px; text-align:center; text-decoration:none;
  padding:10px 16px; font-size:13.5px;
}
@media (max-width:640px){
  .action-groups{ gap:var(--s-5, 24px); }
  .action-group .btn{ min-width:0; flex:1 1 auto; }
}

/* ---------- A small drop-down of occasional actions ----------
   Things reached once a year — YTD figures, the EA form — do not deserve a
   permanent button next to the ones used every payday. They sit behind one
   box that opens on click. Built on <details> so it works with no JavaScript
   and closes on Escape like any native control. */
.act-menu{ position:relative; display:inline-block; }
.act-menu > summary{
  list-style:none; cursor:pointer; user-select:none;
}
.act-menu > summary::-webkit-details-marker{ display:none; }
.act-menu > summary::after{
  content:'▾'; margin-left:8px; font-size:11px; opacity:.6;
}
.act-menu[open] > summary::after{ content:'▴'; }
.act-menu__list{
  position:absolute; z-index:60; top:calc(100% + 6px); left:0; min-width:100%;
  display:flex; flex-direction:column; padding:var(--s-1, 4px);
  background:var(--paper, #fff); border:1px solid var(--paper-line, #E4DED0);
  border-radius:var(--radius-md, 10px); box-shadow:var(--lift-2, 0 2px 8px rgba(22,51,46,.06));
}
.act-menu__list a{
  display:block; white-space:nowrap; text-decoration:none; color:var(--ink);
  font-size:13.5px; padding:9px 14px; border-radius:var(--radius-sm, 6px);
}
.act-menu__list a:hover{ background:var(--gold-soft, #F6F1E4); }

/* ---------- Where the tab bar sits, and what may push it ----------
   A green "Initiated payroll for 1 employee(s)" notice used to be printed
   above the tab bar, so every time you ran payroll the tabs jumped down the
   page and you had to scroll to find them again. Announcements are transient;
   navigation is not, so navigation goes first and the announcement appears
   underneath it.

   Done with flex order rather than by moving the markup on sixty pages: the
   notice stays where it is in the HTML (so screen readers still meet it early,
   and no page had to be re-plumbed), and only the painting order changes.
   Browsers without :has() simply keep the old order — nothing breaks. */
.wrap:has(> .subnav:not(.subnav--static)){ display:flex; flex-direction:column; }
.wrap > .subnav:not(.subnav--static){ order:-2; }
.wrap > .subnav2{ order:-1; }
/* …except a level-2 row that belongs where it is written. Payroll's action row
   is a header and is hoisted above any notice; a status filter, a set of
   Company-settings tabs or the Letters tabs read as part of the page under its
   title, and yanking them above the heading would be a different screen. They
   still PIN — they just pin from where they stand, which is all that was
   asked for: "when i scroll down, i'll still see the header, level 1 tab and
   level 2 tab together". */
.wrap > .subnav2--inplace{ order:0; }
/* And when the level-2 row IS hoisted under the tabs, the two sit flush —
   which is how they already looked once both were pinned. At rest the level-1
   bar's 24px bottom margin was still there, so the pair visibly closed up as
   soon as you scrolled. Fung: "the gap is too big between level 1 tab and
   level 2, reduce it to the range when we scroll down". One state now, not two. */
.wrap:has(> .subnav2:not(.subnav2--inplace)) > .subnav:not(.subnav--static){ margin-bottom:0; }

/* ---------- Landing on a heading, with bars pinned over the top ----------
   Jumping to #salary-adjustment used to put that heading underneath the pinned
   header and tab bars — the page had gone to the right place and looked like it
   had not. --pinned-h is measured in assets/portal.js; the fallback covers the
   moment before the script runs, and browsers with JS off. */
:root{ --pinned-h:190px; }
[id][data-month-landing], .section-title[id], .ledger[id], h1[id], h2[id], h3[id]{
  scroll-margin-top:calc(var(--pinned-h, 190px) + var(--s-4, 16px));
}

/* ---------- The second row of tabs ----------
   A page like Payroll has its own row of actions — Send Payslips, Download
   Payslips, Statutory Files. Scrolling a long payslip table used to leave both
   the tabs and those actions behind. Now the two rows stack: the main tabs stop
   under the header, and this row stops under the main tabs. The exact offset is
   measured at runtime in assets/portal.js, because both heights depend on the
   webfont and on how long the company name is. */
.subnav2{
  display:flex; gap:var(--s-2, 8px); flex-wrap:wrap; align-items:center;
  position:sticky; z-index:89;
  background:var(--paper, #FAF8F3);
  padding:var(--s-3, 12px) 0;
  margin:0 0 var(--s-5, 24px);
  border-bottom:1px solid var(--paper-line, #E4DED0);
}
/* A LEVEL-3 row — a status filter under a level-2 tab bar. It looks like the
   others and stays where it is written, but it does not pin: header + level 1 +
   level 2 is the stack that was asked for, and a fourth bar would take a third
   of a laptop screen before any content showed. assets/portal.js skips it. */
.subnav2--static{ position:static; }
.subnav2.is-pinned{
  box-shadow:var(--lift-bar, 0 6px 14px -10px rgba(22,51,46,.35));
  border-bottom-color:transparent;
}
@media (max-width:640px){
  /* Two pinned bars eat too much of a phone screen — the second one scrolls. */
  .subnav2{ position:static; }
}

/* ---------- A page's own year/month filter ----------
   Leave requests, and anywhere else that needs to pick a span without touching
   the working month in the top bar. Fung, on the requests list: "allow me to
   select by month for filtering".

   A quiet bar rather than a form to fill in: it is a control, not a task, and
   it sits between the status pills and the list without competing with either.
   The deliberate breathing space around it is the point — this used to be one
   line of grey text jammed against the table. */
.lv-filter{
  display:flex; gap:var(--s-3, 12px); align-items:flex-end; flex-wrap:wrap;
  background:#FBF8F0;
  border:1px solid var(--paper-line, #E4DED0);
  border-radius:var(--radius-md, 12px);
  padding:14px 16px;
  margin:0 0 var(--s-5, 24px);
}
.lv-filter label{
  display:block; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); font-weight:600; margin-bottom:5px;
}
.lv-filter select{
  padding:8px 12px; border:1px solid #D8D2C2; border-radius:8px;
  font-size:13.5px; background:#fff; font-family:inherit;
}
.lv-filter button{ padding:9px 18px; }
/* Year, Month and Show sit in the middle of the bar — Fung: "year month can
   move to the center" — with Status at the left and the "showing…" sentence at
   the right. An auto margin on each side is what centres them: the group takes
   the space left over after its neighbours, which keeps it centred as the
   window changes rather than pinning it at one width. On a narrow screen the
   auto margins collapse and the group simply wraps onto its own line. */
.lv-filter-mid{
  display:flex; gap:var(--s-3, 12px); align-items:flex-end; flex-wrap:wrap;
  margin-left:auto; margin-right:auto;
}
/* ---------- Status, in the filter bar rather than a second tab row ----------
   The Leave section used to carry TWO rows of sub-tabs: the section row
   (Requests, Balances, Entitlements…) and under it a status row (All, Pending,
   Approved, Rejected). Fung: "i dont think we need 2 level of subtab in leave
   tab, can combine them into one level will do."

   Status is not a place in the section — it is a filter on one list, exactly
   like the Year and Month next to it. So it moved in here and wears the same
   border, radius and padding as the selects beside it, and the Leave section
   is back to one row of tabs. */
.lv-status{ display:flex; gap:6px; flex-wrap:wrap; }
/* line-height and padding are set to the same 36px box the selects and the
   Show button render at, so the four pills, Year, Month and Show sit on one
   line with their labels level. A link and a <select> do not agree on
   line-height by themselves, which left the pills 4px taller and the Status
   label floating above the others. */
.lv-status a{
  padding:8px 14px; border:1px solid #D8D2C2; border-radius:8px;
  background:#fff; font-size:13.5px; line-height:18px; color:var(--ink);
  text-decoration:none; font-family:inherit; white-space:nowrap;
}
.lv-status a:hover{ background:var(--gold-soft); }
.lv-status a.active{
  background:var(--ink); border-color:var(--ink); color:#fff; font-weight:600;
}
/* The sentence saying what is on screen sits at the end of the row, and drops
   onto its own line before it would squeeze the selects. */
/* No margin-left:auto here any more: .lv-filter-mid's auto margins already
   push this to the end of the row, and a third auto margin would have shared
   the free space three ways and left the middle group off-centre. */
.lv-filter-note{
  font-size:12.5px; color:var(--text-muted);
  align-self:center; flex:0 1 auto; text-align:right;
}
@media (max-width:640px){
  .lv-filter-note{ margin-left:0; flex:1 1 100%; }
}

/* ---------- The month grid on the staff home screen ----------
   Fung: "show the entire calander in grid when they open the portal from their
   phone. above the pulic holidays and not a button to press in. then they may
   press onto the calander to see specifically who is on leave on which day".

   So this is not a tile. It is the month itself, on the first screen, and each
   day is a link into leave_calendar.php for that day.

   Sized for a phone first: seven columns inside a 430px screen leaves about 50
   pixels a cell, which is room for a date and a count and nothing else. On a
   wider screen the same grid simply gets roomier cells rather than changing
   shape, so the thing somebody learns on their phone is the thing they see on a
   laptop. Rendered by includes/leave_calendar_mini.php. */
.lcm-card{ padding:14px 16px 12px; margin-bottom:20px; }
.lcm-say{ font-size:12.5px; color:var(--text-muted); line-height:1.6; margin-bottom:12px; }

/* The month name with an arrow either side, small enough to sit inside a
   section heading without fighting it. */
.lcm-nav{ display:inline-flex; align-items:center; gap:4px; font-weight:400; }
.lcm-nav a{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border:1px solid #D8D2C2; border-radius:8px;
  background:#fff; color:var(--ink); text-decoration:none; font-size:15px; line-height:1;
}
.lcm-nav a:hover{ background:var(--gold-soft); }
.lcm-nav strong{ font-size:13px; min-width:66px; text-align:center; font-weight:600; }

.lcm-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.lcm-dow{
  font-size:10.5px; font-weight:700; letter-spacing:.06em; text-align:center;
  color:var(--text-muted); padding-bottom:2px;
}
/* A day. Tall enough to be a comfortable target on a phone — 44px is the size
   a thumb expects — with the date at the top and the count under it. */
.lcm-day{
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px; min-height:46px; border:1px solid var(--paper-line,#E4DED0); border-radius:9px;
  background:#fff; text-decoration:none; color:var(--ink);
  font-family:'IBM Plex Mono',monospace; padding:4px 2px;
}
.lcm-day:hover{ border-color:#C9C3B4; background:#FDFBF6; }
.lcm-day--blank{ border:none; background:transparent; min-height:0; pointer-events:none; }
/* Somebody is away: the whole cell tints, so the month reads as a pattern
   before any number is read. */
.lcm-day--away{ background:#EAF0EA; border-color:#CFDDD2; }
.lcm-day--maybe{ background:#fff; border-style:dashed; border-color:#C9B98C; }
/* A holiday or rest day is tinted differently, because "nobody is on leave" and
   "nobody is at work anyway" are different answers. */
.lcm-day--off{ background:#FAF7EF; border-color:#E7DFC9; }
.lcm-day--away.lcm-day--off{ background:#E8EEE6; }
.lcm-day--today{ box-shadow:inset 0 0 0 2px var(--ink); border-color:var(--ink); }
.lcm-n{ font-size:13px; line-height:1.1; }
.lcm-day--today .lcm-n{ font-weight:700; }
/* The count of people away — one small filled circle, which reads at a glance
   and costs no width. */
.lcm-count{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:17px; height:17px; padding:0 3px; border-radius:9px;
  background:var(--ink); color:#fff; font-size:10.5px; font-weight:700;
  font-family:'Inter',sans-serif; line-height:1;
}
.lcm-count--maybe{ background:transparent; color:var(--gold,#B8933F);
                   border:1px dashed #C9B98C; font-weight:600; }
/* A holiday with nobody on leave still gets a mark, so the tint is explained. */
.lcm-dot{ width:5px; height:5px; border-radius:50%; background:var(--gold,#B8933F); opacity:.65; }

.lcm-key{
  display:flex; gap:12px; flex-wrap:wrap; margin-top:11px;
  font-size:11px; color:var(--text-muted); align-items:center;
}
.lcm-key .sw{ display:inline-block; width:11px; height:11px; border-radius:3px;
              vertical-align:-1px; margin-right:5px; border:1px solid transparent; }
.lcm-key .sw--away{ background:#EAF0EA; border-color:#CFDDD2; }
.lcm-key .sw--maybe{ background:#fff; border:1px dashed #C9B98C; }
.lcm-key .sw--off{ background:#FAF7EF; border-color:#E7DFC9; }

/* Roomier on anything bigger than a phone. The grid does not change shape —
   only the cells breathe — so it is the same calendar everywhere. */
@media (min-width:560px){
  .lcm-grid{ gap:7px; }
  .lcm-day{ min-height:58px; }
  .lcm-n{ font-size:14px; }
  .lcm-dow{ font-size:11px; }
}

/* ── DECIDING SOMETHING, WITH A REASON ──────────────────────────────────────
   Fung: "leave approval, when reject, allow a feedback box for the approver to
   add why is it rejected."

   Used on the admin Leave and Claims pages and on My Team, so the three cannot
   drift apart. Approve stays a single button; the two actions that carry a note
   fold away beneath it, so the everyday case is still one click and the column
   does not turn into a wall of boxes. Spaced rather than stacked flush — a row
   of controls jammed together is hard to aim at and unpleasant to look at. */
.decide-stack{ display:flex; flex-direction:column; gap:9px; align-items:flex-start; min-width:150px; }
.decide-note summary{ font-size:12px; cursor:pointer; color:var(--text-muted); padding:3px 0; }
.decide-note summary.is-reject{ color:var(--danger); }
.decide-note[open] summary{ margin-bottom:8px; }
.decide-note form{ display:flex; flex-direction:column; gap:8px; min-width:230px; max-width:300px; }
.decide-note textarea{ width:100%; padding:9px 11px; border:1px solid #D8D2C2; border-radius:6px;
                       font-size:12.5px; font-family:inherit; line-height:1.55; resize:vertical; }
.decide-note textarea:focus{ outline:none; border-color:#B9A77F;
                             box-shadow:0 0 0 3px rgba(185,167,127,.18); }
.decide-hint{ margin:0; font-size:11px; color:var(--text-muted); line-height:1.55; }

/* The reason once the decision is made, shown beside the status. */
.decide-why{ color:var(--text-muted); font-size:11px; margin-top:5px; line-height:1.55; }

/* At phone width the decide column is the whole row, so let the boxes use it. */
@media (max-width:560px){
  .decide-stack{ min-width:0; width:100%; }
  .decide-note form{ min-width:0; max-width:none; width:100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   DESIGN REFRESH — PHASE 1 (2026-11-25)
   Fung: "i dont think the web is user friendly enough … can it be more
   modernize and classy". Approved concept: same teal + gold the portal already
   owns, used with more restraint — white cards on a soft stone ground, one
   elegant serif (Fraunces) for page titles only, Inter for everything else,
   figures in Inter's tabular numerals instead of a typewriter mono, softer
   corners, quieter tabs, one clear primary button.

   Everything is in this one block, at the END of the file so it wins over the
   older rules above without editing them. Deleting this block (and restoring
   the @import line at the top) brings the previous look back exactly. Layout,
   the heights of the bars and the sticky-offset maths in portal.js are
   untouched: this changes colour, type, corners and surfaces, not where things
   sit.
   ══════════════════════════════════════════════════════════════════════════ */
:root{
  --ink:#12302B;            /* deep teal — nav bar, primary buttons, titles   */
  --ink-soft:#1E4740;
  --paper:#F6F5F1;          /* soft stone page ground                          */
  --paper-line:#E6E3DA;     /* card edges                                      */
  --rule:#EFECE4;           /* hairlines inside tables                         */
  --gold:#B08A3E;           /* accent only — focus marks, highlights           */
  --gold-soft:#F3E7CC;
  --text:#1D2320;
  --text-muted:#5E655F;     /* 6:1 on white — passes for small captions        */
  --danger:#9B2F22;
  --ok:#2F6B4F;
  --field-border:#DCD8CD;
  --surface:#FFFFFF;
  --radius:10px;            /* controls                                        */
  --radius-sm:8px;
  --radius-md:14px;         /* cards                                           */
  --lift-1:0 1px 2px rgba(18,48,43,.04);
  --lift-2:0 10px 28px -14px rgba(18,48,43,.22);
  --lift-bar:0 8px 18px -12px rgba(18,48,43,.30);
}

body{ background:var(--paper); color:var(--text); line-height:1.55; }

/* Type: one serif, used sparingly. Page titles carry it; every other heading
   is Inter, which reads as calm and current rather than as a ledger costume. */
h1{ font-family:'Fraunces', Georgia, serif; font-weight:600; letter-spacing:-.012em; color:var(--ink); }
h2, h3{ font-family:'Inter', system-ui, sans-serif; font-weight:600; letter-spacing:-.005em; color:var(--ink); }
.section-title{ font-family:'Inter', system-ui, sans-serif; font-size:15.5px; font-weight:600; letter-spacing:-.005em; }
.hello{ font-family:'Fraunces', Georgia, serif; font-size:28px; font-weight:600; }
.login-card h1{ font-size:24px; }

/* Figures: Inter with tabular numerals, so columns of money line up like a
   bank statement. Covers the classes above AND the 37 inline styles that still
   name the old mono — !important is what lets a stylesheet beat an inline
   font-family. The old slab serif's two inline uses map to Fraunces. */
.mono, .ledger-row .amt, .pl-line .val, .pl-net .value, .lcm-day,
[style*="IBM Plex Mono"]{
  font-family:'Inter', system-ui, sans-serif !important;
  font-variant-numeric:tabular-nums; letter-spacing:-.005em;
}
[style*="Zilla Slab"]{ font-family:'Fraunces', Georgia, serif !important; }
.pl-net .label{ font-family:'Inter', system-ui, sans-serif; font-weight:600; }
.pl-net .value{ font-size:24px; font-weight:600; }
table{ font-variant-numeric:tabular-nums; }

/* ---------- Top bar: always Arkedge ink; the company colour is the accent ----------
   includes/malaysia_data.php → arkedge_topbar_style_vars() no longer sets the
   bar's background. The company's own colour shows as a 3px stripe along the
   bottom of the bar (an inset shadow, so the bar's measured height — which the
   pinned tab bars below depend on — does not change) and as the tile behind the
   company mark. */
.topbar{
  background:var(--ink);
  box-shadow:inset 0 -3px 0 var(--company-accent, var(--gold));
}
.topbar .brand-mark{
  border-radius:10px;
  background:var(--company-accent, var(--gold));
  color:var(--company-accent-ink, var(--ink));
  font-family:'Fraunces', Georgia, serif; font-weight:600;
}
.topbar .brand-name{ font-family:'Inter', system-ui, sans-serif; font-size:15.5px; font-weight:600; letter-spacing:-.005em; }
.topbar .brand-sub{ letter-spacing:.01em; }
.settings-icon{ border-radius:10px; }

/* ---------- Sign-in ----------
   The ruled "ledger paper" background and the gold top border were the most
   dated thing a visitor saw first. Now: a plain stone ground and one white card
   that floats slightly. */
.login-shell{ background:var(--paper); }
.login-card{
  background:var(--surface);
  border:1px solid var(--paper-line);
  border-radius:18px;
  padding:40px 36px 32px;
  box-shadow:var(--lift-2);
}
.login-card .brand-mark{
  border-radius:12px; background:var(--ink); color:var(--gold);
  font-family:'Fraunces', Georgia, serif; font-weight:600;
}

/* ---------- Fields ---------- */
.field label{ font-size:13px; font-weight:500; color:var(--text); margin-bottom:6px; }
.field input, .field textarea, .field select, .cd-grid .field select{
  border:1px solid var(--field-border); border-radius:var(--radius);
  background:var(--surface); color:var(--text);
  transition:border-color .12s ease, box-shadow .12s ease;
}
.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.field select{ min-height:44px; padding:10px 12px; }
.field input[type="checkbox"], .field input[type="radio"]{ border-radius:4px; }
.field input:focus, .field textarea:focus, .field select:focus,
.cd-grid .field select:focus{
  outline:none; border-color:var(--ink);
  box-shadow:0 0 0 3px rgba(18,48,43,.12);
}
input, select, textarea, button{ font-family:inherit; }
input[type="checkbox"], input[type="radio"]{ accent-color:var(--ink); }

/* ---------- Buttons: one primary, quiet secondaries ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:10px 18px;
  border-radius:var(--radius); border:1px solid var(--ink);
  background:var(--ink); color:#FFFFFF;
  font-size:14px; font-weight:600; letter-spacing:-.003em;
  text-decoration:none;
}
.btn:hover{ background:var(--ink-soft); border-color:var(--ink-soft); }
.btn-ghost{
  background:var(--surface); color:var(--text);
  border:1px solid var(--field-border); font-weight:500;
}
.btn-ghost:hover{ background:#F1EFE9; border-color:#CFCABD; }
.btn-block{ display:flex; width:100%; }
.mini-btn{
  border-radius:var(--radius-sm); border:1px solid var(--field-border);
  background:var(--surface); font-weight:500;
}
.mini-btn:hover{ background:#F1EFE9; }
.mini-btn-danger, .btn-danger{
  color:var(--danger); background:#FBEAE6; border-color:#F0CFC7;
}
.mini-btn-danger:hover, .btn-danger:hover{ background:#F6DCD5; }
.icon-btn{ border-radius:var(--radius-sm); }
.icon-btn:hover{ background:#EFEDE7; }
.act-menu__list{ background:var(--surface); border-radius:12px; box-shadow:var(--lift-2); }
.act-menu__list a:hover{ background:#F4F2EC; }

/* ---------- Cards and surfaces ---------- */
.ledger{ border-radius:var(--radius-md); border-color:var(--paper-line); background:var(--surface); box-shadow:var(--lift-1); }
.ledger-row{ padding:14px 18px; }
.ledger-row:hover{ background:#FAF9F6; }
.payslip{ border-radius:var(--radius-md); }
.payslip-head .period-badge{ background:#EEF2F0; color:var(--ink); font-weight:600; }
.empty-state{ padding:56px 20px; }
.error-banner{ background:#FBEAE6; border-color:#F0CFC7; color:#7E2418; border-radius:12px; padding:12px 14px; }
.info-tip .info-tip-text{ border-radius:10px; }
.lv-filter{ background:var(--surface); border-radius:var(--radius-md); }
.lv-filter select, .lv-status a{ border-color:var(--field-border); border-radius:var(--radius-sm); }
.lcm-day{ border-radius:10px; }

/* ---------- Tabs: quieter, one clear "you are here" ----------
   Phase 2 replaces this row with a grouped sidebar; until then the pills lose
   their outlines so fifteen of them read as a menu rather than as fifteen
   buttons, and the active one is the single solid shape on the row. */
.subnav-item{
  border:1px solid transparent; background:transparent; color:var(--text-muted);
  font-weight:500;
}
.subnav-item:hover{ background:#ECEAE3; color:var(--text); }
.subnav-item.active{ background:var(--ink); color:#FFFFFF; border-color:var(--ink); }
.subnav, .subnav2{ background:var(--paper); }
.company-tab.active{ border-bottom-color:var(--ink); }

/* ---------- Status chips ----------
   .pill keeps working as before (now neutral). The .chip set is new, for the
   phase-3 screens: one shape, colour by meaning, text always dark enough. */
.pill{ background:#EFEDE7; color:#3F4641; font-weight:600; }
.chip{ display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; line-height:1.5; white-space:nowrap; }
.chip--ok{ background:#E3EFE8; color:#245A40; }
.chip--warn{ background:#FBEFD6; color:#7A4E00; }
.chip--draft{ background:#EFEDE7; color:#4A504B; }
.chip--bad{ background:#FBEAE6; color:#8E2A1C; }
.chip--info{ background:#E6EEF6; color:#1F4E79; }

/* ---------- Dense tables ---------- */
.at-table thead th, .lb-table thead th, .cd-table thead th,
.leave-table thead th, .audit-table thead th, .tall-table thead th{ background:#FAF9F6; }
.at-table tbody tr:hover, .lb-table tbody tr:hover, .cd-table tbody tr:hover,
.leave-table tbody tr:hover, .audit-table tbody tr:hover{ background:#FAF9F6; }

/* Focus ring: ink rather than gold reads as more deliberate on white. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible{
  outline:2px solid var(--ink); outline-offset:2px; border-radius:6px;
}
/* ════════════════════════ end design refresh phase 1 ═════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   DESIGN REFRESH — PHASE 2 (2026-11-25): navigation
   ══════════════════════════════════════════════════════════════════════════ */

/* ---------- Admin: a grouped sidebar on wide screens ----------
   includes/admin_subnav.php prints the same tab bar as always, plus a heading
   per group (People / Pay / Time / Company). Below 1400px nothing changes: the
   headings are hidden and it is the familiar horizontal row. From 1400px it
   becomes a fixed column under the header; assets/portal.js publishes the
   header's height as --topbar-h and leaves this bar's position to these rules.
   WHY 1400 AND NOT LOWER: the payroll table needs about 1,104px. At 1200px a
   228px sidebar left it 936px, so it had to scroll sideways inside its box
   (tools/payroll_frozen_headings_test.js). From 1400px it fits beside the
   sidebar; 1280–1366px laptops keep the full-width row. The same number is
   in portal.js (sideMQ) — change both together. */
.subnav-group{ display:none; }
@media (min-width:1400px){
  .subnav.subnav--sidebar{
    position:fixed; left:0; top:var(--topbar-h, 64px); bottom:0;
    width:228px; margin:0; padding:18px 12px 24px;
    display:flex; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:2px;
    background:var(--surface); border-bottom:0; border-right:1px solid var(--paper-line);
    overflow-y:auto; z-index:80; box-shadow:none !important;
  }
  .subnav--sidebar .subnav-group{
    display:block; margin:16px 10px 6px; font-size:11px; font-weight:600;
    letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted);
  }
  .subnav--sidebar .subnav-group:first-child{ margin-top:0; }
  .subnav--sidebar .subnav-item{
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    padding:9px 12px; border-radius:var(--radius-sm); font-size:14px; color:var(--text);
  }
  .subnav--sidebar .subnav-item:hover{ background:#F1EFE9; }
  .subnav--sidebar .subnav-item.active{ background:var(--ink); color:#FFFFFF; }
  .subnav--sidebar .subnav-item .pill{ margin-left:auto; }
  /* The page moves over to make room. */
  body:has(.subnav--sidebar) .wrap{ margin-left:228px; margin-right:auto; padding-left:32px; padding-right:32px; }
  /* portal.js drops the page's top padding when the tab bar is the first thing
     on it (so a pinned ROW sits flush under the header). As a sidebar the bar is
     out of the flow, so the page keeps its breathing room. */
  body:has(.subnav--sidebar) .wrap{ padding-top:28px !important; }
}
@media print{ .subnav--sidebar{ display:none !important; } body:has(.subnav--sidebar) .wrap{ margin-left:0; } }

/* ---------- Admin header on a phone ----------
   The company name used to wrap freely inside a narrow box — "Ayer / Biru /
   Trading / Sdn / Bhd", one word per line, making the header five lines tall.
   One line with an ellipsis instead; the switcher's own list shows every
   company in full, so nothing is lost. The "Admin · all companies" sub-line
   goes too: on a phone the space is worth more than the reminder. */
@media (max-width:640px){
  .topbar .company-pill{ max-width:100%; padding:8px 12px; }
  .topbar .company-pill-name,
  .topbar span.company-pill-name{ white-space:nowrap !important; overflow:hidden !important;
    text-overflow:ellipsis; max-width:52vw !important; }
  .topbar .brand-sub{ display:none; }
  /* On the admin bar the logo tile alone says where you are; the company you
     are working in is the name that matters, so it gets the room. */
  .topbar.topbar--three .brand-name{ display:none; }
}

/* ---------- Staff: bottom tab bar on phones ----------
   includes/app_topbar.php prints it on every staff page; it shows only at
   phone width, where a thumb reaches the bottom of the screen and not the top.
   The page gets matching room underneath so the last line is never hidden. */
.app-tabbar{ display:none; }
@media (max-width:640px){
  .app-tabbar{
    position:fixed; left:0; right:0; bottom:0; z-index:150;
    display:grid; grid-auto-flow:column; grid-auto-columns:1fr;
    background:var(--surface); border-top:1px solid var(--paper-line);
    padding:6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow:0 -6px 18px -14px rgba(18,48,43,.35);
  }
  .app-tabbar a{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    min-height:48px; text-decoration:none; color:var(--text-muted); font-size:11px; font-weight:500;
    border-radius:10px;
  }
  .app-tabbar a.on{ color:var(--ink); font-weight:700; }
  .app-tabbar a.on svg{ stroke-width:2.2; }
  body:has(.app-tabbar){ padding-bottom:calc(72px + env(safe-area-inset-bottom, 0px)); }
  /* The tab bar now carries Home, so the "← Home" link in the header would
     only repeat it. */
  .topbar:has(+ .app-tabbar) a.logout[href="app_home.php"]{ display:none; }
}
/* ════════════════════════ end design refresh phase 2 ═════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   DESIGN REFRESH — PHASE 4 (2026-11-27): shared classes for the most-repeated
   one-off inline styles. Each replaced a style="…" that was copied page by page
   (86 copies of one text box, 41 of one green banner …), still in the old
   colours. The selectors carry the element name on purpose: an inline style
   beat everything, and `input.ui-input-sm` keeps beating a general rule such as
   `.field input` the same way, so sizes do not shift.
   ══════════════════════════════════════════════════════════════════════════ */
input.ui-input, select.ui-input, textarea.ui-input{
  width:100%; padding:10px 12px; border:1px solid var(--field-border, #DCD8CD);
  border-radius:var(--radius, 10px); background:var(--surface, #fff); color:var(--text); font:inherit; font-size:14px;
}
input.ui-input-sm, select.ui-input-sm, textarea.ui-input-sm{
  padding:8px 11px; border:1px solid var(--field-border, #DCD8CD);
  border-radius:var(--radius-sm, 8px); background:var(--surface, #fff); color:var(--text); font:inherit; font-size:13.5px;
  min-height:0;
}
input.ui-input:focus, select.ui-input:focus, textarea.ui-input:focus,
input.ui-input-sm:focus, select.ui-input-sm:focus, textarea.ui-input-sm:focus{
  outline:none; border-color:var(--ink); box-shadow:0 0 0 3px rgba(18,48,43,.12);
}
.error-banner.banner-ok, .banner-ok{ background:#E3EFE8; border-color:#BFD9C9; color:#245A40; }
table.ui-table{ width:100%; border-collapse:collapse; font-size:13px; }
th.ui-th{ text-align:left; padding:8px 10px; border-bottom:1px solid var(--paper-line); font-size:11.5px;
          text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); background:#FAF9F6; }
td.ui-td{ padding:9px 10px; border-bottom:1px solid var(--rule, var(--paper-line)); }

/* iPhone Safari gives date/time fields an intrinsic minimum width of its own,
   which ignores width:100% — on the Leave page ("Day you worked", the start
   and end dates) the box ran past the right edge of its card. Reported from a
   phone, 27 Nov 2026. Dropping the native appearance lets the box obey its
   width; the date picker still opens on tap. */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"]{
  -webkit-appearance:none; appearance:none;
  min-width:0; max-width:100%;
}
input[type="date"]::-webkit-date-and-time-value{ text-align:left; min-height:1.4em; }
/* ════════════════════════ end design refresh phase 4 ═════════════════════ */

/* Short help line under a form field (e.g. Last working day). */
.field .hint{ font-size:12px; color:var(--text-muted); margin-top:4px; line-height:1.4; }
.banner-warn{ padding:9px 14px; border:1px solid #E7D3A1; background:#FBF3E2; color:#6B5217; border-radius:8px; font-size:13px; }
.banner-warn a{ color:inherit; font-weight:600; }
