/* Leave Form System — base application styles
   Typography upgrade: HR staff use this all day. Base 13pt (≈17.3px) hits
   the user's stated readability floor and clears the "tiny gov form" feel.
   13pt is also the iOS form-input zoom threshold, so inputs stay 13pt+.
   Reduced motion + canvas particle layer behind chrome, three-ply card depth,
   stagger entrance on cards. Anti-AI-slop: no purple, no Inter, no glassmorphism. */
:root {
  --brand:#0d4a76;
  --brand-2:#1474b8;
  --brand-soft:#e6f0fb;
  --ink:#1b1f24;
  --muted:#465260;        /* darkened from #5f6b78 -> ~8:1 on white (WCAG AAA), app-wide senior-readability standard (no faint grey) */
  --bg:#eef3f8;
  --card:#fff;
  --border:#d9e0e7;
  --warn:#c47c00;
  --bad:#b00020;
  --good:#1d7a4d;
  --pending:#7a5b00;

  /* Typography scale (pt-based per user spec) */
  --fs-xs: 11pt;      /* caption, table meta */
  --fs-sm: 12pt;      /* help text, table meta */
  --fs-base: 13pt;    /* body, table cells, form labels */
  --fs-md: 13pt;      /* form inputs (matches base; avoids iOS zoom) */
  --fs-lg: 15pt;      /* section subtitles, card H2 */
  --fs-xl: 18pt;      /* fieldset legend, secondary heading */
  --fs-2xl: 22pt;     /* page H1 */
  --fs-3xl: 28pt;     /* KPI numerals */

  /* Three-ply card shadow — gentle close shadow + medium mid + deep tinted glow.
     Layered shadows = real depth perception, not the Tailwind shadow-2xl reflex. */
  --shadow-card: 0 1px 2px rgba(13,74,118,.05), 0 4px 12px -2px rgba(13,74,118,.08), 0 16px 32px -12px rgba(13,74,118,.15);
  --shadow-card-hover: 0 1px 2px rgba(13,74,118,.06), 0 8px 22px -4px rgba(13,74,118,.12), 0 24px 48px -16px rgba(13,74,118,.22);
  --shadow-input: inset 0 1px 0 rgba(0,0,0,.02), 0 1px 2px rgba(13,74,118,.04);
  --shadow-input-focus: 0 0 0 3px rgba(20,116,184,.18), 0 4px 12px -2px rgba(20,116,184,.18);
  --shadow-btn: 0 1px 0 rgba(255,255,255,.4) inset, 0 1px 2px rgba(13,74,118,.12), 0 4px 10px -2px rgba(13,74,118,.18);
  --shadow-btn-hover: 0 1px 0 rgba(255,255,255,.5) inset, 0 2px 4px rgba(13,74,118,.15), 0 8px 18px -4px rgba(13,74,118,.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: linear-gradient(180deg, #eef3f8 0%, #e3ecf4 100%) fixed;
  color: var(--ink);
  font: var(--fs-base)/1.55 -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "ss01", "kern", "liga";
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Ambient particle layer (cloned + recoloured from TangubUnifiedSystem
   cswd/ambient-particles.js). Fixed behind content, pointer-events off,
   z-index -1. Operator sees gentle navy motes drifting up. */
.ambient {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100vw; height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(180deg, #0d4a76 0%, #0a3d63 100%);
  color: #fff;
  border-bottom: 3px solid var(--brand-2);
  box-shadow: 0 4px 16px -4px rgba(13,74,118,.45);
  position: relative; z-index: 10;
}
.topbar a { color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; }
.brand-mark {
  display:inline-block; width:38px; height:38px; line-height:38px; text-align:center;
  background:#fff; color:var(--brand); border-radius:8px; font-weight:800;
  font-size: 14pt;
  box-shadow: 0 2px 4px rgba(0,0,0,.18), inset 0 -2px 0 rgba(0,0,0,.08);
}
.brand-mark.big { width:64px; height:64px; line-height:64px; font-size:22pt; }
.brand-text { font-size: var(--fs-base); letter-spacing: .2px; }
.mainnav { display: flex; gap: 4px; }
.mainnav a {
  position: relative;
  padding: 9px 14px; border-radius: 4px;
  font-size: var(--fs-base); font-weight: 500;
  transition: color .18s ease, background .18s ease;
}
.mainnav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: #fff; border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s cubic-bezier(.4,.0,.2,1);
}
.mainnav a:hover { background: rgba(255,255,255,.10); text-decoration: none; }
.mainnav a:hover::after { transform: scaleX(1); }
.useractions { display: flex; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.userbadge {
  padding: 6px 12px; background: rgba(255,255,255,.10); border-radius: 99px;
  border: 1px solid rgba(255,255,255,.18);
}
.userbadge em { opacity: .8; font-style: normal; font-size: var(--fs-xs); }

.container { max-width: 1360px; margin: 22px auto 60px; padding: 0 16px; }
.sitefoot { text-align: center; padding: 24px 16px 12px; color: var(--muted); font-size: var(--fs-sm); }

.pagehead { display:flex; justify-content:space-between; align-items:center; gap:16px; margin: 10px 0 20px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.01em; color: var(--brand); }
.pagehead p { margin: 4px 0 0; font-size: var(--fs-base); }
.muted { color: var(--muted); }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.small { font-size: var(--fs-sm); }

/* Cards — three-ply shadow + entrance lift. Hover deepens shadow & nudges up
   for the "this is selectable / interactive" affordance. */
.card {
  background: var(--card);
  border: 1px solid rgba(217,224,231,.7);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .25s ease, transform .25s ease;
  animation: lfs-card-in .35s cubic-bezier(.2,.7,.2,1) both;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 700; color: var(--brand); letter-spacing: -.005em; }
.card h2 { margin: 0 0 14px; font-size: var(--fs-lg); font-weight: 700; color: var(--brand); letter-spacing: -.005em; }
@keyframes lfs-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--card);
  border: 1px solid rgba(217,224,231,.7);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .25s ease, transform .25s ease;
}
.kpi:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.kpi-num { display: block; font-size: var(--fs-3xl); font-weight: 700; color: var(--brand); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-lbl { display: block; color: var(--muted); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; font-weight: 600; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: var(--fs-base); }
.table thead th {
  background: linear-gradient(180deg, #f4f8fc 0%, #ebf1f7 100%);
  font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase;
  letter-spacing: .08em; color: var(--brand);
  border-bottom: 2px solid var(--border);
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #f7fbff; }
.table.small th, .table.small td { padding: 8px 10px; font-size: var(--fs-sm); }

.row-actions { white-space: nowrap; display: inline-flex; gap: 4px; }

/* Buttons — slight bevel + raised shadow for tactile feel. Hover deepens. */
.btn {
  display: inline-flex; align-items:center; gap:8px;
  padding: 10px 16px; font-size: var(--fs-base); line-height: 1.2; font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
  color: var(--ink);
  border: 1px solid #c9d3df; border-radius: 8px; cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.btn:hover { background: linear-gradient(180deg, #f6f9fc 0%, #e8eff5 100%); box-shadow: var(--shadow-btn-hover); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-btn); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-input-focus); }   /* keyboard focus ring on link-buttons (a11y) */
.btn-primary {
  background: linear-gradient(180deg, #2589cc 0%, #1474b8 50%, #0e5a93 100%);
  color: #fff; border-color: #0a4d80;
  text-shadow: 0 -1px 0 rgba(0,0,0,.18);
}
.btn-primary:hover { background: linear-gradient(180deg, #2c93d6 0%, #1a7fc2 50%, #0e5a93 100%); color: #fff; }
.btn-warn {
  background: linear-gradient(180deg, #d68a18 0%, #c47c00 100%);
  color: #fff; border-color: #9e6500;
  text-shadow: 0 -1px 0 rgba(0,0,0,.18);
}
.btn-warn:hover { background: linear-gradient(180deg, #df9a30 0%, #c47c00 100%); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; justify-content: center; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 99px;
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  background: #e6ecf2; color: #334;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.06);
}
.badge-pending      { background: #fff4d6; color: #7a5b00; }
.badge-approved     { background: #d6f4e3; color: #1d7a4d; }
.badge-disapproved  { background: #f4d6d6; color: #b00020; }
.badge-cancelled    { background: #e6ecf2; color: #5f6b78; }
.badge-warn         { background: #fff4d6; color: #7a5b00; }
.badge-admin        { background: #d6e0fb; color: #1a3a8e; }
.badge-hr           { background: #d6f4e3; color: #1d7a4d; }
.badge-dept_head    { background: #fff4d6; color: #7a5b00; }
.badge-employee     { background: #e6ecf2; color: #5f6b78; }
.muted-sm           { color: var(--muted); font-size: var(--fs-sm); }   /* was #777/11px — failed WCAG AA; now AAA + readable */

.alert {
  padding: 13px 18px; border-radius: 10px; margin-bottom: 14px;
  border: 1px solid; font-size: var(--fs-base);
  box-shadow: 0 2px 6px rgba(13,74,118,.06);
}
.alert-ok  { background: #d6f4e3; color: #1d7a4d; border-color: #b7e3c8; }
.alert-err { background: #f4d6d6; color: #b00020; border-color: #e6b8b8; }
.alert-prefill { background: var(--brand-soft); color: var(--brand); border-color: #b6d2eb; }
.alert-prefill a { color: var(--brand); font-weight: 700; }
.alert-balance { background: #f7fbe6; color: #5c6b1c; border-color: #d8e5a3; }
.alert-balance strong { color: var(--good); font-weight: 700; }
.alert-balance .muted-sm { color: var(--muted); font-size: var(--fs-sm); margin-left: 8px; }

.basis-grid { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; gap: 12px; align-items: center; padding: 12px 0; }
.basis-cell { text-align: center; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #fafcfe; }
.basis-cell.op { background: transparent; border: 0; font-size: 28px; font-weight: 700; color: var(--brand); }
.basis-cell.strong { background: #f7fbe6; border-color: #b7e3c8; }
.basis-cell .big { display: block; font-size: 26px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.basis-cell small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
@media (max-width:700px) {
  .basis-grid { grid-template-columns: 1fr; }
  .basis-cell.op { font-size: 20px; padding: 4px; }
}

/* Forms — bigger fields, focus depth, fieldset legends in brand color.
   Each row staggers in on first render via animation-delay. */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 22px; align-items: end; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid fieldset {
  grid-column: span 3;
  border: 1px solid rgba(217,224,231,.8); border-radius: 10px;
  padding: 18px 22px 14px; margin: 8px 0;
  display:grid; grid-template-columns:repeat(3,1fr); gap:18px 22px;
  background: rgba(255,255,255,.55);
}
.form-grid fieldset legend {
  padding: 4px 10px;
  font-weight: 700; color: var(--brand);
  font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em;
  background: var(--brand-soft); border-radius: 99px;
  border: 1px solid #b6d2eb;
}
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-base); }
.lbl > span { color: var(--brand); font-weight: 600; font-size: var(--fs-base); }
.lbl em {
  color: var(--bad); font-style: normal; margin-left: 3px;
  font-weight: 700;
}
.lbl input, .lbl select, .lbl textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid #c9d3df; border-radius: 8px;
  font-size: var(--fs-md); background: #fff; color: var(--ink);
  font-family: inherit; line-height: 1.4;
  box-shadow: var(--shadow-input);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.lbl input::placeholder, .lbl textarea::placeholder { color: #98a4b1; }
.lbl input:hover, .lbl select:hover, .lbl textarea:hover { border-color: #95acbf; }
.lbl input:focus, .lbl select:focus, .lbl textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: var(--shadow-input-focus);
}
.lbl input:disabled, .lbl input[readonly] { background: #f4f7fa; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-base); padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-2); cursor: pointer; }
.err { color: var(--bad); font-size: var(--fs-sm); font-weight: 500; margin-top: 2px; }
.form-row { grid-template-columns: repeat(6, 1fr); }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; padding-top: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; padding: 16px 18px; }
.filters label { display:flex; flex-direction:column; font-size: var(--fs-sm); color: var(--brand); font-weight: 600; gap:6px; }
.filters input, .filters select { padding: 9px 11px; border: 1.5px solid #c9d3df; border-radius: 8px; font-size: var(--fs-base); box-shadow: var(--shadow-input); }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--shadow-input-focus); }

.datalist { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0; }
.datalist dt { color: var(--muted); }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action { border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.action h3 { margin: 0 0 8px; font-size: 14px; color: var(--brand); }

.inline { display: inline-flex; gap: 8px; align-items: center; }
.inline input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; }

/* Login */
.loginpage { background: linear-gradient(135deg, #0d4a76, #1474b8); min-height: 100vh; display: grid; place-items: center; }
.loginbox { background: #fff; padding: 28px 28px 22px; border-radius: 10px; width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.loginhead { text-align: center; margin-bottom: 16px; }
.loginhead h1 { margin: 8px 0 4px; font-size: 18px; }
.loginsub { margin: 0; color: var(--muted); font-size: 12px; }
.loginbox label { display: block; margin-bottom: 10px; }
.loginbox label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.loginbox label input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.loginbox .btn { margin-top: 6px; }
.seedhint { margin: 12px 0 0; padding: 8px 10px; background: #fff8d6; border: 1px solid #ead7a3; border-radius: 5px; font-size: 11.5px; color: #6a4f00; text-align: center; }
.seedhint code { background: #fff; padding: 1px 5px; border-radius: 3px; border: 1px solid #d6c79a; font-family: ui-monospace, monospace; }
.loginfoot { margin: 14px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

/* Responsive */
@media (max-width: 800px) {
  .topbar { grid-template-columns: 1fr auto; }
  .mainnav { grid-column: 1 / -1; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid fieldset { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3 { grid-column: span 1; }
  .action-grid { grid-template-columns: 1fr; }
  .datalist { grid-template-columns: 1fr; }
}

/* =========================================================================
   v4 — Split-screen login hero + masthead owner subtitle
   Added 2026-05-26. References the brand tokens already declared above
   (--brand #0d4a76, --brand-2 #1474b8). Every visual choice is intentional:
   - Hero on the LEFT matches the architectural symmetry of the legislative
     building in the source art; reading order pushes attention from
     identity (left) to action (right).
   - Form on the RIGHT is the primary-action zone (right-of-center is the
     most thumb-reachable area on right-handed users and most pointer paths).
   - Mobile uses the portrait composition (logo top, building bottom),
     which keeps the city seal visible even when the form sheet overlaps.
   - No new gradients, no Tailwind indigo, no two-stop trust gradient — we
     reuse the existing CSC Form 6 navy.
   ========================================================================= */

/* Official Municipality of Midsalip seal used as the brand mark. Round PNG
   with alpha — no rounded box around it. Source is 144x144; serve 1x+2x. */
.sp-seal { display: inline-block; width: 40px; height: 40px; object-fit: contain; }
.sp-seal-lg { width: 96px; height: 96px; }
.brand picture { display: inline-flex; align-items: center; }

/* Brand stack in the masthead — app name + owner office sub-line */
.brand-stack { display: inline-flex; flex-direction: column; line-height: 1.15; }
.brand-stack .brand-text { font-size: var(--fs-base); font-weight: 700; letter-spacing: .2px; }
.brand-stack .brand-owner {
  font-size: 10.5px; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.78);
  margin-top: 2px;
}
@media (max-width: 800px) {
  .brand-stack .brand-owner { display: none; }
}

/* Split login: hero left / form right on desktop, stacked on mobile */
body.loginpage-split {
  background: #0a3d63;
  display: block;
  min-height: 100vh;
  margin: 0;
}
.login-shell {
  display: grid;
  /* Hero dominates 3:1 so the login card lives as a compact "secondary" zone */
  grid-template-columns: minmax(0, 3fr) minmax(320px, 1fr);
  min-height: 100vh;
}
.login-hero {
  position: relative;
  overflow: hidden;
  background: #0a3d63;
}
.login-hero {
  position: relative;
  /* Brand-navy background so contain-fit letterbox is invisible — the panel
     reads as one continuous navy frame around the building composition. */
  background: linear-gradient(135deg, #0d4a76 0%, #0a3d63 55%, #082f4e 100%);
}
.login-hero picture,
.login-hero img {
  display: block;
  width: 100%;
  height: 100%;
  /* FIT = show the entire hero composition (wordmark + building + bubbles)
     without cropping. cover would crop on tall panels; contain shows it
     all and the navy bg below fills the letterbox. */
  object-fit: contain;
  object-position: center;
}

/* Brand overlay layered on top of the hero image — real DOM text + the
   actual SP seal asset. Anchored to the upper-left of the navy area so it
   echoes the source-art composition without baking text into pixels. */
.hero-brand {
  position: absolute;
  top: 8%; left: 6%;
  z-index: 2;
  pointer-events: none;
  max-width: 48%;
}
.hero-brand .hero-seal {
  display: block;
  width: clamp(64px, 9vw, 130px);
  height: auto;
  margin-bottom: clamp(14px, 2vw, 28px);
}
.hero-brand .hero-wordmark {
  margin: 0 0 clamp(8px, 1vw, 16px);
  font-size: clamp(28px, 4.3vw, 64px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(8, 47, 78, .35);
}
.hero-brand .hero-tag {
  margin: 0;
  font-size: clamp(11px, 1.05vw, 15px);
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}
@media (max-width: 900px) {
  /* Mobile uses the portrait image; brand overlay scales tighter */
  .hero-brand { top: 6%; left: 5%; max-width: 70%; }
}
@media (max-width: 600px) {
  .hero-brand .hero-wordmark { font-size: clamp(22px, 7vw, 32px); }
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 32px 28px;
  background: linear-gradient(180deg, #f4f8fc 0%, #e3ecf4 100%);
}
.login-card {
  width: 100%;
  /* 4x compact: was 460 -> now 340. Less visual weight on the right panel. */
  max-width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 24px 22px 20px;
  box-shadow: 0 14px 40px rgba(10, 61, 99, .18), 0 2px 6px rgba(10, 61, 99, .08);
}
.login-card-head { text-align: center; margin-bottom: 18px; }
.login-card-head .brand-mark { margin: 0 auto 10px; display: inline-block; }
.login-card-head .sp-seal-lg { margin: 0 auto 12px; display: block; }
.login-card-head picture { display: inline-block; }
.login-card-head h1 {
  margin: 0 0 4px;
  font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  color: var(--brand);
}
.login-card-head .sp-seal-lg { width: 76px; height: 76px; }
.login-owner {
  margin: 0; font-size: 12px; color: var(--ink);
  font-weight: 600; line-height: 1.35;
}
.login-owner-sub {
  display: block; margin-top: 2px;
  font-size: 11px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.login-form label { display: block; margin-bottom: 12px; }
.login-form label span {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 4px; font-weight: 600;
}
.login-form label input {
  width: 100%; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff;
  transition: border-color var(--motion-ui, 180ms) var(--ease-standard, ease),
              box-shadow var(--motion-ui, 180ms) var(--ease-standard, ease);
}
.login-form .btn { padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
.login-form label { margin-bottom: 10px; }
.login-owner { font-size: 11px; }
.login-owner-sub { font-size: 10px; letter-spacing: .07em; }
.loginfoot { font-size: 10.5px; margin-top: 10px; }
.login-form label input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(20, 116, 184, .18);
}
.login-form .btn { margin-top: 4px; }

/* Tablet 601-900px: stack vertically with the LANDSCAPE image on top
   (portrait source kicks in only at true mobile widths). Wider card. */
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; grid-template-rows: 32vh auto; }
  .login-hero { min-height: 240px; }
  .login-panel {
    background: linear-gradient(180deg,
      rgba(244, 248, 252, 0) 0%,
      rgba(244, 248, 252, .82) 14%,
      #e3ecf4 28%);
    margin-top: -40px;
    position: relative;
    z-index: 1;
    padding: 24px 24px 32px;
  }
  .login-card {
    box-shadow: 0 10px 28px rgba(10, 61, 99, .22);
    max-width: 480px;
  }
}

/* True mobile: portrait image, slightly taller hero, tighter card */
@media (max-width: 600px) {
  .login-shell { grid-template-rows: 38vh auto; }
  .login-hero { min-height: 280px; }
  /* Portrait variant has the seal + wordmark in its TOP third — anchor the
     crop to the top so brand identity stays in frame on small viewports.
     !important defeats source-order quirks across browser cache layers. */
  .login-hero img,
  .login-hero picture { object-position: 0% 0% !important; }
  .login-card {
    padding: 22px 20px 18px;
    max-width: 100%;
  }
  .login-card-head h1 { font-size: 17px; }
}

/* Reduced motion — disable focus transitions for users who request it */
@media (prefers-reduced-motion: reduce) {
  .login-form label input { transition: none; }
}

/* =========================================================================
   v5 — Persistent left sidebar (vertical tabs) shell
   Replaces the cramped topbar for authenticated pages.
   - Sidebar 248px on desktop, off-canvas drawer below 900px.
   - Brand stack at top (seal + app name + owner office), nav middle, user/
     signout at bottom (sticky to viewport via flex column).
   - Active state = colored left bar + soft bg tint (Linear/Stripe pattern).
   - Drawer is CSS-only via a hidden checkbox + label (no JS).
   - Reused brand tokens, no new gradients, no Tailwind indigo, no emoji icons.
   ========================================================================= */

:root {
  --sidebar-w: 220px;
  --sidebar-bg: linear-gradient(180deg, #0a3d63 0%, #082f4e 100%);
}

/* Hide the topbar when shelled (it's the unauthenticated layout). */
body.app-shelled .topbar { display: none; }

/* App shell: sidebar fixed-left, main shifts right. Footer sits below. */
body.app-shelled { padding-left: var(--sidebar-w); }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,.06);
  color: #fff;
  display: flex; flex-direction: column;
  z-index: 30;
  box-shadow: 6px 0 24px -8px rgba(8, 47, 78, .35);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff; text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand picture { display: inline-flex; flex: 0 0 auto; }
.sidebar-brand .sp-seal { width: 44px; height: 44px; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.sidebar-app {
  font-size: 14px; font-weight: 700; letter-spacing: .2px; color: #fff;
}
.sidebar-owner {
  margin-top: 3px;
  font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
  color: rgba(255,255,255,.72); text-transform: uppercase;
}

.sidebar-nav {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.snav {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  color: rgba(255,255,255,.92);
  font-size: 15px; font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  /* 3D base: top highlight bevel + bottom shadow groove inside the pill */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06),
              inset 0 -1px 0 rgba(0,0,0,.18),
              0 1px 2px rgba(0,0,0,.18);
  transition: background var(--motion-ui, 180ms) var(--ease-standard, ease),
              color var(--motion-ui, 180ms) var(--ease-standard, ease),
              transform var(--motion-ui, 180ms) var(--ease-standard, ease),
              box-shadow var(--motion-ui, 180ms) var(--ease-standard, ease);
}
.snav svg { width: 22px; height: 22px; flex: 0 0 22px; color: rgba(255,255,255,.78); }
.snav:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 100%);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14),
              inset 0 -1px 0 rgba(0,0,0,.24),
              0 6px 14px -4px rgba(0,0,0,.35);
}
.snav:hover svg { color: #fff; }
.snav.is-active {
  background: linear-gradient(180deg, rgba(20,116,184,.55) 0%, rgba(20,116,184,.25) 100%);
  color: #fff;
  font-weight: 700;
  /* Punched 3D for active — bright top bevel, deep bottom shadow + glow */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.30),
              inset 0 -2px 0 rgba(0,0,0,.32),
              0 10px 22px -8px rgba(20,116,184,.65),
              0 2px 4px rgba(0,0,0,.22);
}
.snav.is-active::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px;
  width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #9bd1f3, #4ea8de);
  box-shadow: 0 0 14px rgba(78,168,222,.7);
}
.snav.is-active svg { color: #cbe6f7; }

.sidebar-foot {
  padding: 12px 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-user {
  display: flex; flex-direction: column;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: #fff; text-decoration: none;
  line-height: 1.25;
}
.sidebar-user:hover { background: rgba(255,255,255,.10); text-decoration: none; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; }
.sidebar-user-role {
  margin-top: 2px;
  font-size: 10.5px; color: rgba(255,255,255,.65);
  text-transform: uppercase; letter-spacing: .08em;
}
.sidebar-signout .btn { padding: 8px 10px; font-size: 13px; }

/* App main — sits to the right of the sidebar */
.app-main { min-height: 100vh; }
body.app-shelled .container { max-width: 1240px; margin: 22px auto 60px; padding: 0 24px; }

/* Mobile top strip — only shown when sidebar is collapsed */
.app-topstrip { display: none; }

/* Drawer mechanics (CSS-only, no JS) */
.sidebar-toggle { position: absolute; left: -9999px; }
.sidebar-scrim { display: none; }

@media (max-width: 900px) {
  body.app-shelled { padding-left: 0; }
  .app-topstrip {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #0d4a76 0%, #0a3d63 100%);
    color: #fff;
    position: sticky; top: 0; z-index: 25;
    box-shadow: 0 4px 12px -4px rgba(13,74,118,.45);
  }
  .app-topstrip-brand {
    display: inline-flex; align-items: center; gap: 8px;
    color: #fff; font-weight: 700; font-size: 14px;
    text-decoration: none;
  }
  .app-topstrip-brand .sp-seal { width: 26px; height: 26px; }
  .hamburger {
    display: inline-flex; flex-direction: column; justify-content: center;
    gap: 4px; width: 38px; height: 38px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255,255,255,.10);
    transition: background var(--motion-ui, 180ms) var(--ease-standard, ease);
  }
  .hamburger:hover { background: rgba(255,255,255,.18); }
  .hamburger span {
    display: block; height: 2px; background: #fff; border-radius: 2px;
    transition: transform var(--motion-ui, 180ms) var(--ease-standard, ease),
                opacity var(--motion-ui, 180ms) var(--ease-standard, ease);
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--motion-medium, 240ms) var(--ease-emphasized, ease);
  }
  .sidebar-toggle:checked ~ .sidebar { transform: translateX(0); }
  .sidebar-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(8, 47, 78, .55);
    opacity: 0; pointer-events: none;
    z-index: 20;
    transition: opacity var(--motion-medium, 240ms) var(--ease-standard, ease);
  }
  .sidebar-toggle:checked ~ .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-toggle:checked ~ .app-topstrip .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .sidebar-toggle:checked ~ .app-topstrip .hamburger span:nth-child(2) { opacity: 0; }
  .sidebar-toggle:checked ~ .app-topstrip .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  body.app-shelled .container { padding: 0 14px; margin: 14px auto 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .hamburger span, .sidebar-scrim { transition: none; }
}

/* =========================================================================
   v8 — Dashboard SP-Secretary spotlight
   "Front office" gets center stage on /dashboard. Brand-navy gradient with
   the real SP seal as a deliberate watermark (12% opacity, large), KPI
   tiles inside on translucent white, primary CTAs aligned bottom-left.
   No Tailwind indigo, no two-stop trust gradient — reuses --brand tokens.
   ========================================================================= */
.sp-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px 32px;
  margin: 0 0 22px;
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(20,116,184,.35) 0%, transparent 55%),
    linear-gradient(135deg, #0d4a76 0%, #0a3d63 55%, #082f4e 100%);
  color: #fff;
  border: 1px solid #08334d;
  box-shadow: 0 18px 44px -16px rgba(8, 47, 78, .55),
              0 2px 8px rgba(13, 74, 118, .25);
  overflow: hidden;
}
.sp-spotlight-mark {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.sp-spotlight-mark img {
  display: block;
  width: clamp(108px, 14vw, 180px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.32));
}
.sp-spotlight-text { min-width: 0; }
.sp-spotlight-eyebrow {
  margin: 0 0 6px;
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: rgba(255,255,255,.78);
}
.sp-spotlight-eyebrow code {
  display: inline-block;
  background: rgba(255,255,255,.14);
  padding: 1px 7px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: #fff;
}
.sp-spotlight-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700; letter-spacing: -.015em;
  line-height: 1.1;
  color: #fff;
}
.sp-spotlight-meta {
  margin: 0 0 18px;
  font-size: var(--fs-base);
  color: rgba(255,255,255,.82);
}
.sp-spotlight-meta strong { color: #fff; }

.sp-spotlight-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
}
.sp-spotlight-kpis > div {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.14);
}
.sp-spotlight-kpis dt {
  margin: 0 0 4px;
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.72);
}
.sp-spotlight-kpis dd {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700; line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.sp-spotlight-split {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs); font-weight: 500;
  color: rgba(255,255,255,.7);
  letter-spacing: .02em;
}
.sp-spotlight-stack {
  display: flex; flex-direction: column; gap: 2px;
  font-size: var(--fs-base);
}
.sp-spotlight-stack-row {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: clamp(15px, 1.6vw, 19px); font-weight: 700;
}
.sp-spotlight-stack-lbl {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px; border-radius: 5px;
  background: rgba(255,255,255,.16);
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-align: center;
}

.sp-spotlight-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}
/* Tone the secondary button inside the dark spotlight to read well */
.sp-spotlight-actions .btn:not(.btn-primary) {
  background: rgba(255,255,255,.10);
  color: #fff;
  border-color: rgba(255,255,255,.28);
  box-shadow: none;
}
.sp-spotlight-actions .btn:not(.btn-primary):hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.42);
  color: #fff;
}

@media (max-width: 720px) {
  .sp-spotlight {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 22px 22px;
    text-align: left;
  }
  .sp-spotlight-mark { justify-content: flex-start; }
  .sp-spotlight-mark img { width: 96px; }
}

/* Highlight SP rows in the Recent table so the front office stays visible */
.row-sp td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); }
.row-sp td { background: linear-gradient(90deg, rgba(20,116,184,.06) 0%, transparent 60%); }

/* =========================================================================
   v10 — Implement user-supplied design study
   - Sidebar: MAIN MENU / SYSTEM section labels, pill nav refinement, user
     card with avatar circle + status dot + chevron
   - Department hero card: light-tinted gradient with column-watermark SVG,
     pill shield-badge, oversized navy heading, tagline with accent rule,
     CTAs with inline SVG icons, floating right-side info card
   - Search input: pill shape with embedded magnifier icon
   - Section heading icon for "Regular / Casual employees"
   Anti-slop guardrail: every color from the existing brand tokens
   (--brand #0d4a76, --brand-2 #1474b8, --brand-soft #e6f0fb).
   ========================================================================= */

/* --- Sidebar section labels --------------------------------------------- */
.sidebar-section-label {
  margin: 16px 6px 8px 18px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em;
  color: rgba(255, 255, 255, .48);
}

/* --- Sidebar nav: pill with subtle gradient + lift, brighter active ---- */
.snav {
  background: linear-gradient(180deg, rgba(255,255,255,.045) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.snav:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.04) 100%);
  border-color: rgba(255,255,255,.16);
}
.snav.is-active {
  background: linear-gradient(180deg, rgba(20,116,184,.32) 0%, rgba(20,116,184,.16) 100%);
  border-color: rgba(78,168,222,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12),
              0 6px 18px -6px rgba(20,116,184,.55);
  color: #fff;
}
/* Chevron at far right of active item — render via ::after for zero markup */
.snav.is-active::after {
  content: "";
  margin-left: auto;
  width: 6px; height: 6px;
  border-right: 2px solid #9bd1f3;
  border-top: 2px solid #9bd1f3;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

/* --- Sidebar user card: avatar + name/role + chevron + status dot ------ */
.sidebar-user {
  display: grid;
  grid-template-columns: 40px 1fr 12px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff; text-decoration: none;
  transition: background var(--motion-ui, 180ms) var(--ease-standard, ease);
}
.sidebar-user:hover { background: rgba(255,255,255,.10); }
.sidebar-user-avatar {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: rgba(255,255,255,.78);
}
.sidebar-user-avatar svg { width: 22px; height: 22px; display: block; }
.sidebar-user-dot {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #22c55e;                /* green online */
  border: 2px solid #082f4e;          /* matches sidebar bg so it punches out */
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .35);
}
.sidebar-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  margin-top: 2px;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.sidebar-user-chev {
  width: 12px; height: 12px;
  color: rgba(255,255,255,.55);
}

/* --- Department hero card (light variant) ------------------------------ */
.dept-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 28px;
  align-items: center;
  padding: 36px 40px;
  margin: 0 0 22px;
  border-radius: 18px;
  border: 1px solid #d6e5f1;
  background:
    radial-gradient(75% 100% at 100% 0%, rgba(20,116,184,.10) 0%, transparent 60%),
    linear-gradient(180deg, #f9fcff 0%, #e9f2fa 100%);
  overflow: hidden;
  box-shadow: 0 14px 36px -16px rgba(13, 74, 118, .25),
              0 2px 4px rgba(13, 74, 118, .06);
}
.dept-hero-watermark {
  position: absolute;
  right: 6%; top: 50%;
  transform: translateY(-50%);
  width: 360px; height: auto;
  pointer-events: none;
  opacity: .55;
  z-index: 0;
}
.dept-hero-text { position: relative; z-index: 1; min-width: 0; }
.dept-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid #b6d2eb;
  color: var(--brand);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(13,74,118,.10);
}
.dept-hero-badge svg { width: 14px; height: 14px; color: var(--brand-2); }
.dept-hero-title {
  margin: 16px 0 8px;
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 800; letter-spacing: -.022em;
  line-height: 1.05;
  color: var(--brand);
}
.dept-hero-tag {
  margin: 0 0 22px;
  padding-bottom: 14px;
  font-size: var(--fs-base);
  color: var(--muted);
  position: relative;
  max-width: 38ch;
}
.dept-hero-tag::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 72px; height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-2) 0%, var(--brand) 100%);
}
.dept-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.dept-hero-actions .btn { font-size: 14px; padding: 10px 16px; }

/* Floating info card on the right side of the hero */
.dept-hero-info {
  position: relative; z-index: 1;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #d6e5f1;
  box-shadow: 0 10px 28px -10px rgba(13, 74, 118, .25);
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 14px;
  row-gap: 10px;
}
.dept-hero-info-icon {
  grid-row: span 2;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-2);
}
.dept-hero-info-icon svg { width: 22px; height: 22px; }
.dept-hero-info-list { margin: 0; display: contents; }
.dept-hero-info-list dt {
  grid-column: 2;
  margin: 0;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.dept-hero-info-list dd {
  grid-column: 2;
  margin: -4px 0 4px;
  font-size: 15px; font-weight: 700;
  color: var(--brand);
  line-height: 1.25;
}

@media (max-width: 900px) {
  .dept-hero { grid-template-columns: 1fr; gap: 16px; padding: 24px 22px; }
  .dept-hero-watermark { width: 200px; right: -20px; opacity: .35; }
  .dept-hero-title { font-size: clamp(24px, 6vw, 36px); }
}

/* --- Search: pill with embedded magnifier ------------------------------ */
.filters-pill { align-items: flex-end; gap: 12px; }
.filters-pill .lbl {
  display: block;
  font-size: 13px; font-weight: 700; color: var(--brand);
  margin-bottom: 8px;
}
.pill-search { flex: 1 1 360px; }
.pill-search-wrap {
  position: relative; display: block;
}
.pill-search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
}
.pill-search-wrap input[type="search"] {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid #d6e5f1;
  border-radius: 99px;
  background: #fff;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(13,74,118,.04);
  transition: border-color var(--motion-ui, 180ms) var(--ease-standard, ease),
              box-shadow var(--motion-ui, 180ms) var(--ease-standard, ease);
}
.pill-search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(20,116,184,.18);
}
.btn-pill {
  padding: 10px 22px;
  border-radius: 99px;
  font-weight: 600;
}

/* --- Section heading icon (Regular/Casual employees) ------------------- */
.h2-with-icon {
  display: inline-flex; align-items: center; gap: 12px;
}
.h2-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-2);
  border: 1px solid #c7dcef;
}
.h2-icon svg { width: 22px; height: 22px; }

/* --- Leave form: quick-scenario toolbar -------------------------------- */
.quick-scenarios {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 18px; margin: 0 0 18px;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid #c7dcef;
  box-shadow: 0 2px 6px rgba(13, 74, 118, .06);
}
.quick-scenarios-label {
  font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand);
  margin-right: 4px;
}
.quick-scenarios .muted-sm {
  margin-left: auto;
  font-size: 12px; color: var(--muted);
}
.quick-scenarios .btn-pill {
  background: #fff;
  color: var(--brand);
  border: 1px solid #b6d2eb;
  font-weight: 600;
}
.quick-scenarios .btn-pill:hover {
  background: var(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
}

/* Brief highlight when JS auto-fills a field — soft cyan pulse */
@keyframes lfs-autofill-pulse {
  0%   { background: rgba(20,116,184,.22); box-shadow: 0 0 0 3px rgba(20,116,184,.18); }
  100% { background: #fff; box-shadow: 0 0 0 0 rgba(20,116,184,0); }
}
.auto-filled { animation: lfs-autofill-pulse .9s ease-out; }

/* --- Accounting-style ledger table ------------------------------------- */
.ledger-book + .ledger-book { margin-top: 18px; }
.ledger-book .ledger-ending-balance {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 14px; border-radius: 99px;
  background: var(--brand-soft); border: 1px solid #b6d2eb;
  font-size: 13px;
}
.ledger-book .ledger-ending-balance strong {
  font-size: 16px; font-weight: 800;
  color: var(--brand); font-variant-numeric: tabular-nums;
}
.ledger-book .ledger-ending-balance strong.neg { color: #b00020; }

.table-ledger tbody td, .table-ledger thead th, .table-ledger tfoot th {
  vertical-align: middle;
}
.table-ledger .ledger-debit  { color: #b00020; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-ledger .ledger-credit { color: #1d7a4d; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-ledger .ledger-zero   { color: #b8c2cc; font-weight: 400; }
.table-ledger .neg           { color: #b00020; }

.table-ledger tr.ledger-bf td {
  background: linear-gradient(90deg, rgba(20,116,184,.06) 0%, transparent 80%);
  border-bottom: 2px solid #b6d2eb;
  font-size: 13.5px;
}
.badge-bf {
  display: inline-block;
  padding: 2px 9px; border-radius: 99px;
  background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
}
.table-ledger tfoot tr.ledger-totals th {
  background: linear-gradient(180deg, #f4f8fc 0%, #ebf1f7 100%);
  border-top: 2px solid var(--border);
  font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Ledger formula breakdown ----------------------------------------- */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 820px) { .formula-grid { grid-template-columns: 1fr; } }
.formula-card {
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f0f6fb 100%);
  border: 1px solid #c7dcef;
  box-shadow: 0 4px 12px -6px rgba(13, 74, 118, .15);
}
.formula-card h3 {
  margin: 0 0 12px;
  font-size: 15px; font-weight: 700;
  color: var(--brand); letter-spacing: -.005em;
}
.formula-list {
  margin: 0;
  display: grid; grid-template-columns: 1fr auto;
  row-gap: 6px; column-gap: 16px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.formula-list dt { margin: 0; color: var(--ink); }
.formula-list dd { margin: 0; text-align: right; font-weight: 600; }
.formula-list dd.cred { color: #1d7a4d; }
.formula-list dd.deb  { color: #b00020; }
.formula-list dt.end, .formula-list dd.end {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 2px solid #b6d2eb;
  font-weight: 800;
  font-size: 15px;
  color: var(--brand);
}
.formula-list dd.end.neg { color: #b00020; }

/* --- Monthly summary --------------------------------------------------- */
.monthly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 980px) { .monthly-grid { grid-template-columns: 1fr; } }
.monthly-card { min-width: 0; }
.monthly-card h3 {
  margin: 0 0 8px;
  font-size: 14px; font-weight: 700;
  color: var(--brand);
}
.table-monthly th, .table-monthly td { padding: 7px 10px; font-size: 13px; }
.table-sm thead th {
  font-size: 11px; padding: 8px 10px;
}

/* --- CSC §7.A snapshot ------------------------------------------------- */
.ledger-csc { background: #fff; }
.table-csc th, .table-csc td { font-size: 14px; padding: 12px 14px; }
.table-csc tbody th {
  font-weight: 600; color: var(--ink); text-align: left;
}
.table-csc tr.csc-balance th, .table-csc tr.csc-balance td {
  background: var(--brand-soft);
  border-top: 2px solid #b6d2eb;
  font-weight: 800;
  font-size: 16px;
  color: var(--brand);
}
.table-csc tr.csc-balance .neg { color: #b00020; }
