/* =====================================================================
   CUTEPAY MOBILE — DESIGN SYSTEM
   ---------------------------------------------------------------------
   One vocabulary for the whole app: Admin, Staff, Manager.

   Loaded AFTER the old template stylesheet, so anything below wins. The
   template is kept only for its Bootstrap plumbing - grid, modal,
   offcanvas, dropdown. Everything a person actually looks at is defined
   here.

   The app is almost entirely about reading data, so the system is built
   around that: one record component that stays legible whether a name is
   four characters or forty, whether a salary is 900 or 9,00,00,000, and
   whether the list has three rows or three hundred.

   Sections
     1  Tokens
     2  Base & typography
     3  App shell   - status bar, app bar, page, bottom nav, drawer
     4  Surfaces    - card, section head
     5  Data        - stat tiles, record rows, key/value, money, tables
     6  Status      - chips, badges, dots
     7  Controls    - buttons, inputs, search, segmented, filter chips
     8  Feedback    - empty, skeleton, error, toast, sheet
     9  Utilities
   ===================================================================== */


/* =====================================================================
   1  TOKENS
   ===================================================================== */
:root{
  /* Brand — royal sapphire.
     Authoritative rather than fashionable, and far enough from the
     green/red/amber the app uses for status that a brand surface and a
     state can never be mistaken for one another. Deep enough to carry a
     hero, light enough that an active tab and a primary button still
     read at a glance. Change these eleven values and the whole
     application follows. */
  --cp-brand-50:#eff6ff;
  --cp-brand-100:#dbeafe;
  --cp-brand-200:#bfdbfe;
  --cp-brand-300:#93c5fd;
  --cp-brand-400:#60a5fa;
  --cp-brand-500:#1e40af;
  --cp-brand-600:#1e3a8a;
  --cp-brand-700:#172554;
  --cp-brand-800:#111d43;
  --cp-brand-900:#0b1330;
  /* A warm metal, used sparingly — never for a whole surface. */
  --cp-accent:#f0b429;

  /* Semantics. Money that arrives is emerald, money that leaves is rose,
     waiting is amber. Used only as tint + text, never as a filled block,
     so a list of forty rows never turns into a traffic light. */
  --cp-pos:#059669;   --cp-pos-bg:#ecfdf5;  --cp-pos-bd:#a7f3d0;
  --cp-neg:#e11d48;   --cp-neg-bg:#fff1f2;  --cp-neg-bd:#fecdd3;
  --cp-warn:#b45309;  --cp-warn-bg:#fffbeb; --cp-warn-bd:#fde68a;
  --cp-info:#0369a1;  --cp-info-bg:#f0f9ff; --cp-info-bd:#bae6fd;
  --cp-idle:#475569;  --cp-idle-bg:#f1f5f9; --cp-idle-bd:#e2e8f0;

  /* Surfaces. Not pure white - a faint cool ground makes white cards
     read as raised without needing a heavy shadow. */
  --cp-bg:#f4f6fb;
  --cp-surface:#ffffff;
  --cp-surface-2:#f8fafc;
  --cp-surface-3:#eef2f7;
  --cp-line:#e6eaf2;
  --cp-line-soft:#eff2f7;

  /* Ink */
  --cp-ink:#0f172a;
  --cp-ink-2:#475569;
  --cp-ink-3:#7c8598;
  --cp-ink-on:#ffffff;

  /* Type. One scale, no in-between sizes. */
  --cp-font:"Open Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --cp-font-display:"Poppins","Open Sans",system-ui,sans-serif;
  --cp-fs-display:26px;
  --cp-fs-h1:20px;
  --cp-fs-h2:16px;
  --cp-fs-body:14px;
  --cp-fs-sm:13px;
  --cp-fs-xs:11.5px;
  --cp-fs-micro:10.5px;

  /* Space — a 4px rhythm */
  --cp-1:4px; --cp-2:8px; --cp-3:12px; --cp-4:16px;
  --cp-5:20px; --cp-6:24px; --cp-8:32px; --cp-10:40px;

  /* Radius */
  --cp-r-sm:10px; --cp-r:14px; --cp-r-lg:20px; --cp-r-xl:26px; --cp-r-pill:999px;

  /* Elevation. Two soft layers beat one hard one. */
  --cp-sh-1:0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.05);
  --cp-sh-2:0 2px 4px rgba(15,23,42,.04), 0 6px 16px rgba(15,23,42,.07);
  --cp-sh-3:0 8px 20px rgba(15,23,42,.10), 0 18px 44px rgba(15,23,42,.10);
  --cp-sh-brand:0 8px 24px rgba(30,64,175,.28);

  /* Chrome heights, so pages can reserve exactly the right space */
  --cp-appbar-h:58px;
  --cp-nav-h:64px;
  --cp-safe-t:env(safe-area-inset-top,0px);
  --cp-safe-b:env(safe-area-inset-bottom,0px);

  --cp-ease:cubic-bezier(.4,0,.2,1);
  --cp-fast:.16s; --cp-med:.26s;
}

/* =====================================================================
   2  BASE & TYPOGRAPHY
   ===================================================================== */
body.cp-app{
  background:var(--cp-bg)!important;
  color:var(--cp-ink)!important;
  font-family:var(--cp-font)!important;
  font-size:var(--cp-fs-body);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overflow-x:hidden;
}
.cp-app *{ -webkit-tap-highlight-color:transparent; }
.cp-app h1,.cp-app h2,.cp-app h3,.cp-app h4,.cp-app h5,.cp-app h6{
  font-family:var(--cp-font-display);
  color:var(--cp-ink);
  letter-spacing:-.01em;
  margin:0;
}
.cp-app a{ color:var(--cp-brand-500); text-decoration:none; }

.cp-display{ font-family:var(--cp-font-display); font-size:var(--cp-fs-display); font-weight:700; letter-spacing:-.02em; line-height:1.15; }
.cp-h1{ font-family:var(--cp-font-display); font-size:var(--cp-fs-h1); font-weight:700; letter-spacing:-.015em; }
.cp-h2{ font-family:var(--cp-font-display); font-size:var(--cp-fs-h2); font-weight:650; letter-spacing:-.01em; }
.cp-body{ font-size:var(--cp-fs-body); color:var(--cp-ink); }
.cp-sm{ font-size:var(--cp-fs-sm); color:var(--cp-ink-2); }
.cp-xs{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); }
/* A label above a number. Small caps carry hierarchy without shouting. */
.cp-label{
  font-size:var(--cp-fs-micro); font-weight:700; letter-spacing:.07em;
  text-transform:uppercase; color:var(--cp-ink-3);
}


/* =====================================================================
   3  APP SHELL
   ===================================================================== */

/* ---- App bar --------------------------------------------------------
   Sits on frosted glass so content scrolling under it stays sensed
   rather than cut off. */
.cp-appbar{
  position:fixed; top:0; left:0; right:0; z-index:1030;
  height:calc(var(--cp-appbar-h) + var(--cp-safe-t));
  padding:var(--cp-safe-t) var(--cp-4) 0;
  display:flex; align-items:center; gap:var(--cp-3);
  background:color-mix(in srgb,var(--cp-surface) 82%,transparent);
  backdrop-filter:saturate(180%) blur(16px);
  -webkit-backdrop-filter:saturate(180%) blur(16px);
  border-bottom:1px solid var(--cp-line-soft);
}
.cp-appbar__title{
  font-family:var(--cp-font-display); font-size:17px; font-weight:650;
  color:var(--cp-ink); letter-spacing:-.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; flex:1;
}
.cp-appbar__sub{ display:block; font-family:var(--cp-font); font-size:var(--cp-fs-xs); font-weight:400; color:var(--cp-ink-3); }
.cp-appbar__actions{ display:flex; align-items:center; gap:var(--cp-2); flex-shrink:0; }

/* Round 40px touch targets - the minimum that feels reliable one-handed */
.cp-iconbtn{
  width:40px; height:40px; flex:0 0 40px;
  display:inline-flex; align-items:center; justify-content:center;
  border:0; border-radius:12px; background:var(--cp-surface-3);
  color:var(--cp-ink); font-size:16px; position:relative;
  transition:transform var(--cp-fast) var(--cp-ease), background var(--cp-fast);
}
.cp-iconbtn:active{ transform:scale(.93); }
/* A tinted button, not a filled one. The app bar is a light surface, so a
   solid brand block sat on it like a hole; the tint still reads as the
   one action on the bar without shouting over the page title. */
.cp-iconbtn--brand{
  background:var(--cp-brand-50); color:var(--cp-brand-600);
  border:1px solid var(--cp-brand-200); box-shadow:none;
}
.cp-iconbtn--brand:active{ background:var(--cp-brand-100); }
.cp-iconbtn__dot{
  position:absolute; top:7px; right:7px; min-width:16px; height:16px; padding:0 4px;
  border-radius:var(--cp-r-pill); background:var(--cp-neg); color:#fff;
  font-size:9.5px; font-weight:800; line-height:16px; text-align:center;
  border:2px solid var(--cp-surface);
}

/* ---- Page ----------------------------------------------------------- */
.cp-page{
  padding-top:calc(var(--cp-appbar-h) + var(--cp-safe-t) + var(--cp-4));
  padding-bottom:calc(var(--cp-nav-h) + var(--cp-safe-b) + var(--cp-6));
  min-height:100vh;
}
.cp-page--flat{ padding-bottom:calc(var(--cp-safe-b) + var(--cp-6)); }
.cp-wrap{ padding-left:var(--cp-4); padding-right:var(--cp-4); }
/* Rails let a horizontal strip bleed to the screen edge while its first
   and last item still line up with the page gutter. */
.cp-bleed{ margin-left:calc(var(--cp-4) * -1); margin-right:calc(var(--cp-4) * -1); }

/* ---- Bottom nav ----------------------------------------------------- */
.cp-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:1030;
  height:calc(var(--cp-nav-h) + var(--cp-safe-b));
  padding-bottom:var(--cp-safe-b);
  display:flex; align-items:stretch;
  background:color-mix(in srgb,var(--cp-surface) 88%,transparent);
  backdrop-filter:saturate(180%) blur(18px);
  -webkit-backdrop-filter:saturate(180%) blur(18px);
  border-top:1px solid var(--cp-line-soft);
}
.cp-nav__item{
  flex:1 1 0; min-width:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:var(--cp-ink-3); font-size:var(--cp-fs-micro); font-weight:600;
  position:relative; padding-top:6px;
  transition:color var(--cp-fast);
  background:none; border:0; font-family:inherit;   /* the More slot is a button */
}
/* A quiet dot on More when something behind it needs attention.
   Anchored to the icon, not to a half-width offset, so it cannot land
   past the edge of the last tab on a narrow phone. */
.cp-nav__dot{
  position:absolute; top:7px; right:calc(50% - 15px);
  width:7px; height:7px; border-radius:50%; background:var(--cp-neg);
  border:1.5px solid var(--cp-surface);
}
.cp-nav__item i{ font-size:18px; line-height:1; }
.cp-nav__item span{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0 2px; }
.cp-nav__item.is-active{ color:var(--cp-brand-500); }
/* The active pill sits behind the icon, so switching tabs reads as
   movement rather than a colour flicker. */
.cp-nav__item.is-active::before{
  content:""; position:absolute; top:4px; width:44px; height:28px;
  border-radius:var(--cp-r-pill); background:var(--cp-brand-50);
}
.cp-nav__item i,.cp-nav__item span{ position:relative; }

/* ---- Drawer --------------------------------------------------------- */
.cp-drawer{
  position:fixed; inset:0 auto 0 0; z-index:1050;
  width:min(84vw,320px);
  background:var(--cp-surface);
  transform:translateX(-102%);
  transition:transform var(--cp-med) var(--cp-ease);
  display:flex; flex-direction:column;
  box-shadow:var(--cp-sh-3);
}
.cp-drawer.is-open{ transform:none; }
.cp-scrim{
  position:fixed; inset:0; z-index:1040;
  background:rgba(15,23,42,.45); backdrop-filter:blur(2px);
  opacity:0; visibility:hidden; transition:opacity var(--cp-med) var(--cp-ease),visibility var(--cp-med);
}
.cp-scrim.is-open{ opacity:1; visibility:visible; }

.cp-drawer__head{
  padding:calc(var(--cp-safe-t) + var(--cp-5)) var(--cp-5) var(--cp-5);
  background:linear-gradient(135deg,var(--cp-brand-600),var(--cp-brand-800));
  color:#fff; display:flex; align-items:center; gap:var(--cp-3);
}
.cp-drawer__head .cp-avatar{ border-color:rgba(255,255,255,.35); }
.cp-drawer__id{ min-width:0; flex:1; }
.cp-drawer__name{ font-family:var(--cp-font-display); font-size:15px; font-weight:650; color:#fff;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cp-drawer__role{ font-size:var(--cp-fs-xs); color:rgba(255,255,255,.75);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.cp-drawer__body{ flex:1; overflow-y:auto; padding:var(--cp-3) var(--cp-3) var(--cp-5); -webkit-overflow-scrolling:touch; }
.cp-drawer__sec{ padding:var(--cp-4) var(--cp-3) var(--cp-2); }
.cp-drawer__link{
  display:flex; align-items:center; gap:var(--cp-3);
  padding:11px var(--cp-3); border-radius:12px;
  color:var(--cp-ink-2); font-size:var(--cp-fs-body); font-weight:550;
  transition:background var(--cp-fast),color var(--cp-fast);
}
.cp-drawer__link i{ width:22px; text-align:center; font-size:15px; color:var(--cp-ink-3); flex:0 0 22px; }
.cp-drawer__link span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.cp-drawer__link.is-active{ background:var(--cp-brand-50); color:var(--cp-brand-600); font-weight:650; }
.cp-drawer__link.is-active i{ color:var(--cp-brand-500); }
.cp-drawer__link:active{ background:var(--cp-surface-3); }
.cp-drawer__foot{ padding:var(--cp-4) var(--cp-5) calc(var(--cp-safe-b) + var(--cp-4)); border-top:1px solid var(--cp-line-soft); }


/* =====================================================================
   4  SURFACES
   ===================================================================== */
.cp-card{
  background:var(--cp-surface);
  border:1px solid var(--cp-line-soft);
  border-radius:var(--cp-r-lg);
  box-shadow:var(--cp-sh-1);
  overflow:hidden;
}
.cp-card--raised{ box-shadow:var(--cp-sh-2); border-color:transparent; }
.cp-card__body{ padding:var(--cp-4); }
.cp-card__head{
  display:flex; align-items:center; gap:var(--cp-3);
  padding:var(--cp-4) var(--cp-4) 0;
}
.cp-card__head .cp-h2{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* A section title with an optional action on the right. */
.cp-sec{
  display:flex; align-items:center; gap:var(--cp-3);
  margin:var(--cp-6) 0 var(--cp-3);
}
.cp-sec:first-child{ margin-top:0; }
.cp-sec__title{ font-family:var(--cp-font-display); font-size:15px; font-weight:650; color:var(--cp-ink);
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-sec__link{ font-size:var(--cp-fs-sm); font-weight:600; color:var(--cp-brand-500); flex-shrink:0; }
.cp-sec__link i{ font-size:11px; margin-left:2px; }

/* The one hero surface per screen - a payslip total, a month summary. */
.cp-hero{
  position:relative; overflow:hidden;
  border-radius:var(--cp-r-xl);
  background:linear-gradient(135deg,var(--cp-brand-500) 0%,var(--cp-brand-700) 58%,var(--cp-brand-900) 100%);
  color:#fff; padding:var(--cp-5);
  box-shadow:var(--cp-sh-brand);
}
.cp-hero::after{
  content:""; position:absolute; right:-56px; top:-70px; width:210px; height:210px;
  border-radius:50%; background:radial-gradient(circle,rgba(255,255,255,.16),transparent 68%);
}
.cp-hero > *{ position:relative; z-index:1; }
.cp-hero .cp-label{ color:rgba(255,255,255,.72); }


/* =====================================================================
   5  DATA
   ===================================================================== */

/* ---- Money & numbers ------------------------------------------------
   Tabular figures so columns of amounts line up digit for digit, and a
   tighter tracking so a seven figure salary still fits its tile. */
.cp-num,.cp-money{ font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; letter-spacing:-.01em; }
.cp-money{ font-family:var(--cp-font-display); font-weight:700; color:var(--cp-ink); white-space:nowrap; }
.cp-money--pos{ color:var(--cp-pos); }
.cp-money--neg{ color:var(--cp-neg); }
.cp-money__cur{ font-size:.78em; font-weight:600; opacity:.7; margin-right:1px; }

/* ---- Stat tiles ----------------------------------------------------
   Two across by default. A third value never squeezes a fourth onto the
   row - it wraps, because a squeezed number is a misread number. */
.cp-stats{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--cp-3); }
.cp-stats--3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:359px){ .cp-stats--3{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
.cp-stat{
  background:var(--cp-surface); border:1px solid var(--cp-line-soft);
  border-radius:var(--cp-r); padding:var(--cp-4) var(--cp-3);
  box-shadow:var(--cp-sh-1); min-width:0;
  display:flex; flex-direction:column; gap:var(--cp-1);
  transition:transform var(--cp-fast) var(--cp-ease);
}
a.cp-stat:active{ transform:scale(.975); }
.cp-stat__ico{
  width:34px; height:34px; border-radius:11px; margin-bottom:var(--cp-1);
  display:flex; align-items:center; justify-content:center; font-size:14px;
  background:var(--cp-brand-50); color:var(--cp-brand-600);
}
.cp-stat__val{
  font-family:var(--cp-font-display); font-size:21px; font-weight:700; line-height:1.1;
  color:var(--cp-ink); font-variant-numeric:tabular-nums; letter-spacing:-.02em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cp-stat__lbl{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); font-weight:600;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* A unit rides on the number's baseline. `small` picked up a block
   display from the template and dropped "km" onto its own line. */
.cp-stat__unit{
  display:inline; font-size:.55em; font-weight:600; margin-left:3px;
  color:var(--cp-ink-3); letter-spacing:0;
}
.cp-stat--pos .cp-stat__ico{ background:var(--cp-pos-bg); color:var(--cp-pos); }
.cp-stat--neg .cp-stat__ico{ background:var(--cp-neg-bg); color:var(--cp-neg); }
.cp-stat--warn .cp-stat__ico{ background:var(--cp-warn-bg); color:var(--cp-warn); }
.cp-stat--info .cp-stat__ico{ background:var(--cp-info-bg); color:var(--cp-info); }
.cp-stat--idle .cp-stat__ico{ background:var(--cp-idle-bg); color:var(--cp-idle); }

/* ---- Record row -----------------------------------------------------
   THE component of this app. Every list - employees, leave, loans,
   salary, attendance - is built from it.

   Layout is a 3 column grid: lead (avatar/date), body (grows and is
   allowed to shrink to nothing so long text truncates instead of pushing
   the amount off screen), trail (money + status, never wraps).      */
.cp-list{ display:flex; flex-direction:column; gap:var(--cp-2); }
.cp-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center; gap:var(--cp-3);
  background:var(--cp-surface);
  border:1px solid var(--cp-line-soft);
  border-radius:var(--cp-r);
  padding:var(--cp-3);
  box-shadow:var(--cp-sh-1);
  transition:transform var(--cp-fast) var(--cp-ease), box-shadow var(--cp-fast);
}
a.cp-row:active,.cp-row.is-tappable:active{ transform:scale(.985); box-shadow:var(--cp-sh-2); }
.cp-row__lead{ flex-shrink:0; }
.cp-row__body{ min-width:0; }
.cp-row__title{
  font-size:var(--cp-fs-body); font-weight:650; color:var(--cp-ink); line-height:1.3;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* Meta is the "· separated" second line. Each part may shrink, and the
   whole line truncates as one so it never wraps to a ragged third line. */
.cp-row__meta{
  display:flex; align-items:center; gap:6px; margin-top:2px;
  font-size:var(--cp-fs-xs); color:var(--cp-ink-3); min-width:0;
}
.cp-row__meta > span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-row__meta .cp-dot-sep{ flex:0 0 3px; width:3px; height:3px; border-radius:50%; background:var(--cp-ink-3); opacity:.5; }
.cp-row__trail{
  flex-shrink:0; text-align:right;
  display:flex; flex-direction:column; align-items:flex-end; gap:4px;
}
.cp-row__amt{ font-family:var(--cp-font-display); font-size:15px; font-weight:700;
  font-variant-numeric:tabular-nums; letter-spacing:-.01em; color:var(--cp-ink); white-space:nowrap; }
.cp-row__chev{ color:var(--cp-ink-3); font-size:13px; flex-shrink:0; margin-left:2px; }

/* An expandable record: extra detail without leaving the list. */
.cp-row__more{ grid-column:1/-1; display:none; padding-top:var(--cp-3); margin-top:var(--cp-1);
  border-top:1px dashed var(--cp-line); }
.cp-row.is-open .cp-row__more{ display:block; }
.cp-row.is-open .cp-row__chev{ transform:rotate(180deg); }
.cp-row__chev{ transition:transform var(--cp-med) var(--cp-ease); }

/* The summing line that closes a list. Reads as a total, not as one more
   record: no card, a rule above it, and the figure carrying the weight. */
.cp-totalrow{
  display:flex; align-items:baseline; justify-content:space-between; gap:var(--cp-3);
  padding:var(--cp-3) var(--cp-3) 0; margin-top:var(--cp-1);
  border-top:2px solid var(--cp-line);
}
.cp-totalrow > span:first-child{
  font-size:var(--cp-fs-micro); font-weight:700; letter-spacing:.07em;
  text-transform:uppercase; color:var(--cp-ink-3);
}
.cp-totalrow .cp-money{ font-size:17px; }

/* ---- Key / value ---------------------------------------------------
   For detail panes and expanded rows. The value can wrap; the key never
   does, so the two columns stay readable at any length. */
.cp-kv{ display:grid; grid-template-columns:minmax(96px,38%) minmax(0,1fr); gap:var(--cp-2) var(--cp-3); }
.cp-kv dt{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); font-weight:600; }
.cp-kv dd{ font-size:var(--cp-fs-sm); color:var(--cp-ink); margin:0; font-weight:550;
  overflow-wrap:anywhere; text-align:right; }
.cp-kv--rows{ grid-template-columns:1fr; gap:0; }
.cp-kv--rows > div{ display:flex; align-items:baseline; justify-content:space-between; gap:var(--cp-3);
  padding:9px 0; border-bottom:1px solid var(--cp-line-soft); }
.cp-kv--rows > div:last-child{ border-bottom:0; }
.cp-kv--rows dt{ flex:0 1 auto; min-width:0; }
.cp-kv--rows dd{ flex:1 1 auto; min-width:0; text-align:right; }
/* The closing "Total" line of a section. The payslip screens have always
   marked it up, but it was never styled, so the sum read as just another
   row. A rule above it and heavier ink make the section add up visually. */
.cp-kv--rows > .cp-kv__total{ border-top:1px solid var(--cp-line); border-bottom:0;
  margin-top:2px; padding-top:10px; }
.cp-kv__total dt{ color:var(--cp-ink); font-weight:700; }
.cp-kv__total dd{ font-weight:700; }

/* A quiet explanatory line under a figure - "not processed yet", and the
   like. Small and low contrast so it informs without competing. */
.cp-note{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); line-height:1.5; margin:0; }

/* ---- Avatar --------------------------------------------------------- */
.cp-avatar{
  width:42px; height:42px; border-radius:13px; object-fit:cover;
  background:var(--cp-surface-3); border:1px solid var(--cp-line);
  display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--cp-font-display); font-weight:700; font-size:14px; color:var(--cp-ink-2);
  flex-shrink:0;
}
.cp-avatar--sm{ width:34px; height:34px; border-radius:11px; font-size:12px; }
.cp-avatar--lg{ width:64px; height:64px; border-radius:20px; font-size:20px; }
.cp-avatar--xl{ width:88px; height:88px; border-radius:26px; font-size:28px; }

/* A date block used as a row lead on attendance and leave lists. */
.cp-datechip{
  width:46px; padding:6px 0; border-radius:12px; text-align:center;
  background:var(--cp-surface-2); border:1px solid var(--cp-line-soft); flex-shrink:0;
}
.cp-datechip__d{ font-family:var(--cp-font-display); font-size:17px; font-weight:700; line-height:1; color:var(--cp-ink); }
.cp-datechip__m{ font-size:9.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--cp-ink-3); margin-top:2px; }

/* ---- Tables ---------------------------------------------------------
   Only where a grid genuinely is the clearest form - an attendance
   matrix. It scrolls inside its own card and never the page. */
.cp-tablewrap{
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  border-radius:var(--cp-r); border:1px solid var(--cp-line-soft); background:var(--cp-surface);
  box-shadow:var(--cp-sh-1);
}
.cp-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:var(--cp-fs-sm); margin:0; }
.cp-table th{
  background:var(--cp-surface-2); color:var(--cp-ink-3);
  font-size:var(--cp-fs-micro); font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  padding:10px var(--cp-3); text-align:left; white-space:nowrap;
  border-bottom:1px solid var(--cp-line); position:sticky; top:0; z-index:1;
}
.cp-table td{ padding:11px var(--cp-3); border-bottom:1px solid var(--cp-line-soft); color:var(--cp-ink); vertical-align:middle; }
.cp-table tr:last-child td{ border-bottom:0; }
.cp-table .cp-num,.cp-table .num{ text-align:right; font-variant-numeric:tabular-nums; }
/* First column pinned, so a name stays visible while the numbers scroll. */
.cp-table--pin th:first-child,.cp-table--pin td:first-child{
  position:sticky; left:0; background:var(--cp-surface); z-index:2;
  box-shadow:1px 0 0 var(--cp-line);
}
.cp-table--pin th:first-child{ background:var(--cp-surface-2); z-index:3; }
/* A hint that there is more to the right, shown only while scrollable. */
.cp-scrollhint{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); display:flex; align-items:center;
  gap:5px; margin-top:6px; justify-content:flex-end; }


/* =====================================================================
   6  STATUS
   ===================================================================== */
.cp-chip{
  display:inline-flex; align-items:center; gap:4px; max-width:100%;
  padding:3px 9px; border-radius:var(--cp-r-pill);
  font-size:var(--cp-fs-xs); font-weight:700; line-height:1.5;
  border:1px solid transparent; white-space:nowrap;
  background:var(--cp-idle-bg); color:var(--cp-idle); border-color:var(--cp-idle-bd);
}
.cp-chip > span{ overflow:hidden; text-overflow:ellipsis; }
.cp-chip i{ font-size:9px; }
.cp-chip--pos{ background:var(--cp-pos-bg); color:var(--cp-pos); border-color:var(--cp-pos-bd); }
.cp-chip--neg{ background:var(--cp-neg-bg); color:var(--cp-neg); border-color:var(--cp-neg-bd); }
.cp-chip--warn{ background:var(--cp-warn-bg); color:var(--cp-warn); border-color:var(--cp-warn-bd); }
.cp-chip--info{ background:var(--cp-info-bg); color:var(--cp-info); border-color:var(--cp-info-bd); }
.cp-chip--brand{ background:var(--cp-brand-50); color:var(--cp-brand-600); border-color:var(--cp-brand-200); }
.cp-chip--sm{ font-size:var(--cp-fs-micro); padding:2px 7px; }
/* A leading dot carries the state for anyone who cannot separate the
   hues, and reads faster than colour alone at a glance. */
.cp-chip__dot{ width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; }


/* =====================================================================
   7  CONTROLS
   ===================================================================== */
.cp-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:42px; padding:0 var(--cp-4);
  border:1px solid transparent; border-radius:12px;
  font-family:var(--cp-font-display); font-size:var(--cp-fs-sm); font-weight:650;
  cursor:pointer; transition:transform var(--cp-fast) var(--cp-ease),background var(--cp-fast),opacity var(--cp-fast);
  background:var(--cp-surface-3); color:var(--cp-ink); text-align:center;
}
.cp-btn:active{ transform:scale(.97); }
/* --brand and --primary are the same button: the views were written
   with both names, and only one of them existed. */
.cp-btn--primary,
.cp-btn--brand{ background:var(--cp-brand-500); color:#fff; box-shadow:var(--cp-sh-brand); }
.cp-btn--primary:active,
.cp-btn--brand:active{ background:var(--cp-brand-600); }
/* an <a> takes its colour from the link rule unless told otherwise */
.cp-app a.cp-btn--primary,
.cp-app a.cp-btn--brand{ color:#fff; }
.cp-btn--pos{ background:var(--cp-pos); color:#fff; box-shadow:0 8px 24px rgba(5,150,105,.26); }
.cp-btn--neg{ background:var(--cp-neg); color:#fff; box-shadow:0 8px 24px rgba(225,29,72,.24); }
.cp-btn--ghost{ background:transparent; border-color:var(--cp-line); color:var(--cp-ink-2); }
.cp-btn--sm{ min-height:34px; padding:0 var(--cp-3); font-size:var(--cp-fs-xs); border-radius:10px; }
.cp-btn--block{ display:flex; width:100%; }
/* inside a row of actions, block gives up its full width */
.cp-formactions .cp-btn--block,
.cp-actions .cp-btn--block{ width:auto; }
.cp-btn[disabled],.cp-btn.is-busy{ opacity:.55; pointer-events:none; }

/* Inputs */
.cp-field{ margin-bottom:var(--cp-4); }
.cp-field__label{ display:block; font-size:var(--cp-fs-sm); font-weight:650; color:var(--cp-ink-2); margin-bottom:6px; }
.cp-input,.cp-app select.cp-input,.cp-app textarea.cp-input{
  width:100%; min-height:46px; padding:11px var(--cp-3);
  background:var(--cp-surface); color:var(--cp-ink);
  border:1px solid var(--cp-line); border-radius:12px;
  font-family:var(--cp-font); font-size:var(--cp-fs-body); line-height:1.4;
  transition:border-color var(--cp-fast),box-shadow var(--cp-fast);
  -webkit-appearance:none; appearance:none;
}
.cp-input:focus{ outline:0; border-color:var(--cp-brand-400); box-shadow:0 0 0 3px var(--cp-brand-50); }
.cp-app select.cp-input{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237c8598' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; padding-right:36px;
}
.cp-input::placeholder{ color:var(--cp-ink-3); }

/* Search */
.cp-search{ position:relative; }
.cp-search i{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--cp-ink-3); font-size:14px; }
.cp-search .cp-input{ padding-left:40px; }

/* A horizontally scrolling row of filters. Bleeds to the screen edge so
   it is obvious more exist, with the gutter restored by padding. */
.cp-filters{
  display:flex; gap:var(--cp-2); overflow-x:auto; -webkit-overflow-scrolling:touch;
  padding:var(--cp-1) var(--cp-4); scrollbar-width:none;
}
.cp-filters::-webkit-scrollbar{ display:none; }
/* Kept as a no-op alias: the markup still carries this class, but a
   wrapping filter row pushed every card below it down the page. One
   row that scrolls is shorter and easier to move through - the fade
   below is what says there is more. */
.cp-filters--wrap{ flex-wrap:nowrap; overflow-x:auto; }
.cp-filter{
  flex:0 0 auto; padding:8px 14px; border-radius:var(--cp-r-pill);
  background:var(--cp-surface); border:1px solid var(--cp-line);
  font-size:var(--cp-fs-sm); font-weight:600; color:var(--cp-ink-2);
  white-space:nowrap; transition:all var(--cp-fast) var(--cp-ease);
}
.cp-filter.is-active{ background:var(--cp-brand-500); border-color:var(--cp-brand-500); color:#fff; box-shadow:var(--cp-sh-brand); }
.cp-filter__n{ opacity:.65; margin-left:4px; font-variant-numeric:tabular-nums; }

/* Segmented control, for two or three exclusive views of the same data */
.cp-seg{ display:flex; background:var(--cp-surface-3); border-radius:12px; padding:3px; gap:3px; }
/* Every tab shares the row and shortens with an ellipsis rather than
   pushing the set onto a second line. An idle tab sits on its own
   white surface - transparent on the grey rail read as no control. */
.cp-seg__i{
  flex:1 1 0; min-width:0; padding:8px 4px; border:0; border-radius:9px;
  background:var(--cp-surface); color:var(--cp-ink-2);
  font-size:12.5px; font-weight:650;
  transition:all var(--cp-fast) var(--cp-ease);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* The selected segment carries a brand tint and an underline as well as
   the raised panel - on a white card the panel alone was too quiet to
   say which of the three views you were looking at. */
/* .date-active is the class the request tabs already used - kept so the
   existing tab JS needs no change. */
.cp-seg__i.is-active,
.cp-seg__i.date-active{
  background:var(--cp-brand-50); color:var(--cp-brand-600); font-weight:700;
  box-shadow:inset 0 -2.5px 0 var(--cp-brand-500);
}

/* ---- Month bar ------------------------------------------------------
   A year, then twelve months on a rail. Used by attendance and salary,
   so it lives here rather than being copied into each page. */
/* One row for the whole period control: the year, then twelve months that
   share what is left. Nothing wraps and nothing scrolls - at this width a
   month gets about 27px, which a three letter label fits at 10.5px. */
.cp-monthbar{ display:flex; align-items:center; gap:6px; }
/* width is pinned because the old template ships `select{width:100%}`,
   which beats flex:0 0 auto and leaves the rail no room at all */
.cp-monthbar__year{
  flex:0 0 auto; width:74px!important; height:36px; padding:0 15px 0 8px; border-radius:9px;
  background:var(--cp-surface); color:var(--cp-ink); border:1px solid var(--cp-line);
  font-family:var(--cp-font-display); font-size:13px; font-weight:650;
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 12 8'%3E%3Cpath fill='%237c8598' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 5px center;
}
.cp-months{
  flex:1; min-width:0; display:flex; gap:5px; overflow-x:auto;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; padding:1px 0;
}
/* the rail no longer scrolls, but the scripts still animate .months -
   an animation on a non-scrolling element is simply a no-op */
.cp-months::-webkit-scrollbar{ display:none; }
/* margin-left is reset because the old theme's custom.css sets
   `.month { margin-left:25px }`, and these buttons keep the .month class
   for the page scripts that select them - without the reset the rail
   showed three months instead of twelve. */
/* margin-left is reset because the old theme's custom.css sets
   `.month{ margin-left:25px }`, and these buttons keep the .month class
   for the page scripts that select them. Without the reset the visual
   gap was 31px and only three months were reachable. */
.cp-month{
  flex:0 0 auto; min-width:0; height:38px; padding:0 11px; border-radius:10px;
  margin:0!important;
  background:var(--cp-surface); border:1px solid var(--cp-line);
  font-size:var(--cp-fs-sm); font-weight:650; color:var(--cp-ink-2);
  transition:all var(--cp-fast) var(--cp-ease); white-space:nowrap;
}

/* Selected reads as a soft tint rather than a solid block - twelve of
   these in a row, one filled dark, outweighed the data below it. */
.cp-month.active{
  background:var(--cp-brand-50); border-color:var(--cp-brand-200);
  color:var(--cp-brand-600); font-weight:700; box-shadow:none;
}
/* A month with nothing in it is dimmed, not hidden - the year still
   reads as twelve months and it is obvious which ones hold data. */
.cp-month.disabled{ opacity:.4; pointer-events:none; }

/* ---- Day bar --------------------------------------------------------
   Previous / date + weekday / next, with an optional filter button.
   Shared by datewise attendance, attendance and tasks. */
.cp-daybar{ display:flex; align-items:center; gap:var(--cp-2); }
.cp-daybar__nav{
  width:34px; height:38px; flex:0 0 34px; border:1px solid var(--cp-line);
  background:var(--cp-surface); border-radius:10px; color:var(--cp-ink-2);
  font-size:12px; display:grid; place-items:center;
}
.cp-daybar__date{
  flex:1; min-width:0; height:38px;
  background:var(--cp-surface); border:1px solid var(--cp-line); border-radius:10px;
  display:flex; align-items:center; justify-content:center; gap:6px; padding:0 var(--cp-2);
}
.cp-daybar__date > i{ font-size:12px; color:var(--cp-ink-3); flex-shrink:0; }
.cp-daybar__date input{
  border:0; background:transparent; padding:0; width:auto; max-width:96px; text-align:right;
  font-family:var(--cp-font-display); font-size:13.5px; font-weight:650; color:var(--cp-ink);
  font-variant-numeric:tabular-nums;
}
.cp-daybar__date input:focus{ outline:0; }
.cp-daybar__date > span{
  font-size:var(--cp-fs-xs); color:var(--cp-ink-3); font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0;
}
/* on a very narrow phone the weekday is the first thing to go */
@media (max-width:359px){ .cp-daybar__date > span{ display:none; } }

/* ---- Period bar -----------------------------------------------------
   Prev / a date range / next, for the weekly and daywise salary views. */
.cp-periodbar{ display:flex; align-items:center; gap:var(--cp-2); }
.cp-periodbar__range{
  flex:1; min-width:0; height:38px; cursor:pointer;
  background:var(--cp-surface); border:1px solid var(--cp-line); border-radius:10px;
  display:flex; align-items:center; justify-content:center; gap:6px; padding:0 var(--cp-3);
  font-size:var(--cp-fs-sm); font-weight:650; color:var(--cp-ink);
  overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.cp-periodbar__range i{ font-size:11px; color:var(--cp-ink-3); flex-shrink:0; }
.cp-periodbar__range span{ overflow:hidden; text-overflow:ellipsis; }

/* Floating action button */
.cp-fab{
  position:fixed; right:var(--cp-4); z-index:1029;
  bottom:calc(var(--cp-nav-h) + var(--cp-safe-b) + var(--cp-4));
  width:54px; height:54px; border-radius:18px; border:0;
  background:var(--cp-brand-500); color:#fff; font-size:19px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:var(--cp-sh-brand);
  transition:transform var(--cp-fast) var(--cp-ease);
}
.cp-fab:active{ transform:scale(.92); }

/* The plus is drawn by the button rather than set as a FontAwesome glyph.
   The icon font is fetched from a CDN, and until it arrives - or if it is
   unavailable, as happened to Highcharts - the button is a plain circle
   with nothing on it. Two bars cost nothing and cannot fail to load.
   The <i> the markup still carries is hidden, so there is never two. */
.cp-fab::before,
.cp-fab::after{
  content:''; position:absolute; top:50%; left:50%;
  background:currentColor; border-radius:1.5px;
}
.cp-fab::before{ width:18px; height:2.5px; margin:-1.25px 0 0 -9px; }
.cp-fab::after { width:2.5px; height:18px; margin:-9px 0 0 -1.25px; }
.cp-fab i{ display:none; }
/* The FAB is an <a> on most pages, and `.cp-app a` colours links brand
   blue - the same blue as this button's own background, so the mark
   was blue on blue and looked like an empty circle. Force it white. */
.cp-app a.cp-fab,
.cp-app button.cp-fab{ color:#fff!important; }


/* =====================================================================
   8  FEEDBACK
   ===================================================================== */

/* Empty - says what is missing and what to do, never just "no data". */
.cp-empty{ text-align:center; padding:var(--cp-10) var(--cp-5); }
.cp-empty__ico{
  width:72px; height:72px; margin:0 auto var(--cp-4); border-radius:24px;
  display:flex; align-items:center; justify-content:center; font-size:27px;
  background:var(--cp-surface-3); color:var(--cp-ink-3);
}
.cp-empty__title{ font-family:var(--cp-font-display); font-size:var(--cp-fs-h2); font-weight:650; color:var(--cp-ink); margin-bottom:5px; }
.cp-empty__text{ font-size:var(--cp-fs-sm); color:var(--cp-ink-3); max-width:280px; margin:0 auto var(--cp-4); line-height:1.55; }

/* Error - the same shape as empty, so a failure never looks like a crash */
.cp-empty--error .cp-empty__ico{ background:var(--cp-neg-bg); color:var(--cp-neg); }

/* Skeletons. Loading shows the SHAPE of what is coming, so the page does
   not jump when it arrives. */
.cp-skel{
  background:linear-gradient(90deg,var(--cp-surface-3) 25%,var(--cp-surface-2) 37%,var(--cp-surface-3) 63%);
  background-size:400% 100%; animation:cp-shimmer 1.3s ease-in-out infinite;
  border-radius:7px;
}
@keyframes cp-shimmer{ 0%{background-position:100% 50%} 100%{background-position:0 50%} }
.cp-skel-row{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:var(--cp-3);
  background:var(--cp-surface); border:1px solid var(--cp-line-soft);
  border-radius:var(--cp-r); padding:var(--cp-3); margin-bottom:var(--cp-2);
}
@media (prefers-reduced-motion:reduce){ .cp-skel{ animation:none; } }

/* Bottom sheet, used instead of a centre modal on a phone */
.cp-sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:1055;
  background:var(--cp-surface);
  border-radius:var(--cp-r-xl) var(--cp-r-xl) 0 0;
  box-shadow:var(--cp-sh-3);
  transform:translateY(101%); transition:transform var(--cp-med) var(--cp-ease);
  max-height:88vh; display:flex; flex-direction:column;
  padding-bottom:var(--cp-safe-b);
}
.cp-sheet.is-open{ transform:none; }
.cp-sheet__grip{ width:38px; height:4px; border-radius:2px; background:var(--cp-line); margin:10px auto 4px; flex-shrink:0; }
.cp-sheet__head{ padding:var(--cp-2) var(--cp-5) var(--cp-3); display:flex; align-items:center; gap:var(--cp-3); }
.cp-sheet__head .cp-h2{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cp-sheet__body{ padding:0 var(--cp-5) var(--cp-5); overflow-y:auto; -webkit-overflow-scrolling:touch; }

/* A thin progress bar under the app bar for background work.
   #preloader keeps its id because pages all over the app already call
   $('#preloader').show() / .hide() - it is simply no longer a full screen
   spinner blocking the view, just a line that says something is running. */
.cp-progress,
.cp-app #preloader{
  position:fixed; top:calc(var(--cp-appbar-h) + var(--cp-safe-t)); left:0; right:0;
  height:2.5px; z-index:1031; background:var(--cp-brand-50); overflow:hidden; display:none;
}
.cp-progress.is-on{ display:block; }
.cp-progress::after,
.cp-app #preloader::after{
  content:""; display:block; width:38%; height:100%; background:var(--cp-brand-500);
  border-radius:var(--cp-r-pill);
  animation:cp-indet 1.05s infinite var(--cp-ease);
}
/* the template's own spinner markup inside it is not needed */
.cp-app #preloader > *{ display:none!important; }
@keyframes cp-indet{ 0%{transform:translateX(-110%)} 100%{transform:translateX(330%)} }


/* =====================================================================
   9  UTILITIES
   ===================================================================== */
.cp-truncate{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
/* Two line clamp, for a reason or a note that may run long */
.cp-clamp2{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cp-stack{ display:flex; flex-direction:column; }
.cp-gap-1{ gap:var(--cp-1) } .cp-gap-2{ gap:var(--cp-2) } .cp-gap-3{ gap:var(--cp-3) } .cp-gap-4{ gap:var(--cp-4) }
.cp-mt-2{ margin-top:var(--cp-2) } .cp-mt-3{ margin-top:var(--cp-3) } .cp-mt-4{ margin-top:var(--cp-4) }
.cp-mt-5{ margin-top:var(--cp-5) } .cp-mt-6{ margin-top:var(--cp-6) }
.cp-mb-2{ margin-bottom:var(--cp-2) } .cp-mb-3{ margin-bottom:var(--cp-3) } .cp-mb-4{ margin-bottom:var(--cp-4) }
.cp-row-flex{ display:flex; align-items:center; gap:var(--cp-3); }
.cp-between{ display:flex; align-items:center; justify-content:space-between; gap:var(--cp-3); }
.cp-grow{ flex:1; min-width:0; }
.cp-center{ text-align:center }
.cp-right{ text-align:right }
.cp-muted{ color:var(--cp-ink-3) }
.cp-hide{ display:none!important }

/* Ripple-free press feedback for anything tappable */
.cp-press{ transition:transform var(--cp-fast) var(--cp-ease); }
.cp-press:active{ transform:scale(.97); }

/* A birthday or a work anniversary.
   The illustration is the point of the card, so it stays large - but the
   card is a fixed height beside the text rather than a full width banner,
   so it can never push the day's numbers off the first screen. */
.cp-celebrate{
  display:flex; align-items:center; gap:var(--cp-4);
  background:var(--cp-surface); border:1px solid var(--cp-line-soft);
  border-radius:var(--cp-r-lg); padding:var(--cp-3) var(--cp-4) var(--cp-3) var(--cp-3);
  box-shadow:var(--cp-sh-1); position:relative; overflow:hidden;
}
/* a soft wash behind the art, tinted per occasion */
.cp-celebrate::before{
  content:""; position:absolute; left:-24px; top:-30px; width:140px; height:140px;
  border-radius:50%; opacity:.5;
}
.cp-celebrate--birthday::before{ background:radial-gradient(circle,rgba(201,162,39,.28),transparent 68%); }
.cp-celebrate--work::before{     background:radial-gradient(circle,rgba(5,150,105,.22),transparent 68%); }
/* Owl Carousel sets `.owl-item img { width:100% }` on every image it
   wraps, which stretched this one to the full card and squeezed the text
   to nothing. The size is pinned so the illustration stays an
   illustration and the name keeps its room. */
.cp-celebrate__art,
.owl-carousel .owl-item .cp-celebrate__art{
  width:78px!important; height:78px; max-width:78px;
  object-fit:contain; flex-shrink:0; position:relative; z-index:1;
}
.cp-celebrate__txt{ min-width:0; flex:1; position:relative; z-index:1; }
.cp-celebrate__t{
  font-size:var(--cp-fs-micro); font-weight:700; letter-spacing:.07em;
  text-transform:uppercase; color:var(--cp-ink-3);
}
.cp-celebrate__n{
  font-family:var(--cp-font-display); font-size:15px; font-weight:650; color:var(--cp-ink);
  margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cp-celebrate__s{
  font-size:var(--cp-fs-xs); color:var(--cp-ink-3);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ---------------------------------------------------------------------
   TAMING THE OLD TEMPLATE
   The template stylesheet still ships Bootstrap's grid, modal, offcanvas
   and dropdown, which the app uses. These few rules stop the rest of it
   from styling anything the eye lands on.
   ------------------------------------------------------------------- */
.cp-app .page-wrapper{ background:transparent; }
.cp-app .modal-content{
  border:0; border-radius:var(--cp-r-lg); background:var(--cp-surface);
  box-shadow:var(--cp-sh-3); overflow:hidden;
}
.cp-app .modal-header{ border-bottom:1px solid var(--cp-line-soft); padding:var(--cp-4) var(--cp-5); }
.cp-app .modal-title{ font-family:var(--cp-font-display); font-size:var(--cp-fs-h2); font-weight:650; color:var(--cp-ink); }
.cp-app .modal-body{ padding:var(--cp-5); color:var(--cp-ink); }
.cp-app .offcanvas{ background:var(--cp-surface); color:var(--cp-ink); border:0; border-radius:var(--cp-r-xl); }

/* jquery-confirm is used for every confirm in the app - make it match */
.jconfirm .jconfirm-box{
  border-radius:var(--cp-r-lg)!important; padding:var(--cp-5)!important;
  background:var(--cp-surface)!important; box-shadow:var(--cp-sh-3)!important;
}
.jconfirm .jconfirm-title{ font-family:var(--cp-font-display)!important; font-weight:650!important; color:var(--cp-ink)!important; }
.jconfirm .jconfirm-content{ color:var(--cp-ink-2)!important; font-size:var(--cp-fs-body)!important; }
.jconfirm .jconfirm-buttons button{
  border-radius:11px!important; font-family:var(--cp-font-display)!important;
  font-weight:650!important; min-height:42px; padding:0 var(--cp-4)!important; text-transform:none!important;
}

/* toastr, same treatment */
#toast-container > div{
  border-radius:var(--cp-r)!important; box-shadow:var(--cp-sh-2)!important;
  opacity:1!important; font-family:var(--cp-font)!important; font-size:var(--cp-fs-sm)!important;
}

/* ============================================================
   REQUEST CARD
   Leave, permission and on-duty approvals. The head is the tap
   target; the body holds the decision form.
   ============================================================ */
.cp-reqcard{
  background:var(--cp-surface); border:1px solid var(--cp-line);
  border-radius:var(--cp-r-lg); margin-bottom:var(--cp-3);
  overflow:hidden; box-shadow:var(--cp-sh-1);
}
.cp-reqcard__head{
  display:grid; grid-template-columns:auto minmax(0,1fr) auto;
  gap:var(--cp-3); align-items:center; width:100%;
  padding:var(--cp-4); background:none; border:0; text-align:left;
  font:inherit; color:inherit; cursor:pointer;
}
.cp-reqcard__head:focus-visible{ outline:2px solid var(--cp-brand-400); outline-offset:-2px; }
.cp-reqcard__ava{
  background:var(--cp-brand-50); color:var(--cp-brand-600);
  font-weight:700; font-size:var(--cp-fs-xs);
}
.cp-reqcard__main{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.cp-reqcard__name{
  font-family:var(--cp-font-display); font-weight:650; color:var(--cp-ink);
  font-size:var(--cp-fs-body); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cp-reqcard__sub{ font-size:var(--cp-fs-sm); color:var(--cp-ink-2); }
.cp-reqcard__when{ font-size:var(--cp-fs-xs); color:var(--cp-ink-3); }
.cp-reqcard__side{ display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.cp-reqcard__chev{
  font-size:11px; color:var(--cp-ink-3); transition:transform .18s ease;
}
.cp-reqcard__head:not(.collapsed) .cp-reqcard__chev{ transform:rotate(180deg); }
.cp-reqcard__body{
  padding:0 var(--cp-4) var(--cp-4);
  border-top:1px solid var(--cp-line);
}
.cp-reqcard__reason{ padding:var(--cp-4) 0 var(--cp-2); }
.cp-reqcard__reason p{
  margin:2px 0 0; font-size:var(--cp-fs-sm); color:var(--cp-ink-2);
  overflow-wrap:anywhere;
}
.cp-input--area{ min-height:72px; padding-top:10px; resize:vertical; }

/* Body of a dashboard request modal - the cards supply their own frame */
.cp-modalbody{ padding:2px 0; }
.cp-modalbody .cp-reqcard:last-child{ margin-bottom:0; }

/* Count badge inside a segmented-control tab */
/* The badge is the difference between one row and two: at its old size
   four of them cost 112px. A one or two digit count needs far less. */
.cp-seg__n{
  display:inline-block; min-width:0; margin-left:3px; padding:0 3px;
  border-radius:999px; background:var(--cp-brand-50); color:var(--cp-brand-600);
  font-size:9.5px; font-weight:700; line-height:14px; text-align:center;
  font-variant-numeric:tabular-nums;
}
.cp-seg__i.is-active .cp-seg__n,
.cp-seg__i.date-active .cp-seg__n{ background:var(--cp-brand-500); color:#fff; }

/* Destructive action - used for delete inside a card */
.cp-btn--danger{
  background:var(--cp-neg-bg); border-color:transparent; color:var(--cp-neg);
}
.cp-btn--danger:active{ background:var(--cp-neg); color:#fff; }

/* Row of actions at the foot of a card */
.cp-actions{ display:flex; gap:var(--cp-2); margin-top:var(--cp-3); }
.cp-actions .cp-btn{ flex:1 1 0; }

/* Uploaded proof on a reimbursement claim */
.cp-proofwrap{ margin:var(--cp-2) 0 var(--cp-3); }
.cp-proof{
  display:inline-flex; align-items:center; gap:var(--cp-2);
  padding:6px 10px 6px 6px; border:1px solid var(--cp-line);
  border-radius:10px; background:var(--cp-surface-2);
  font-size:var(--cp-fs-xs); font-weight:600; color:var(--cp-ink-2);
  text-decoration:none; max-width:100%;
}
.cp-proof img{
  width:34px; height:34px; object-fit:cover; border-radius:7px;
  background:var(--cp-surface-3); flex-shrink:0;
}

/* Full-screen look at an uploaded document */
.cp-viewer{
  position:fixed; inset:0; z-index:2000;
  align-items:center; justify-content:center;
  background:rgba(15,23,42,.92); padding:var(--cp-5);
}
.cp-viewer img{ max-width:100%; max-height:100%; border-radius:var(--cp-r); }

/* ============================================================
   FORMS
   Used by the add/edit pages. A form is a single card of fields
   with the actions pinned underneath it.
   ============================================================ */
.cp-field--last{ margin-bottom:0; }
.cp-field > .cp-label{ display:block; margin-bottom:6px; }

/* Two fields on one line, stacking when there is no room */
.cp-grid2{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--cp-3); }
@media (max-width:359px){ .cp-grid2{ grid-template-columns:1fr; } }

/* An input with a fixed affix - the rupee sign, a calendar mark */
.cp-inputgrp{ display:flex; align-items:stretch; }
.cp-inputgrp .cp-input{ flex:1 1 auto; min-width:0; }
.cp-inputgrp__pre,
.cp-inputgrp__post{
  display:inline-flex; align-items:center; justify-content:center;
  padding:0 var(--cp-3); background:var(--cp-surface-3);
  border:1px solid var(--cp-line); color:var(--cp-ink-2);
  font-size:var(--cp-fs-sm); font-weight:600; flex-shrink:0;
}
.cp-inputgrp__pre{ border-right:0; border-radius:var(--cp-r-sm) 0 0 var(--cp-r-sm); }
.cp-inputgrp__post{ border-left:0; border-radius:0 var(--cp-r-sm) var(--cp-r-sm) 0; }
.cp-inputgrp__pre + .cp-input{ border-radius:0 var(--cp-r-sm) var(--cp-r-sm) 0; }
.cp-inputgrp .cp-input:has(+ .cp-inputgrp__post){ border-radius:var(--cp-r-sm) 0 0 var(--cp-r-sm); }

/* A file input never looks native across platforms - give it the same
   frame as every other field and let the browser draw the button. */
/* By type, not by modifier: the modifier only applied where someone
   remembered it, and most converted forms carry plain .cp-input. */
.cp-input--file,
.cp-app .cp-page input[type="file"]{ padding:8px var(--cp-3); line-height:1.4; }
.cp-input--file::file-selector-button,
.cp-app .cp-page input[type="file"]::file-selector-button{
  margin-right:var(--cp-3); padding:6px 12px; border:0; border-radius:8px;
  background:var(--cp-brand-50); color:var(--cp-brand-600);
  font-family:inherit; font-size:var(--cp-fs-xs); font-weight:650; cursor:pointer;
}
.cp-hint{ margin:6px 0 0; font-size:var(--cp-fs-xs); color:var(--cp-ink-3); }

/* Cancel / submit, side by side under the card */
/* Cancel and Submit share a line, Submit taking the larger share. A
   form with only one action gives it the whole width instead of
   leaving it in the narrow column. */
.cp-formactions{
  display:flex; gap:var(--cp-2); margin-top:var(--cp-4);
}
.cp-formactions .cp-btn{ flex:1 1 0; width:auto; }
.cp-formactions .cp-btn--brand,
.cp-formactions .cp-btn--primary{ flex:1.6 1 0; }

/* ============================================================
   PROFILE + MENU LIST
   ============================================================ */
.cp-profile{
  display:flex; align-items:center; gap:var(--cp-4);
  padding:var(--cp-5); background:var(--cp-surface);
  border:1px solid var(--cp-line); border-radius:var(--cp-r-lg);
  box-shadow:var(--cp-sh-1);
}
.cp-profile__ava{
  width:62px; height:62px; flex:0 0 62px; border-radius:50%;
  background-size:cover; background-position:center;
  background-color:var(--cp-surface-3);
}
.cp-profile__ava--ph{
  display:inline-flex; align-items:center; justify-content:center;
  color:var(--cp-ink-3); font-size:24px;
}
.cp-profile__id{ min-width:0; flex:1; }
.cp-profile__name{
  font-family:var(--cp-font-display); font-size:var(--cp-fs-h2); font-weight:700;
  color:var(--cp-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cp-profile__role{ font-size:var(--cp-fs-sm); color:var(--cp-ink-3); }

/* A stack of navigation rows */
.cp-menu{
  background:var(--cp-surface); border:1px solid var(--cp-line);
  border-radius:var(--cp-r-lg); overflow:hidden; box-shadow:var(--cp-sh-1);
}
.cp-menu__i{
  display:flex; align-items:center; gap:var(--cp-3);
  padding:var(--cp-4); color:var(--cp-ink)!important; text-decoration:none;
  border-bottom:1px solid var(--cp-line-soft);
}
.cp-menu__i:last-child{ border-bottom:0; }
.cp-menu__i:active{ background:var(--cp-surface-2); }
.cp-menu__ico{
  width:34px; height:34px; flex:0 0 34px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--cp-brand-50); color:var(--cp-brand-600); font-size:14px;
}
.cp-menu__t{ flex:1; min-width:0; font-size:var(--cp-fs-body); font-weight:600; }
.cp-menu__go{ font-size:12px; color:var(--cp-ink-3); }
.cp-menu__i--danger .cp-menu__ico{ background:var(--cp-neg-bg); color:var(--cp-neg); }
.cp-menu__i--danger .cp-menu__t{ color:var(--cp-neg); }

/* Freshness of a device's last contact */
.cp-fresh{ color:var(--cp-pos)!important; }
.cp-stale{ color:var(--cp-neg)!important; }

/* A smaller icon button, for a section heading */
.cp-iconbtn--sm{ width:32px; height:32px; flex:0 0 32px; font-size:13px; border-radius:10px; }

/* ============================================================
   PUNCH ROWS
   One in/out pair per row in the attendance-history editor.
   ============================================================ */
.cp-punches{ display:flex; flex-direction:column; gap:var(--cp-2); }
.cp-punch{
  display:flex; align-items:center; gap:var(--cp-2);
  padding:var(--cp-2); border:1px solid var(--cp-line);
  border-radius:var(--cp-r-sm); background:var(--cp-surface-2);
}
.cp-punch__tag{
  flex:0 0 42px; text-align:center; padding:4px 0; border-radius:7px;
  font-size:var(--cp-fs-micro); font-weight:700; letter-spacing:.04em; text-transform:uppercase;
}
.cp-punch__tag--in{ background:var(--cp-pos-bg); color:var(--cp-pos); }
.cp-punch__tag--out{ background:var(--cp-neg-bg); color:var(--cp-neg); }
.cp-punch .cp-input{ flex:1 1 0; min-width:0; }
.cp-punch__src{
  flex:0 1 auto; max-width:30%; padding:3px 8px; border-radius:999px;
  background:var(--cp-surface-3); color:var(--cp-ink-3);
  font-size:var(--cp-fs-micro); font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cp-input--sm{ min-height:34px; padding:5px 9px; font-size:var(--cp-fs-sm); }

/* ============================================================
   SALES REQUEST
   ============================================================ */
.cp-hero__head{ display:flex; align-items:center; justify-content:space-between; }
.cp-hero__when{ font-size:var(--cp-fs-xs); color:rgba(255,255,255,.8); font-weight:600; }
.cp-hero__figs{
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr));
  gap:var(--cp-2); margin:var(--cp-4) 0 var(--cp-3);
}
.cp-hero__figs > div{ min-width:0; }
.cp-hero__k{ display:block; font-size:var(--cp-fs-micro); color:rgba(255,255,255,.72); }
.cp-hero__v{
  display:block; font-family:var(--cp-font-display); font-weight:700;
  font-size:var(--cp-fs-h2); color:#fff;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.cp-hero__bar{ height:8px; border-radius:999px; background:rgba(255,255,255,.24); overflow:hidden; }
.cp-hero__bar > div{ height:100%; border-radius:999px; background:var(--cp-accent); }
.cp-hero__foot{
  display:flex; justify-content:space-between; margin-top:6px;
  font-size:var(--cp-fs-xs); color:rgba(255,255,255,.85);
}

.cp-salecard__top{ display:flex; align-items:flex-start; gap:var(--cp-3); }
.cp-salecard__who{ min-width:0; flex:1; }
.cp-salecard__note{
  margin:var(--cp-3) 0 0; padding:var(--cp-2) var(--cp-3);
  background:var(--cp-surface-2); border-radius:var(--cp-r-sm);
  font-size:var(--cp-fs-sm); color:var(--cp-ink-2); overflow-wrap:anywhere;
}

/* ---- Centred dialog ------------------------------------------------
   Hand-rolled rather than a Bootstrap modal: this runs inside an Android
   WebView where prompt() and some modal paths misbehave. */
.cp-sheetwrap{
  display:none; position:fixed; inset:0; z-index:1080;
  align-items:center; justify-content:center; padding:var(--cp-5);
  background:rgba(15,23,42,.5);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
}
.cp-sheetwrap.open{ display:flex; }
.cp-sheet__box{
  width:100%; max-width:400px; max-height:86vh; overflow-y:auto;
  background:var(--cp-surface); border-radius:var(--cp-r-lg);
  padding:var(--cp-5); box-shadow:var(--cp-sh-3);
}
.cp-sheet__title{
  display:flex; align-items:center; gap:var(--cp-2);
  font-family:var(--cp-font-display); font-size:var(--cp-fs-h2);
  font-weight:700; color:var(--cp-ink); margin:0 0 var(--cp-4);
}
.cp-sheet__title i{ color:var(--cp-brand-500); font-size:14px; }
.cp-sheet__warn{
  margin-top:var(--cp-3); padding:var(--cp-3);
  background:var(--cp-neg-bg); border-radius:var(--cp-r-sm);
  font-size:var(--cp-fs-sm); color:var(--cp-neg); overflow-wrap:anywhere;
}

/* ============================================================
   PUNCH BAR (staff)
   Sits directly above the bottom nav on the dashboard, for people
   who mark their own attendance from this app.
   ============================================================ */
.cp-punchbar{
  position:fixed; left:0; right:0; z-index:1029;
  bottom:calc(var(--cp-nav-h) + var(--cp-safe-b));
  padding:var(--cp-3) var(--cp-4);
  background:color-mix(in srgb,var(--cp-surface) 92%,transparent);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-top:1px solid var(--cp-line-soft);
}
/* the dashboard needs room for the bar as well as the nav */
.cp-punchbar ~ .cp-nav{ box-shadow:none; }
body.cp-app:has(.cp-punchbar) .cp-page{ padding-bottom:calc(var(--cp-nav-h) + 72px + var(--cp-safe-b)); }

/* An amber action - punching out, as against the brand punch in */
.cp-btn--warn{ background:var(--cp-warn-bg); border-color:transparent; color:var(--cp-warn); }
.cp-btn--warn:active{ background:var(--cp-warn); color:#fff; }

/* ============================================================
   ATTENDANCE SPLIT (staff)
   The month's donut beside the three numbers it summarises.
   ============================================================ */
.cp-attsplit{ display:grid; grid-template-columns:150px minmax(0,1fr); gap:var(--cp-3); align-items:center; }
@media (max-width:359px){ .cp-attsplit{ grid-template-columns:1fr; } }
.cp-attsplit__chart{ width:150px; height:150px; margin:0 auto; }
.cp-attsplit__figs{ display:flex; flex-direction:column; gap:var(--cp-3); min-width:0; }
.cp-attsplit__figs > div{ display:flex; flex-direction:column; }
.cp-attsplit__v{
  font-family:var(--cp-font-display); font-size:var(--cp-fs-h1); font-weight:700;
  color:var(--cp-ink); line-height:1.1; font-variant-numeric:tabular-nums;
}
/* the two donut segments, named where the numbers are */
.cp-attsplit__figs > div:nth-child(1) .cp-label::before,
.cp-attsplit__figs > div:nth-child(2) .cp-label::before{
  content:''; display:inline-block; width:8px; height:8px; border-radius:50%;
  margin-right:6px; vertical-align:middle;
}
.cp-attsplit__figs > div:nth-child(1) .cp-label::before{ background:var(--cp-brand-500); }
.cp-attsplit__figs > div:nth-child(2) .cp-label::before{ background:var(--cp-accent); }

/* A form that is one card of fields */
.cp-formcard{
  background:var(--cp-surface); border:1px solid var(--cp-line);
  border-radius:var(--cp-r-lg); padding:var(--cp-5);
  box-shadow:var(--cp-sh-1);
}
.cp-formcard > .cp-field:last-of-type{ margin-bottom:0; }
/* One button fills the row; two share it. */
.cp-formactions:has(> .cp-btn:only-child){ grid-template-columns:1fr; }

/* A progress track on a light surface */
.cp-progress{ height:10px; border-radius:999px; background:var(--cp-surface-3); overflow:hidden; }
.cp-progress > div{ height:100%; border-radius:999px; background:var(--cp-brand-500); transition:width .3s var(--cp-ease); }

/* Small edit/delete actions at the end of a record card */
.cp-row__acts{ display:flex; gap:var(--cp-2); margin-top:4px; }
.cp-row__acts a{ color:var(--cp-ink-3); font-size:13px; padding:2px; }
.cp-row__acts a:last-child{ color:var(--cp-neg); }

/* An admin remark attached to a record */
.cp-row__note{
  margin-top:6px; padding:6px 9px; border-radius:9px;
  background:var(--cp-neg-bg); color:var(--cp-neg);
  font-size:var(--cp-fs-xs); overflow-wrap:anywhere;
}


/* ============================================================
   SIGN IN
   Shared by the admin, staff and manager sign-in screens.
   Lived in a <style> block inside admin/login.php and was
   copied into manager/login.php; staff/login.php never got the
   copy and rendered unstyled. One definition now.
   ============================================================ */
.cp-auth{ background:var(--cp-bg); }
.cp-auth__wrap{
    min-height:100dvh; display:flex; flex-direction:column; position:relative;
    padding:calc(var(--cp-safe-t) + var(--cp-6)) var(--cp-5) calc(var(--cp-safe-b) + var(--cp-5));
    max-width:520px; margin:0 auto;
}
/* Absolute, so it never pushes the centred brand block off the axis */
.cp-auth__back{
    position:absolute; top:calc(var(--cp-safe-t) + var(--cp-5)); left:var(--cp-5);
    width:40px;height:40px;border-radius:12px;background:var(--cp-surface);
    border:1px solid var(--cp-line-soft);display:grid;place-items:center;
    color:var(--cp-ink-2);box-shadow:var(--cp-sh-1);z-index:2;
}
/* Brand block is centred: on a sign in screen there is one thing to look
   at, so it sits on the page's axis rather than hugging the left corner. */
.cp-auth__brand{ padding:var(--cp-6) 0 var(--cp-6); text-align:center; }
.cp-auth__mark{
    width:76px;height:76px;margin:0 auto;border-radius:24px;
    display:grid;place-items:center;font-size:28px;color:#fff;overflow:hidden;
    background:linear-gradient(135deg,var(--cp-brand-500),var(--cp-brand-800));
    box-shadow:var(--cp-sh-brand);
}
.cp-auth__mark svg{ width:44px;height:44px; }
.cp-auth__lede{ font-size:var(--cp-fs-body); color:var(--cp-ink-3); margin:var(--cp-2) auto 0; max-width:300px; line-height:1.55; }
/* The form sits under the heading, not pushed to the bottom of the screen -
   on a tall phone that left a large dead gap in the middle. */
.cp-auth__form{
    background:var(--cp-surface); border:1px solid var(--cp-line-soft);
    border-radius:var(--cp-r-xl); padding:var(--cp-5);
    box-shadow:var(--cp-sh-1);
}
.cp-auth__foot{ text-align:center; font-size:var(--cp-fs-xs); color:var(--cp-ink-3); margin:var(--cp-5) 0 var(--cp-4); }
.cp-auth__form .cp-field:last-of-type{ margin-bottom:0; }

/* Input with a leading icon and an optional trailing action */
.cp-inputgroup{ position:relative; }
.cp-inputgroup > i{
    position:absolute; left:14px; top:50%; transform:translateY(-50%);
    color:var(--cp-ink-3); font-size:14px; pointer-events:none;
}
.cp-inputgroup .cp-input{ padding-left:42px; padding-right:46px; min-height:50px; }
.cp-inputgroup__act{
    position:absolute; right:6px; top:50%; transform:translateY(-50%);
    width:38px;height:38px;border:0;background:transparent;border-radius:10px;
    color:var(--cp-ink-3); font-size:14px;
}

/* formValidation's error text, in the app's voice */
.cp-auth .help-block{ font-size:var(--cp-fs-xs); color:var(--cp-neg); margin:6px 0 0; }
.cp-auth .has-error .cp-input{ border-color:var(--cp-neg); }

/* ============================================================
   INLINE CALENDAR
   The staff dashboard's attendance month.

   bootstrap-datepicker ships an inline widget sized for a desktop
   popover, and it writes the day's state class on the <td> with the
   number left as a bare text node - so the chip cannot be a wrapper
   element. The cell therefore stays transparent and only lays out the
   grid; ::before paints a square, centred, rounded chip behind the
   number. That keeps one button-shaped mark per date instead of a
   tinted rectangle that spans the whole column.
   ============================================================ */
.cp-app .datepicker-inline,
.cp-app #attendanceDate .datepicker{ width:100%; }
.cp-app #attendanceDate .datepicker table{ width:100%; table-layout:fixed; }

.cp-app .datepicker table tr td,
.cp-app .datepicker table tr th{
  position:relative; width:14.28%; height:42px; padding:2px;
  background:none!important; border:0;
  font-size:var(--cp-fs-sm); font-weight:600; color:var(--cp-ink);
  text-align:center; vertical-align:middle;
}
/* the chip: square, centred, never wider than the cell */
.cp-app .datepicker table tr td.day::before{
  content:''; position:absolute; top:50%; left:50%;
  width:34px; height:34px; margin:-17px 0 0 -17px;
  border-radius:11px; background:transparent;
  transition:background var(--cp-fast) var(--cp-ease);
}
.cp-app .datepicker table tr td.day{ position:relative; z-index:0; }
.cp-app .datepicker table tr td.day::before{ z-index:-1; }

.cp-app .datepicker table tr th.dow{
  height:26px; font-size:var(--cp-fs-micro); font-weight:700;
  letter-spacing:.04em; text-transform:uppercase; color:var(--cp-ink-3);
}
.cp-app .datepicker .datepicker-switch{
  font-family:var(--cp-font-display); font-weight:650;
  font-size:var(--cp-fs-body); color:var(--cp-ink);
}
.cp-app .datepicker .prev,
.cp-app .datepicker .next{ color:var(--cp-brand-500); font-weight:700; }
.cp-app .datepicker table tr td.old,
.cp-app .datepicker table tr td.new{ color:var(--cp-ink-3); opacity:.45; }
.cp-app .datepicker table tr td.old::before,
.cp-app .datepicker table tr td.new::before{ background:transparent!important; }

/* The three states a day can carry. The chip is filled with the state's
   own colour and the number is set in white, so a marked date reads as a
   button. A day with no attendance is left unfilled - filling every cell
   would put thirty solid blocks on screen and lose the distinction. */
/* A medium tint of the state's colour, with the state's own dark text on
   it: softer than a solid fill, but still clearly a filled button rather
   than a wash. A mid-strength fill with white text was the alternative and
   fails contrast badly - white on #10b981 is 2.54:1 - whereas this reads
   at 5.7-6.0 across all three states. */
.cp-app .datepicker table tr td.present-day{ color:#065f46!important; font-weight:700; }
.cp-app .datepicker table tr td.present-day::before{
  background:#a7f3d0; box-shadow:inset 0 0 0 1px #6ee7b7;
}
.cp-app .datepicker table tr td.absent-day{ color:#9f1239!important; font-weight:700; }
.cp-app .datepicker table tr td.absent-day::before{
  background:#fecdd3; box-shadow:inset 0 0 0 1px #fda4af;
}
.cp-app .datepicker table tr td.holiday-day{ color:#92400e!important; font-weight:700; }
.cp-app .datepicker table tr td.holiday-day::before{
  background:#fde68a; box-shadow:inset 0 0 0 1px #fcd34d;
}
.cp-app .datepicker table tr td.no-attendance{ color:var(--cp-ink-3); }

/* Today. A ring inside the chip disappears once the chip is filled, so it
   is drawn as a white inner ring with a brand ring outside it - legible on
   a filled chip and on an empty one. */
.cp-app .datepicker table tr td.today::before{
  box-shadow:inset 0 0 0 2px var(--cp-brand-500)!important;
}
.cp-app .datepicker table tr td.today:not(.present-day):not(.absent-day):not(.holiday-day){
  color:var(--cp-brand-600); font-weight:700;
}
/* only a day with attendance opens anything */
.cp-app .datepicker table tr td.present-day{ cursor:pointer; }
.cp-app .datepicker table tr td.day:active::before{ transform:scale(.9); }

/* the legend's colour marks, matching the chips */
.cp-legend .states{
  width:10px; height:10px; border-radius:3px; display:inline-block;
}
/* the legend marks match the chips exactly */
.cp-legend .states.present{ background:#a7f3d0; box-shadow:inset 0 0 0 1px #6ee7b7; }
.cp-legend .states.absent { background:#fecdd3; box-shadow:inset 0 0 0 1px #fda4af; }
.cp-legend .states.holiday{ background:#fde68a; box-shadow:inset 0 0 0 1px #fcd34d; }

/* On a 320px phone the cell is only 35px across, so a fixed 34px chip
   almost touches its neighbours. Shrink it to keep the gaps even. */
@media (max-width:359px){
  .cp-app .datepicker table tr td.day::before{
    width:30px; height:30px; margin:-15px 0 0 -15px; border-radius:10px;
  }
  .cp-app .datepicker table tr td,
  .cp-app .datepicker table tr th{ height:38px; font-size:var(--cp-fs-xs); }
}


/* =====================================================================
   THEME OVERRIDES
   ---------------------------------------------------------------------
   The old template's custom.css declares a handful of properties with
   !important. Specificity alone cannot beat that, so the few that reach
   redesigned components are answered here - scoped to .cp-app, so the
   template's own screens keep their appearance.
   ===================================================================== */

/* The request tabs carry .date-active for their own JS; the theme paints
   that amber. The selected tab should read as the app's own selection. */
.cp-app .cp-seg__i.date-active,
.cp-app .cp-seg__i.is-active{
  background:var(--cp-brand-50)!important;
  color:var(--cp-brand-600)!important;
  box-shadow:inset 0 -2.5px 0 var(--cp-brand-500);
}
.cp-app .cp-seg__i{ background:var(--cp-surface)!important; color:var(--cp-ink-2)!important; }
.cp-app .cp-seg__i.date-active .cp-seg__n,
.cp-app .cp-seg__i.is-active .cp-seg__n{
  background:var(--cp-brand-500)!important; color:#fff!important;
}
/* the theme also restyles .leave-count, which is the tabs' badge */
.cp-app .cp-seg__n{
  background:var(--cp-brand-50)!important; color:var(--cp-brand-600)!important;
  border-radius:999px!important; padding:0 5px!important;
}

/* One row, never wrapped and never scrolled: the tabs share the width
   and shorten their labels if they have to. */
.cp-seg{ flex-wrap:nowrap!important; overflow:hidden; }
.cp-seg--scroll{ overflow-x:hidden; }
.cp-seg--scroll .cp-seg__i{ flex:1 1 0; }
.cp-seg__i{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:flex; align-items:center; justify-content:center; gap:3px;
}

/* A smaller floating button: 54px was heavier than the action deserves. */
.cp-fab{ width:48px; height:48px; border-radius:16px; }
.cp-fab::before{ width:16px; height:2.5px; margin:-1.25px 0 0 -8px; }
.cp-fab::after { width:2.5px; height:16px; margin:-8px 0 0 -1.25px; }

/* ---- Radio and checkbox --------------------------------------------
   The forms were converted but their radios were left at the browser
   default, which is large and unstyled next to everything around it.
   Draw them at the size the rest of the form is set in. */
.cp-app .cp-page input[type="radio"],
.cp-app .cp-page input[type="checkbox"]{
  -webkit-appearance:none; appearance:none;
  width:16px; height:16px; flex:0 0 16px; margin:0 6px 0 0;
  border:1.5px solid var(--cp-line); background:var(--cp-surface);
  vertical-align:-3px; position:relative; cursor:pointer;
  transition:border-color var(--cp-fast), background var(--cp-fast);
}
.cp-app .cp-page input[type="radio"]{ border-radius:50%; }
.cp-app .cp-page input[type="checkbox"]{ border-radius:5px; }
.cp-app .cp-page input[type="radio"]:checked{
  border-color:var(--cp-brand-500); border-width:4.5px;
}
.cp-app .cp-page input[type="checkbox"]:checked{
  background:var(--cp-brand-500); border-color:var(--cp-brand-500);
}
.cp-app .cp-page input[type="checkbox"]:checked::after{
  content:''; position:absolute; left:4.5px; top:1.5px;
  width:4px; height:8px; border:solid #fff; border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.cp-app .cp-page input[type="radio"]:focus-visible,
.cp-app .cp-page input[type="checkbox"]:focus-visible{
  outline:2px solid var(--cp-brand-300); outline-offset:2px;
}
/* the label beside a radio, so the pair reads as one control */
.cp-app .cp-page .cp-radios{ display:flex; flex-wrap:wrap; gap:var(--cp-2) var(--cp-4); }
/* The row, not the circle, is what a thumb lands on - each input sits
   inside its own <label for>. Keep it a comfortable height even though
   the control itself is small. */
.cp-app .cp-page .cp-radios label,
.cp-app .cp-page label.cp-radio{
  display:inline-flex; align-items:center; margin:0; min-height:32px;
  padding-right:var(--cp-2);
  font-size:var(--cp-fs-sm); color:var(--cp-ink); cursor:pointer;
}
/* =====================================================================
   CLASSES THE VIEWS USE THAT HAD NO DEFINITION
   Written during the redesign but never added to the sheet, so they
   rendered as nothing. Found by checking every cp- class in every view
   against this file plus each page's own <style>.
   ===================================================================== */

/* the 4px step was missing from the margin scale */
.cp-mt-1{ margin-top:var(--cp-1); }

/* search field: an input with a magnifier sitting inside it */
.cp-search__ico{
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  color:var(--cp-ink-3); font-size:13px; pointer-events:none;
}
.cp-search__input{ padding-left:38px; }

/* the bar that appears once rows are selected: icon, two lines, a control */
.cp-actionbar{
  display:flex; align-items:center; gap:var(--cp-3);
  padding:var(--cp-3); border-radius:var(--cp-r);
  background:var(--cp-surface); border:1px solid var(--cp-line);
  box-shadow:var(--cp-sh-1);
}
.cp-actionbar__ico{
  width:34px; height:34px; flex:0 0 34px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
  color:#fff; font-size:14px;
}
.cp-actionbar__t{
  display:block; font-family:var(--cp-font-display); font-weight:650;
  font-size:var(--cp-fs-sm); color:var(--cp-ink);
}
.cp-actionbar__s{ display:block; font-size:var(--cp-fs-xs); color:var(--cp-ink-3); }

/* the birthday strip - defined in the admin page's own style block, so
   the staff dashboard was missing it */
.cp-bday{ margin-bottom:var(--cp-4); }

/* On a 320px phone four tabs share 288px - about 69px each, which is
   under what "On duty" and "Comp off" need beside their count. Drop the
   type and the padding at that width rather than let the labels clip. */
@media (max-width:359px){
  .cp-seg__i{ font-size:11px; padding:8px 2px; }
  .cp-seg__n{ font-size:9px; padding:0 2px; margin-left:2px; }
}

/* An initials avatar, where the record has no photo column to draw from */
.cp-profile__ava--init{
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--cp-brand-50); color:var(--cp-brand-600);
  font-family:var(--cp-font-display); font-size:22px; font-weight:700;
}


/* ============================================================
   HORIZONTAL RAILS
   Anything that scrolls sideways stays on one line and shows a
   soft fade at the edge that still has content, so it reads as
   scrollable rather than clipped. Wrapping was the alternative
   and it makes the page taller for no benefit.
   ============================================================ */
.cp-filters,
.cp-months,
.cp-scroller,
.cp-seg--scroll,
.cp-geonav{
  flex-wrap:nowrap!important;
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  /* the fade: painted only while there is something past the edge */
  background:
    linear-gradient(to right, var(--cp-bg) 30%, transparent) left / 22px 100% no-repeat local,
    linear-gradient(to left,  var(--cp-bg) 30%, transparent) right / 22px 100% no-repeat local,
    linear-gradient(to right, rgba(15,23,42,.10), transparent) left / 12px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(15,23,42,.10), transparent) right / 12px 100% no-repeat scroll;
}
.cp-filters::-webkit-scrollbar,
.cp-months::-webkit-scrollbar,
.cp-scroller::-webkit-scrollbar,
.cp-seg--scroll::-webkit-scrollbar,
.cp-geonav::-webkit-scrollbar{ display:none; }
/* on a card the fade has to match the card, not the page */
.cp-card .cp-filters,
.cp-card .cp-months{
  background:
    linear-gradient(to right, var(--cp-surface) 30%, transparent) left / 22px 100% no-repeat local,
    linear-gradient(to left,  var(--cp-surface) 30%, transparent) right / 22px 100% no-repeat local,
    linear-gradient(to right, rgba(15,23,42,.10), transparent) left / 12px 100% no-repeat scroll,
    linear-gradient(to left,  rgba(15,23,42,.10), transparent) right / 12px 100% no-repeat scroll;
}
/* every child of a rail keeps its width rather than being squeezed */
.cp-filters > *,
.cp-scroller > *,
.cp-geonav > *{ flex:0 0 auto; }
/* ============================================================
   SIGN-IN MARKS
   The three marks used to share one tile - same size, same
   gradient, same shadow - so only the glyph inside differed and
   at 44px they read as the same logo. Each role now has its own
   tile shape, its own gradient and its own glow, so the three
   are distinguishable at a glance and none looks like a
   placeholder for the others.
   ============================================================ */
.cp-auth__mark{ position:relative; }
/* a soft inner highlight, so the tile reads as a solid object */
.cp-auth__mark::after{
  content:''; position:absolute; inset:0; border-radius:inherit;
  background:linear-gradient(160deg,rgba(255,255,255,.22),transparent 55%);
  pointer-events:none;
}

/* Admin - a squarer shield of a tile, deepest blue, authority */
.cp-auth--admin .cp-auth__mark{
  width:82px; height:82px; border-radius:26px;
  background:linear-gradient(150deg,#2b52c8 0%,#1e3a8a 46%,#0b1330 100%);
  box-shadow:0 12px 30px rgba(17,29,67,.42), 0 2px 0 rgba(255,255,255,.14) inset;
}

/* Manager - a rounder tile, mid blue lifted with teal, approachable */
.cp-auth--manager .cp-auth__mark{
  width:82px; height:82px; border-radius:30px;
  background:linear-gradient(150deg,#2f6fd0 0%,#1e40af 52%,#172554 100%);
  box-shadow:0 12px 30px rgba(30,64,175,.38), 0 2px 0 rgba(255,255,255,.16) inset;
}

/* Staff - the roundest, lightest of the three: the everyday app */
.cp-auth--staff .cp-auth__mark{
  width:82px; height:82px; border-radius:34px;
  background:linear-gradient(150deg,#4b83e8 0%,#2b52c8 50%,#1e3a8a 100%);
  box-shadow:0 12px 30px rgba(43,82,200,.36), 0 2px 0 rgba(255,255,255,.18) inset;
}

.cp-auth__mark svg{ width:48px; height:48px; position:relative; z-index:1; }

/* ---------------------------------------------------------------
   PAYROLL PERIOD
   Shown under the month rail only when the company runs a custom
   payroll period, so "Sep" listing dates from 25 Aug reads as the
   setting it is rather than as a bug. One line, never wrapping -
   it is a caption, not a control.
   --------------------------------------------------------------- */
.cp-cycle{
  display:flex; align-items:center; gap:6px;
  margin-top:var(--cp-2);
  padding:5px 10px;
  border-radius:8px;
  background:var(--cp-brand-50);
  color:var(--cp-brand-600);
  font-size:var(--cp-fs-xs);
  font-weight:650;
  line-height:1.25;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.cp-cycle i{ font-size:11px; opacity:.85; flex:0 0 auto; }
.cp-cycle span{ overflow:hidden; text-overflow:ellipsis; }
