/* =====================================================================
   CBT Time Clock — SLA design language
   (Bricolage Grotesque display + Inter body, warm off-white, coral pop)

   Sections
     1.  Tokens
     2.  Base & typography
     3.  Shell, topbar, pill nav, clock, footer
     4.  Page head, eyebrow, lede
     5.  SLA components: card, kpis, tiles, rowlist, data table
     6.  Chips, badges, tags, dots
     7.  Buttons & links
     8.  Notes & flash messages
     9.  Forms (native controls, fields, filters)
     10. HR admin (sub-nav, table helpers, inline punch edit)
     11. Period nav + day-by-day timesheet rows
     12. (approvals: see css/approvals.css)
     13. Misc: setup steps, spinner
     14. Kiosk: see css/kiosk.css (only the scrollbar guards live here)
     15. (on-screen keyboard: see css/kiosk.css)
     16. Responsive
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */
:root {
  --bg:        #F1EDE6;
  --bg-2:      #E8E2D4;
  --card:      #FFFFFF;
  --ink:       #16151A;
  --ink-2:     #34313B;
  --muted:     #7A7684;
  --edge:      #E6E1D6;
  --pop:       #E85A3C;
  --pop-hover: #C94A2E;
  --pop-2:     #F0D2C4;
  --pop-ink:   #8A2D18;

  --green:     #1B7A50;
  --green-hover: #146140;
  --green-bg:  #E1F0E8;
  --amber:     #A5601B;
  --amber-bg:  #F5EBDA;
  --red:       #B23A22;
  --red-hover: #962F1A;
  --red-bg:    #F6E1DA;
  --blue:      #2B5FA1;
  --blue-bg:   #DDE9F8;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 20px;
  --r-hero: 24px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(20,20,25,0.04);
  --sh-md: 0 6px 20px rgba(20,20,25,0.08);
  --sh-lg: 0 12px 36px rgba(20,20,25,0.14);
  --ring:  0 0 0 3px rgba(232,90,60,0.15);

  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
}


/* ---------------------------------------------------------------------
   2. Base & typography
   --------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }  /* reserve scrollbar space so pages don't shift */
/* hide scrollbars on every kiosk page (touch scrolling still works) */
html:has(body.is-kiosk) { scrollbar-width: none; }
html:has(body.is-kiosk)::-webkit-scrollbar { display: none; }
/* Kiosk: no scrollbar, so the page doesn't jump sideways as results appear (touch scroll still works) */
html:has(#osk-mount) { scrollbar-width: none; }
html:has(#osk-mount)::-webkit-scrollbar { display: none; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pop); text-decoration: none; }
/* SLA never underlines links; only help-text links get an underline on hover */
.hint a:hover, .field-help a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Keyboard focus: one coral ring everywhere (text inputs use border + ring instead, see §9) */
:focus-visible { outline: 3px solid rgba(232,90,60,0.55); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 800; letter-spacing: -0.035em; color: var(--ink);
  margin: 0;
}
h1 { font-size: 3rem;    line-height: 1;   letter-spacing: -0.045em; }
h2 { font-size: 1.5rem;  line-height: 1.1; }
h3 { font-size: 1.15rem; line-height: 1.2; letter-spacing: -0.025em; font-weight: 700; }
h4 { font-size: 1rem;    line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; }

strong, b { font-weight: 700; }

code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--bg-2); color: var(--ink-2);
  padding: 2px 6px; border-radius: 6px;
  word-break: break-word;
}

main { display: block; }

/* Utilities (SLA) */
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.right { text-align: right; }
.row-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 6px; line-height: 1.45; }
.inline { display: inline; margin: 0; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ---------------------------------------------------------------------
   3. Shell, topbar, pill nav, clock, footer
   --------------------------------------------------------------------- */
.shell {
  max-width: 1520px; margin: 0 auto;
  padding: 20px 28px 44px;
}

.topbar {
  background: var(--card); border: 1.5px solid var(--edge); color: var(--ink);
  border-radius: var(--r-xl); padding: 10px 14px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
}

.brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  color: var(--ink); text-decoration: none;
}
a.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--ink);
  display: grid; place-items: center; color: var(--card);
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  font-variation-settings: "opsz" 96; letter-spacing: -0.05em; line-height: 1;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.2rem; letter-spacing: -0.035em; line-height: 1;
  font-variation-settings: "opsz" 96; color: var(--ink);
  text-decoration: none;
}
.brand-sub {
  font-size: 0.66rem; color: var(--muted); letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700; margin-top: 3px; white-space: nowrap;
}

/* Primary pill nav (topbar) */
.topnav { display: flex; gap: 2px; margin-left: auto; min-width: 0; }
.topnav a {
  padding: 9px 16px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.88rem; color: var(--muted);
  letter-spacing: -0.005em; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.topnav a.active { background: var(--ink); color: var(--card); }
.topnav a:hover:not(.active) { color: var(--ink); background: var(--bg); text-decoration: none; }
/* Sign out: plain nav item, set apart by a thin divider (no outline ring) */
.topnav a.nav-signout { position: relative; margin-left: 12px; }
.topnav a.nav-signout::before {
  content: ""; position: absolute; left: -7px; top: 50%;
  width: 1.5px; height: 18px; margin-top: -9px; background: var(--edge);
}

/* Live clock */
.clock-wrap {
  margin-left: auto; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.topnav + .clock-wrap { margin-left: 6px; }
.clock {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ink); background: var(--bg);
  padding: 10px 14px; border-radius: var(--r-pill);
  min-height: 36px;
}
.clock::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); box-shadow: 0 0 0 3px var(--green-bg);
}
.clock-date {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}

.main { display: block; }

.foot {
  text-align: center; margin: 30px 0 0; color: var(--muted); font-size: 0.82rem;
}


/* ---------------------------------------------------------------------
   4. Page head, eyebrow, lede
   --------------------------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px 20px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head > div:first-child { min-width: 0; }
.page-head > div { flex-wrap: wrap; max-width: 100%; }   /* legacy inline-flex button groups wrap on phones */

/* Page titles */
.page-head h1,
.page-head h2 {
  font-size: 2.4rem; line-height: 1.02; letter-spacing: -0.045em; font-weight: 800;
}

.eyebrow {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--pop-2); color: var(--pop-ink);
  font-weight: 700; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 10px; line-height: 1.5;
}
.eyebrow a { color: inherit; text-decoration: none; }
.lede {
  color: var(--muted); font-size: 0.95rem; max-width: 640px; margin: 8px 0 0;
  line-height: 1.5;
}
/* status chips straight on the beige page (page heads): the tinted fill alone is ~1:1 against
   the background, so give them a faint ring in their own colour */
.page-head .chip.good, .page-head .chip.mid, .page-head .chip.low {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 30%, transparent);
}


/* ---------------------------------------------------------------------
   5. SLA components: card, kpis, tiles, rowlist, data table
   --------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1.5px solid var(--edge);
  border-radius: var(--r-hero); padding: 22px 26px;
  min-width: 0;
}
.card + .card, .card + .kpis, .kpis + .card,
.card + .grid, .grid + .card,
.card + .rowlist, .rowlist + .card,
.card + .table-wrap, .table-wrap + .card { margin-top: 14px; }
.card.hero { padding: 34px 40px; }
.card.inset { background: var(--bg); border-color: transparent; border-radius: var(--r-xl); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { font-size: 1.35rem; }
.card-head .actions, a.actions { font-weight: 600; color: var(--pop); font-size: 0.9rem; }

/* KPI grid */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpis.k-3 { grid-template-columns: repeat(3, 1fr); }
.kpis.k-2 { grid-template-columns: repeat(2, 1fr); }
.kpi {
  background: var(--card); border-radius: var(--r-lg);
  padding: 18px 20px 16px; border: 1.5px solid var(--edge);
  display: block; color: inherit; text-decoration: none; min-width: 0;
  transition: border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
a.kpi:hover {
  border-color: var(--ink); box-shadow: var(--sh-md);
  transform: translateY(-1px); text-decoration: none;
}
a.kpi.filled:hover, a.kpi.pop:hover { filter: brightness(1.06); }
.kpi .lbl {
  font-weight: 700; font-size: 0.68rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px;
}
.kpi .n {
  font-family: var(--font-display);
  font-size: 2.6rem; line-height: 1; color: var(--ink);
  letter-spacing: -0.045em; font-weight: 800;
  font-variation-settings: "opsz" 96;
}
.kpi .sub { color: var(--muted); font-size: 0.78rem; margin-top: 8px; }
.kpi.filled { background: var(--ink); color: var(--card); border-color: var(--ink); }
.kpi.filled .lbl { color: rgba(255,255,255,0.5); }
.kpi.filled .n   { color: var(--card); }
.kpi.filled .sub { color: rgba(255,255,255,0.55); }
.kpi.pop { background: var(--pop); color: var(--card); border-color: var(--pop); }
.kpi.pop .lbl { color: rgba(255,255,255,0.85); }
.kpi.pop .n   { color: var(--card); }
.kpi.pop .sub { color: rgba(255,255,255,0.85); }
.kpi.is-zero .n { color: var(--muted); }

/* Tile grid */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tile {
  background: var(--card); border: 1.5px solid var(--edge);
  border-radius: var(--r-xl); padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 150px; color: var(--ink); text-decoration: none; min-width: 0;
  transition: border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
a.tile:hover {
  border-color: var(--ink); box-shadow: var(--sh-md);
  transform: translateY(-1px); text-decoration: none;
}
.tile .tile-title {
  font-family: var(--font-display);
  font-size: 1.15rem; line-height: 1.15; font-weight: 700;
  letter-spacing: -0.025em; font-variation-settings: "opsz" 48;
}
.tile p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.tile .tile-footer {
  margin-top: auto; padding-top: 10px; border-top: 1.5px dashed var(--edge);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.tile .metric {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1;
  font-variation-settings: "opsz" 96;
}
.tile .metric-lbl {
  font-weight: 700; font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}

/* Row list (SLA "recent sessions") — set your own grid-template-columns per page if needed */
.rowlist { display: flex; flex-direction: column; gap: 2px; }
.rowlist .row {
  display: grid; grid-template-columns: 90px 1fr 120px 90px;
  gap: 16px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-md);
  transition: background 0.15s;
  color: var(--ink); text-decoration: none;
}
.rowlist a.row:hover { background: var(--bg); text-decoration: none; }
.rowlist .row .yr {
  font-family: var(--font-display);
  font-size: 1.35rem; line-height: 1; color: var(--ink);
  font-weight: 800; letter-spacing: -0.035em;
  font-variation-settings: "opsz" 96;
}
.rowlist .row .name {
  font-family: var(--font-display);
  font-size: 1rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.02em; font-variation-settings: "opsz" 48;
}
.rowlist .row .n {
  color: var(--muted); font-weight: 500; font-size: 0.85rem; text-align: right;
}

/* Data table (SLA). Put it in a .card (or .table-wrap) — wide tables scroll inside it. */
.table-wrap {
  position: relative;          /* keeps absolutely placed bits (.sr-only header text) inside the scroller */
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border: 1.5px solid var(--edge);
  border-radius: var(--r-hero);
}
.card .table-wrap { border: 0; border-radius: 0; background: transparent; margin: 0 -10px; }
table.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: transparent;
}
table.data th, table.data td {
  padding: 10px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1.5px solid var(--edge); font-size: 0.9rem;
}
table.data thead th {
  background: transparent; color: var(--muted);
  font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700;
  border-bottom: 1.5px solid var(--edge); white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--bg); }
table.data td.num, table.data th.num,
table.data td.col-num, table.data th.col-num { text-align: right; }
table.data td.name {
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 700; letter-spacing: -0.015em; color: var(--ink);
}
table.data td.num, table.data td.col-num {
  font-family: var(--font-display);
  font-weight: 800; letter-spacing: -0.025em;
  font-variation-settings: "opsz" 48; font-size: 1.02rem;
  white-space: nowrap;
}
table.data tfoot td {
  border-top: 1.5px solid var(--edge); border-bottom: 0;
  background: var(--bg); font-weight: 700;
}
/* edge cells: 22px in a bare .table-wrap card; inside a .card the wrap bleeds 10px into the card
   padding, so 10px lines the text up with the card heading. Written at the same specificity as
   "table.data td" (page CSS can still set its own edges with an ordinary class selector). */
table.data:where(.table-wrap > *) :is(th, td):where(:first-child) { padding-left: 22px; }
table.data:where(.table-wrap > *) :is(th, td):where(:last-child)  { padding-right: 22px; }
table.data:where(.card .table-wrap > *) :is(th, td):where(:first-child) { padding-left: 10px; }
table.data:where(.card .table-wrap > *) :is(th, td):where(:last-child)  { padding-right: 10px; }

/* Empty state: a card with a title, one muted line and (optionally) a coral link on the right */
.empty-card .card-head { margin-bottom: 4px; }
.empty-card > p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.empty-card > p + p { margin-top: 4px; }
.empty-card > p a { font-weight: 600; }
.empty-card[hidden] { display: none; }


/* ---------------------------------------------------------------------
   6. Chips, badges, tags, dots
   --------------------------------------------------------------------- */
.chip {
  display: inline-block; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink);
  font-weight: 700; font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; white-space: nowrap; line-height: 1.5;
  text-decoration: none;
}
a.chip:hover { text-decoration: none; }
.chip.pop     { background: var(--pop-2);   color: var(--pop-ink); }
.chip.dark    { background: var(--ink);     color: var(--card); }
.chip.good    { background: var(--green-bg); color: var(--green); }
.chip.mid     { background: var(--amber-bg); color: var(--amber); }
.chip.low     { background: var(--red-bg);   color: var(--red); }
.chip.blue    { background: var(--blue-bg);  color: var(--blue); }
.chip.outline { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--edge); font-weight: 600; }
button.chip.outline { border: 0; font-family: inherit; cursor: pointer; }
a.chip.outline, button.chip.outline { transition: color 0.15s, box-shadow 0.15s; }
a.chip.outline:hover, button.chip.outline:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chip-lg { padding: 6px 14px; font-size: 0.72rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Status badges (legacy names, SLA chip look) */
.badge {
  display: inline-block; vertical-align: middle;
  padding: 3px 10px; margin: 0 4px 0 0; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink-2);
  font-weight: 700; font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap; line-height: 1.3;
}
.badge-pending { background: var(--amber-bg); color: var(--amber); }

/* Department tag */
.tag {
  display: inline-block; vertical-align: middle;
  padding: 3px 9px; margin: 0 4px 0 0; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink);
  font-weight: 700; font-size: 0.62rem; letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap; line-height: 1.3;
}

/* Direction colours (IN / OUT, OT minutes) */
.dir-in  { color: var(--green); font-weight: 700; }
.dir-out { color: var(--pop);   font-weight: 700; }

/* Status dot */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #C9C3B6; }
.dot-in  { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.dot-out { background: #C9C3B6; }


/* ---------------------------------------------------------------------
   7. Buttons & links
   --------------------------------------------------------------------- */
button { font-family: inherit; }

/* Coral primary pill (SLA .add-btn) */
.add-btn,
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--pop); color: var(--card);
  border: 0; border-radius: var(--r-pill); padding: 12px 22px;
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.add-btn:hover,
.btn-primary:hover { background: var(--pop-hover); color: var(--card); text-decoration: none; transform: translateY(-1px); }
.add-btn:active,
.btn-primary:active { transform: translateY(0); }
.add-btn:disabled, .btn-primary:disabled,
.add-btn[aria-disabled="true"] { background: var(--muted); cursor: not-allowed; transform: none; opacity: 0.7; }
/* (focus ring for every button/link comes from the global :focus-visible rule in §2) */

/* Outline (ink ring) */
.add-btn.outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--ink);
  border: 0; border-radius: var(--r-pill); padding: 12px 22px;
  box-shadow: inset 0 0 0 2px var(--ink);
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 800; font-size: 0.95rem; letter-spacing: -0.02em; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.add-btn.outline:hover { background: var(--ink); color: var(--card); text-decoration: none; transform: translateY(-1px); }

.add-btn.sm { padding: 9px 16px; font-size: 0.86rem; }
.add-btn.lg { padding: 16px 30px; font-size: 1.1rem; }

/* Save bar (SLA) */
.save-bar {
  margin-top: 18px;
  background: var(--card); border: 1.5px solid var(--edge);
  border-radius: var(--r-hero); padding: 14px 18px;
  display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap;
}
.save-bar.sticky { position: sticky; bottom: 14px; z-index: 5; box-shadow: var(--sh-md); }
.save-btn {
  background: var(--pop); color: var(--card); border: 0;
  border-radius: var(--r-pill); padding: 12px 26px;
  font-family: var(--font-display); font-weight: 800;
  font-size: 1rem; letter-spacing: -0.02em; font-variation-settings: "opsz" 48;
  cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.save-btn:hover { background: var(--pop-hover); }
.save-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* "Cancel" in a save bar = SLA outline chip with a real hit area */
.save-bar .chip.outline {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 18px; font-size: 0.68rem;
}

/* Small row-level button (Save / Add / Make unpaid / Delete / Copy): white pill, beige ring */
.mini-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--edge); background: var(--card); color: var(--ink);
  font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; line-height: 1;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.mini-btn:hover { border-color: var(--ink); text-decoration: none; }
.mini-btn.danger { color: var(--red); }
.mini-btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.mini-btn.pop { background: var(--pop); border-color: var(--pop); color: var(--card); }
.mini-btn.pop:hover { background: var(--pop-hover); border-color: var(--pop-hover); }

/* Compact clock in/out (portal) */
.btn-compact {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 10px 20px; border: 0; border-radius: var(--r-pill);
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 800; font-size: 0.92rem; letter-spacing: -0.015em; line-height: 1.1;
  color: var(--card); background: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, transform 0.05s;
}
.btn-compact:hover { transform: translateY(-1px); }
.btn-in-sm  { background: var(--pop); }          /* Clock IN is coral everywhere (kiosk, /me) */
.btn-in-sm:hover  { background: var(--pop-hover); }
.btn-out-sm { background: var(--ink); }
.btn-out-sm:hover { background: #000; }

/* Text links */
.link-muted {
  color: var(--muted); font-weight: 600; font-size: 0.88rem; text-decoration: none; border-radius: 6px;
  transition: color 0.15s;
}
.link-muted:hover { color: var(--ink); text-decoration: none; }
/* row actions in tables read as ink (SLA), coral on hover */
table.data .link-muted { color: var(--ink); }
table.data .link-muted:hover { color: var(--pop); }
/* "Go to" link in a table row or list row ("Timesheet →", "Details →", "Preview →") = SLA's
   coral card-head .actions. (Coral pills are for tile footers only.) */
.row-go { color: var(--pop); font-weight: 600; font-size: 0.9rem; white-space: nowrap; text-decoration: none; transition: color 0.15s; }
a.row-go:hover, a:hover .row-go { color: var(--pop-hover); text-decoration: none; }
.add-link {
  color: var(--pop); font-weight: 600; font-size: 0.84rem; text-decoration: none; cursor: pointer;
}
.add-link:hover { color: var(--pop-hover); text-decoration: none; }

/* Icon buttons (edit / delete punch) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0;
  color: var(--muted); background: transparent; text-decoration: none;
  font-size: 1rem; line-height: 1; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.icon-btn.icon-danger:hover { background: var(--red-bg); color: var(--red); }


/* ---------------------------------------------------------------------
   7b. Message pages: one centred card (not set up, no approval permissions, SSO, Teams)
   --------------------------------------------------------------------- */
.msg-page { display: flex; justify-content: center; padding-top: 4vh; }
.msg-card { width: 100%; max-width: 640px; padding: 36px 40px; }
.msg-card h1 { font-size: 2.3rem; line-height: 1.04; letter-spacing: -0.045em; margin: 0; }
.msg-card .lede { font-size: 1rem; margin-top: 12px; max-width: none; }
.msg-card .note { margin-top: 20px; }
.msg-card .note code { background: rgba(255,255,255,0.6); }
.msg-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }


/* ---------------------------------------------------------------------
   8. Notes & flash messages
   --------------------------------------------------------------------- */
.note,
.flash {
  margin-top: 12px; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--pop-2); color: var(--pop-ink);
  font-size: 0.9rem; line-height: 1.45;
}
.note strong, .flash strong { color: var(--pop); font-weight: 700; }
.note a, .flash a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.note.dim { background: var(--bg-2); color: var(--ink-2); }
.note.dim strong { color: var(--ink); }
.note.good { background: var(--green-bg); color: var(--green); }
.note.good strong { color: var(--green); }

.flash { margin: 0 0 16px; }
.flash-success { background: var(--green-bg); color: #155C3C; }
.flash-success strong { color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }   /* ~4.7:1, distinct from neutral .note peach */
.flash-error strong { color: var(--red); }

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash-stack .flash { margin: 0; }


/* ---------------------------------------------------------------------
   9. Forms
   --------------------------------------------------------------------- */

/* SLA field primitives */
.field { display: block; min-width: 0; }
.field-lbl {
  display: block;
  font-weight: 700; font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}

/* Native controls look SLA-styled everywhere */
input[type="text"], input[type="email"], input[type="number"], input[type="date"],
input[type="time"], input[type="month"], input[type="password"], input[type="search"],
input[type="url"], input[type="tel"], input[type="datetime-local"], input:not([type]),
select, textarea, .input {
  max-width: 100%; min-width: 0;
  padding: 12px 16px;
  background-color: var(--bg); color: var(--ink);
  border: 1.5px solid var(--edge); border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 1rem; font-weight: 400; line-height: 1.3;
  letter-spacing: normal; text-transform: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.input { width: 100%; display: block; }
input:focus, select:focus, textarea:focus, .input:focus {
  outline: none; border-color: var(--ink); background-color: var(--card); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.85; }
select, select.input {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2316151A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px; cursor: pointer;
}
textarea { resize: vertical; line-height: 1.5; font-size: 0.95rem; min-height: 84px; }
input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; margin: 0; flex-shrink: 0;
  accent-color: var(--ink); cursor: pointer;
}
/* checkboxes/radios: crisp coral ring on keyboard focus, nothing on click */
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--pop); outline-offset: 2px; }
input[type="number"] { font-variant-numeric: tabular-nums; }

.field-help {
  display: block; margin-top: 4px;
  font-size: 0.8rem; font-weight: 400; line-height: 1.45;
  letter-spacing: normal; text-transform: none; color: var(--muted);
}

.form-actions { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
/* Filter bar (status pills) → SLA segmented pill group */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%;
  padding: 4px; margin-bottom: 16px;
  background: var(--card); border: 1.5px solid var(--edge); border-radius: 22px;
}
.filter-bar .chip {
  padding: 8px 16px; border-radius: var(--r-pill);
  background: transparent; color: var(--muted);
  font-weight: 600; font-size: 0.86rem; letter-spacing: -0.005em; text-transform: none;
  transition: background 0.15s, color 0.15s;
}
.filter-bar .chip:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.chip-active,
.filter-bar .chip.chip-active { background: var(--ink); color: var(--card); }
.filter-bar .chip.chip-active:hover { background: var(--ink); color: var(--card); }

/* Filter form (GET filters above tables) */
.filter-form {
  display: flex; gap: 12px 14px; align-items: flex-end; flex-wrap: wrap;
  background: var(--card); border: 1.5px solid var(--edge); border-radius: var(--r-xl);
  padding: 14px 18px; margin-bottom: 16px;
  width: fit-content; max-width: 100%;
}
.filter-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-weight: 700; font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.filter-form input, .filter-form select { padding: 9px 14px; font-size: 0.92rem; min-width: 180px; }
.filter-form select { padding-right: 38px; }
.filter-form .form-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.filter-form .btn-primary { padding: 10px 18px; font-size: 0.9rem; }


/* ---------------------------------------------------------------------
   10. HR admin
   --------------------------------------------------------------------- */
.admin-shell { min-width: 0; }
.admin-body { min-width: 0; }
/* flash messages ("Done · Saved") sit under the HR tabs, next to the page they belong to */
.main:has(> .admin-shell) { display: flex; flex-direction: column; }
.main > .admin-shell { display: contents; }
.admin-shell > .admin-nav { order: -1; }

/* Secondary nav = SLA underline tabs (.div-tabs in sla-tool/forms.html).
   The 2px baseline is an inset shadow on the nav, so the tab strip can scroll
   sideways on small screens without clipping the active tab's 3px underline. */
.admin-nav {
  display: flex; align-items: flex-end; gap: 0 12px;
  background: none; border: 0; border-radius: 0; padding: 0;
  box-shadow: inset 0 -2px 0 var(--edge);
  margin: -4px 0 24px;
}
/* one row of tabs at every width; scrolls sideways when it doesn't fit (admin/base.html centres the active tab) */
.admin-nav-links {
  display: flex; flex-wrap: nowrap; gap: 0; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.admin-nav-links { scroll-padding-inline: 16px; }
.admin-nav-links::-webkit-scrollbar { display: none; }
/* when the strip scrolls, fade the edge(s) that have more tabs past them (classes set by admin/base.html) */
.admin-nav-links.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.admin-nav-links.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.admin-nav-links.fade-l.fade-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
.admin-nav-links a:focus-visible { outline-offset: -3px; }   /* inside the scroller, so not clipped */
.admin-nav a {
  display: inline-flex; align-items: center;
  padding: 12px 15px 11px; border-radius: 10px 10px 0 0;
  border-bottom: 3px solid transparent;
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 600; font-size: 0.98rem; letter-spacing: -0.01em; line-height: 1.2;
  color: var(--muted); white-space: nowrap; text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.admin-nav a:hover:not(.active) { background: none; color: var(--ink); text-decoration: none; }
.admin-nav a.active { background: none; color: var(--pop); border-bottom-color: var(--pop); }
.admin-nav .spacer { flex: 1; }
.admin-nav a.admin-nav-back {
  flex: none; align-self: center; margin-left: 8px; border-bottom: 0; padding: 8px 4px 8px 10px;
  font-family: var(--font-body); font-variation-settings: normal;
  font-size: 0.86rem; font-weight: 600; letter-spacing: -0.005em; color: var(--muted);
}
.admin-nav a.admin-nav-back:hover { color: var(--pop); }

.col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.col-num {
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 700; font-size: 0.98rem; letter-spacing: -0.015em;
}
td.col-num strong { font-weight: 800; }
.resolved-by { font-size: 0.74rem; margin-top: 3px; }

.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-actions form { margin: 0; }
td.row-actions { display: table-cell; white-space: nowrap; }
td.row-actions > form { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }

/* HR inline punch edit (staff timesheet) */
.hr-edit-row { gap: 10px; align-items: center; }
.hr-inline-edit { display: flex; align-items: center; gap: 8px; flex: 1; margin: 0; flex-wrap: wrap; min-width: 0; }
.hr-inline-edit input[type="time"],
.hr-inline-edit select {
  width: auto; padding: 7px 10px; border-radius: var(--r-sm); font-size: 0.9rem;
}
.hr-inline-edit select { padding-right: 32px; background-position: right 10px center; }
.hr-inline-edit input[type="time"] { font-variant-numeric: tabular-nums; }
.hr-inline-edit .p-dept { flex: 0 1 auto; color: var(--muted); font-size: 0.9rem; min-width: 0; }

.hr-add-details { margin-top: 8px; }
.page-head .hr-add-details { margin-top: 0; }
.hr-add-details summary { list-style: none; cursor: pointer; display: inline-flex; }
.hr-add-details summary::-webkit-details-marker { display: none; }
.hr-add-form {
  display: flex; gap: 8px; margin-top: 8px; padding: 10px;
  background: var(--bg); border-radius: var(--r-md);
  align-items: center; flex-wrap: wrap;
}
.hr-add-form select, .hr-add-form input:not([type="checkbox"]):not([type="radio"]) {
  width: auto; padding: 8px 12px; border-radius: var(--r-sm); font-size: 0.9rem;
  background-color: var(--card);
}
.hr-add-form select { padding-right: 32px; background-position: right 10px center; }


/* ---------------------------------------------------------------------
   11. Period nav + day-by-day timesheet rows
   --------------------------------------------------------------------- */
/* Segmented period nav (← Prev | This … | Next →) */
.week-nav {
  display: inline-flex; gap: 2px; padding: 4px; flex-shrink: 0;
  background: var(--card); border: 1.5px solid var(--edge); border-radius: var(--r-pill);
}
.nav-btn {
  display: inline-flex; align-items: center; padding: 7px 14px;
  border-radius: var(--r-pill); color: var(--ink-2);
  font-weight: 600; font-size: 0.85rem; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.week-nav .nav-btn.is-current,
.week-nav .nav-btn.is-current:hover { background: var(--ink); color: var(--card); }
/* "← Aug | [month] | Oct →": a month picker in the middle pill */
.month-pick { display: flex; align-items: center; margin: 0; }
.month-pick label { display: flex; }
.month-pick input[type="month"] {
  padding: 6px 12px; min-height: 33px;
  border: 0; border-radius: var(--r-pill); background-color: var(--bg);
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 700; font-size: 0.9rem; letter-spacing: -0.01em; color: var(--ink);
}
.month-pick input[type="month"]:focus { background-color: var(--card); box-shadow: var(--ring); }

/* Timesheet card */
.timesheet {
  background: var(--card); border: 1.5px solid var(--edge);
  border-radius: var(--r-hero); overflow: hidden;
}
.day-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  border-bottom: 1.5px solid var(--edge);
}
.day-row:last-child { border-bottom: 0; }
.day-label {
  padding: 16px 12px 16px 22px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.day-name {
  font-family: var(--font-display); font-variation-settings: "opsz" 96;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink);
}
.day-date { color: var(--muted); font-size: 0.8rem; }
.day-hours {
  display: inline-block; margin-top: 6px; color: var(--ink);
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 800; font-size: 1.02rem; letter-spacing: -0.025em; line-height: 1.3;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.day-punches { padding: 10px 20px 12px 6px; min-width: 0; }
.punch-line {
  display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 0.92rem; min-width: 0;
}
.punch-line + .punch-line { border-top: 1px solid #F0ECE4; }
.p-time {
  min-width: 82px; color: var(--ink);
  font-family: var(--font-display); font-variation-settings: "opsz" 48;
  font-weight: 700; font-size: 1rem; letter-spacing: -0.015em; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.p-dir {
  display: inline-block; min-width: 46px; text-align: center;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.5;
  background: var(--bg-2); color: var(--ink-2);
}
.p-dir.dir-in  { background: var(--green-bg); color: var(--green); }
.p-dir.dir-out { background: var(--bg-2); color: var(--ink-2); }
.p-dept { flex: 1; color: var(--muted); min-width: 0; }
.punch-empty { color: var(--muted); padding: 7px 0; font-size: 0.88rem; }

/* Quoted note (approvals) */
.cr-note {
  margin-top: 8px; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink-2); font-size: 0.86rem;
}

/* Why a punch was changed (templates/_punch_note.html): one quiet line under the punch —
   [EDITED · WAS 4:25 PM] “Left at 4 — the kiosk was busy” Stephen Wiley · Oct 5 */
.punch-why {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0;
  font-size: 0.8rem; line-height: 1.45; color: var(--muted);
}
.punch-why-what {
  color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.punch-why-tag {
  flex-shrink: 0; padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--ink-2);
  font-weight: 700; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.7;
  white-space: nowrap;
}
.punch-why-note { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; quotes: "\201C" "\201D"; }
/* nowrap on phones would push a long "Kathy's request · approved by …" past the edge: wrap between words */
.punch-why-by { min-width: 0; overflow-wrap: anywhere; }
/* a punch deleted in the app: [IN 10:52 AM] struck through, then DELETED · “why” who · when */
.punch-why.is-deleted .punch-why-what s { color: var(--muted); text-decoration-thickness: 1.5px; }
.punch-why.is-deleted .punch-why-tag { background: var(--red-bg); color: var(--red); }

/* "12 / 20" under an explanation field (static/punch-note.js); green once it's long enough */
.note-count {
  flex-shrink: 0; color: var(--muted); white-space: nowrap;
  font-size: 0.76rem; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: color 0.15s;
}
.note-count.is-ok { color: var(--green); }

/* ---------------------------------------------------------------------
   13. Misc: setup steps, spinner
   --------------------------------------------------------------------- */
/* Numbered setup steps (Teams setup) */
.setup-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; line-height: 1.6; }
.setup-steps > li {
  counter-increment: step; position: relative;
  padding: 2px 0 0 44px; margin-bottom: 14px;
}
.setup-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pop-2); color: var(--pop-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 0.9rem;
}
.setup-steps ul { padding-left: 18px; margin: 6px 0; }
.setup-steps ul li { margin-bottom: 2px; }

.spinner {
  display: inline-block; width: 34px; height: 34px;
  border: 3px solid var(--edge); border-top-color: var(--pop); border-radius: 50%;
  animation: tc-spin 0.9s linear infinite; margin: 16px 0;
}
@keyframes tc-spin { to { transform: rotate(360deg); } }
.fallback { display: none; }
.fallback.shown { display: block; }


/* ---------------------------------------------------------------------
   16. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .admin-nav a { padding-left: 11px; padding-right: 11px; }   /* all ten HR tabs fit at 1024 */
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis.k-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topnav { order: 3; flex-basis: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  /* nav scrolls sideways here, so the focus ring goes inside the pill (not clipped) */
  .topnav a:focus-visible { outline-color: var(--pop); outline-offset: -3px; }
  .topnav + .clock-wrap { margin-left: auto; }
}

@media (max-width: 720px) {
  .shell { padding: 14px 14px 36px; }
  .topbar { padding: 10px 10px 10px 12px; margin-bottom: 16px; }
  .topnav a { padding: 8px 13px; font-size: 0.86rem; }
  .topnav a.nav-signout { margin-left: auto; }
  .topnav a.nav-signout::before { display: none; }

  .card { padding: 18px 16px; }
  .card.hero { padding: 24px 20px; }

  .page-head h1, .page-head h2 { font-size: 2rem; }
  h1 { font-size: 2.2rem; }

  .kpis, .kpis.k-3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .n { font-size: 2.1rem; }
  .rowlist .row { grid-template-columns: 1fr; gap: 6px; }
  .rowlist .row .n { text-align: left; }

  /* admin sub-nav: tabs strip runs edge to edge; "My time" in the top bar replaces "← My time" */
  .admin-nav { margin: -2px 0 20px; }
  .admin-nav a { padding: 11px 13px 10px; font-size: 0.94rem; }
  .admin-nav .spacer, .admin-nav a.admin-nav-back { display: none; }

  /* status filters fill the width, one tap target per option */
  .filter-bar { width: 100%; }
  .filter-bar .chip { flex: 1 1 auto; justify-content: center; padding-inline: 10px; }

  /* save bars: the primary fills the row; Cancel matches its height */
  .save-bar { padding: 10px 12px; gap: 10px; }
  .save-bar .save-btn { flex: 1 1 auto; min-height: 48px; }
  .save-bar .chip.outline { padding-inline: 20px; }

  /* in-card tables that scroll sideways: a soft shadow on the right edge while there's more to see
     (the 'local' cover rides at the end of the content and hides it once you reach it) */
  .card .table-wrap {
    background:
      linear-gradient(to left, var(--card) 40%, rgba(255, 255, 255, 0)) right / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 100% 50%, rgba(22, 21, 26, 0.16), rgba(22, 21, 26, 0)) right / 16px 100% no-repeat scroll;
  }

  .filter-form { padding: 12px 14px; width: 100%; }
  .filter-form label { flex: 1 1 140px; }
  .filter-form input, .filter-form select { min-width: 0; width: 100%; }
  .filter-form .form-actions { margin-left: 0; width: 100%; }

  .week-nav { width: 100%; justify-content: space-between; }
  .nav-btn { flex: 1; justify-content: center; }
  .week-nav:has(.month-pick) .nav-btn { flex: 0 0 auto; }
  .month-pick { flex: 1 1 auto; justify-content: center; }

  .msg-page { padding-top: 0; }
  .msg-card { padding: 26px 20px; }
  .msg-card h1 { font-size: 1.85rem; }

  .day-row { grid-template-columns: 1fr; }
  .day-label { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 14px 16px 0; }
  .day-hours { margin-top: 0; }
  .day-punches { padding: 6px 16px 12px; }
  .punch-line { flex-wrap: wrap; gap: 4px 10px; }
  .p-dept { min-width: auto; }
  .p-time { min-width: 72px; }
}

@media (max-width: 420px) {
  /* HR sees four nav items; keep "Sign out" whole down to 360px */
  .topnav { gap: 0; }
  .topnav a { padding: 8px 10px; font-size: 0.84rem; }
  .brand-sub { letter-spacing: 0.1em; }
  .clock { padding: 9px 12px; font-size: 0.9rem; }
  .kpis, .kpis.k-3, .kpis.k-2 { grid-template-columns: 1fr 1fr; }
}

/* Touch screens (phones, Teams mobile) and narrow windows: 44px minimum tap targets.
   Desktop mouse users keep the compact SLA sizes. */
@media (pointer: coarse), (max-width: 720px) {
  .topnav a, .admin-nav a, .filter-bar .chip, .nav-btn {
    min-height: 44px; display: inline-flex; align-items: center;
  }
  .icon-btn { width: 44px; height: 44px; }
  .add-link, a.row-go {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  table.data a.row-go { margin: -9px 0; vertical-align: middle; }   /* hit area overlaps the cell padding */
  .add-btn, .btn-primary, .save-btn { min-height: 44px; }
  a.brand { padding: 3px 0; margin: -3px 0; }   /* 44px hit area, same layout */
  .btn-compact, .add-btn.sm { min-height: 44px; padding-inline: 18px; }
  .mini-btn, .save-bar .chip.outline { min-height: 44px; }
  .month-pick input[type="month"] { min-height: 44px; }
  .filter-form input, .filter-form select,
  .hr-inline-edit input[type="time"], .hr-inline-edit select,
  .hr-add-form select, .hr-add-form input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
}
/* Fingers (phones, tablets): the main nav pills get 48px */
@media (pointer: coarse) {
  .topnav a { min-height: 48px; }
}

/* phones: Cancel in a save bar matches the 48px primary (after the touch rule above, which sets 44px) */
@media (max-width: 720px) {
  .save-bar .chip.outline { min-height: 48px; }
}

/* A fix waiting for approval (pending_fixes.py, macro punch_pending): amber, it counts in the totals until HR
   decides — [IN 8:30 AM] ADDED · WAITING FOR APPROVAL “why” Kathy's request · Oct 22  Review → */
.punch-why.is-pending .punch-why-tag { background: var(--amber-bg); color: var(--amber); }
.punch-why.is-pending .punch-why-what { color: var(--amber); }
.punch-why.is-pending .punch-why-what s { color: var(--muted); text-decoration-thickness: 1.5px; }
.punch-why-go { flex-shrink: 0; font-weight: 700; color: var(--pop-ink); white-space: nowrap; }
