/* ==========================================================================
   Flexiforce Time Machine — shared styles
   Brand: flexiforce.ie design system — teal #005F83, cyan #3FCAD4, orange
   #E98A3D, coral #EF7167 on cool neutrals; Plus Jakarta Sans.
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/plus-jakarta-sans.woff2') format('woff2');
}

:root {
  --brand:        #005F83;   /* Flexiforce primary teal      */
  --brand-deep:   #00485F;   /* darker teal for the bar      */
  --brand-bright: #1E7BA0;   /* lighter teal accent          */
  --cyan:         #3FCAD4;   /* Flexiforce cyan              */
  --cyan-deep:    #2FB3BD;
  --amber:        #E98A3D;   /* Flexiforce orange            */
  --amber-deep:   #D6772C;
  --amber-ink:    #3A2408;
  --coral:        #EF7167;   /* Flexiforce coral             */
  --coral-deep:   #E35A50;
  --coral-ink:    #FFFFFF;
  --coral-surface:#FDEBE9;

  --ink:          #253039;   /* cool slate charcoal          */
  --ink-soft:     #5E7079;   /* cool muted grey              */
  --paper:        #FFFFFF;
  --surface:      #F2F6F9;   /* cool off-white app background */
  --surface-2:    #F5F9FB;   /* cool very-light fill          */
  --raised:       #FFFFFF;
  --line:         rgba(0,95,131,0.13);
  --line-strong:  rgba(0,95,131,0.24);

  --success:      #1E7A4C;
  --success-surface: #E4F3EA;
  --warn:         #B4791A;
  --warn-surface: #FBEFD6;
  --danger:       #B23A2B;
  --danger-surface: #F8E7E2;

  --shadow-sm: 0 1px 2px rgba(15,40,55,0.05), 0 6px 20px -14px rgba(15,40,55,0.16);
  --shadow-lg: 0 18px 50px -20px rgba(15,40,55,0.35);
  --radius: 14px;
  --coral-panel: linear-gradient(176deg, #F0776C 0%, #E85C51 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:          #E7F1F4;
    --ink-soft:     #9DB6C0;
    --paper:        #0B222B;
    --surface:      #071A21;
    --surface-2:    #0E2A34;
    --raised:       #10303B;
    --line:         rgba(231,241,244,0.14);
    --line-strong:  rgba(231,241,244,0.26);
    --brand-deep:   #04222F;
    --success-surface: #123425;
    --warn-surface: #33280F;
    --danger-surface: #3A211C;
    --shadow-lg: 0 12px 40px -14px rgba(0,0,0,0.6);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); }
.opt { font-weight: 600; font-size: 11px; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }

/* --------------------------------------------------------- top bar ------ */
.topbar {
  background: var(--raised);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { display: inline-flex; flex-direction: column; align-items: flex-start; text-decoration: none; }
.topbar .brand-logo-c { height: 30px; width: auto; display: block; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  padding-left: 13px;
  margin-left: 1px;
  border-left: 1px solid rgba(255,255,255,0.28);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { text-align: right; line-height: 1.15; }
.who .name { font-size: 13.5px; font-weight: 700; color: #fff; }
.who .role { font-size: 11.5px; color: rgba(255,255,255,0.72); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--amber); color: var(--amber-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; flex: none;
}
.icon-btn {
  display: inline-flex; align-items: center; text-decoration: none;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff; border-radius: 10px;
  height: 38px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.18); }

/* ------------------------------------------------------- app column ----- */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}
/* The grid and cards fill the wide page; keep the total bar and the send
   button to a comfortable centred width so they don't stretch edge to edge. */
.wrap .ts-total,
.wrap #send-card,
.wrap .ts-breakdown { max-width: 640px; margin-left: auto; margin-right: auto; }
.greeting { margin: 4px 2px 18px; }
.greeting h1 {
  font-size: 25px; font-weight: 800; margin: 0 0 3px;
  letter-spacing: -0.01em;
}
.greeting .date { color: var(--ink-soft); font-size: 14px; font-weight: 600; }

.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 16px;
}
.card-eyebrow {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--ink-soft);
  margin: 0 0 12px;
}

/* -------------------------------------------------- today's shift ------- */
.shift-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shift-site { font-size: 18px; font-weight: 800; margin: 0 0 2px; }
.shift-role { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.shift-meta {
  display: flex; gap: 20px; margin-top: 14px;
  padding-top: 14px; border-top: 1px dashed var(--line-strong);
}
.shift-meta .m-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.shift-meta .m-value { font-size: 15px; font-weight: 700; margin-top: 3px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.scheduled { color: var(--ink-soft); background: var(--surface-2); border-color: var(--line); }
.pill.on-shift  { color: var(--success); background: var(--success-surface); }
.pill.on-break  { color: var(--warn);    background: var(--warn-surface); }
.pill.finished  { color: var(--brand);   background: rgba(0,95,131,0.10); }
.pill.rejected  { color: var(--danger);  background: var(--danger-surface); }

/* consistent loading spinner (used by every page's #loading) */
.ld { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-weight: 700; font-size: 13.5px; }
.ld .spin { width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--brand); animation: ldspin .7s linear infinite; flex: none; }
@keyframes ldspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ld .spin { animation: none; } }

/* ----------------------------------------------------- the punch -------- */
.punch-card { text-align: center; padding: 26px 18px 24px; }
.punch-timer {
  font-variant-numeric: tabular-nums;
  font-size: 40px; font-weight: 800; letter-spacing: 0.01em;
  line-height: 1; margin: 2px 0 4px; color: var(--ink);
}
.punch-timer.idle { color: var(--ink-soft); opacity: 0.5; }
.punch-since { font-size: 13px; font-weight: 600; color: var(--ink-soft); min-height: 18px; }

.punch {
  position: relative;
  width: 208px; height: 208px; border-radius: 50%;
  margin: 20px auto 8px;
  border: none; cursor: pointer;
  display: grid; place-items: center; gap: 0;
  color: #fff; font: inherit;
  box-shadow: var(--shadow-lg);
  transition: transform .12s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.punch:active { transform: scale(0.96); }
.punch .p-action { font-size: 26px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.05; }
.punch .p-sub { font-size: 12.5px; font-weight: 600; opacity: 0.9; margin-top: 6px; max-width: 150px; }
.punch .p-icon { font-size: 30px; margin-bottom: 6px; line-height: 1; }

/* state = ready to clock in → amber "go" */
.punch.to-in {
  background: radial-gradient(120% 120% at 50% 25%, #F4A85A 0%, var(--amber) 45%, var(--amber-deep) 100%);
  color: var(--amber-ink);
}
.punch.to-in .p-sub { opacity: 0.78; }
/* pulsing invite ring */
.punch.to-in::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid var(--amber);
  animation: pulse 2s ease-out infinite; opacity: 0;
}
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(1.18); opacity: 0; }
}
/* state = on shift → teal "clock out" */
.punch.to-out {
  background: radial-gradient(120% 120% at 50% 25%, var(--brand-bright) 0%, var(--brand) 55%, var(--brand-deep) 100%);
  color: #fff;
}
/* state = finished → calm, disabled */
.punch.done {
  background: var(--surface-2);
  color: var(--success);
  box-shadow: none;
  border: 2px solid var(--success);
  cursor: default;
}
.punch.done:active { transform: none; }

.break-btn {
  margin-top: 6px;
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 11px 22px;
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.break-btn:hover { background: var(--surface-2); }
.break-btn.ending { border-color: var(--amber-deep); color: var(--warn); background: var(--warn-surface); }
.break-btn[hidden] { display: none; }

.finished-note {
  margin: 14px auto 0; max-width: 300px;
  font-size: 13.5px; font-weight: 600; color: var(--success);
  line-height: 1.45;
}

/* ---------------------------------------------------- activity log ------ */
.log-list { list-style: none; margin: 0; padding: 0; }
.log-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.log-row:last-child { border-bottom: none; }
.log-ic {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.log-ic.in   { background: var(--success-surface); color: var(--success); }
.log-ic.out  { background: rgba(0,95,131,0.10); color: var(--brand); }
.log-ic.brk  { background: var(--warn-surface); color: var(--warn); }
.log-label { font-weight: 700; font-size: 14.5px; }
.log-time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14.5px; }
.log-empty { color: var(--ink-soft); font-size: 14px; padding: 6px 0 2px; }

.log-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--line-strong);
}
.log-total .t-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.log-total .t-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- week --------- */
.week-list { list-style: none; margin: 0; padding: 0; }
.week-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.week-row:last-child { border-bottom: none; }
.week-day {
  width: 46px; flex: none; text-align: center;
}
.week-day .dow { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--ink-soft); letter-spacing: 0.04em; }
.week-day .dom { font-size: 19px; font-weight: 800; line-height: 1; margin-top: 1px; }
.week-row.today .week-day .dom { color: var(--amber-deep); }
.week-info { min-width: 0; }
.week-info .w-site { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-info .w-time { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 1px; }
.week-row .pill { margin-left: auto; }
.week-row.rest .week-info .w-site { color: var(--ink-soft); font-weight: 600; }

.site-foot {
  text-align: center; color: var(--ink-soft);
  font-size: 12px; padding: 18px 0 8px;
}

/* ===================================================== timesheet ======== */
.ts-summary .shift-site { font-size: 17px; }
.ts-weekref { font-size: 13.5px; color: var(--ink-soft); font-weight: 700; }

.ts-day {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}
.ts-day:last-of-type { border-bottom: none; }
.ts-day-head { display: flex; align-items: center; gap: 10px; }
.ts-day-name { font-weight: 800; font-size: 15px; }
.ts-day-date { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; }
.ts-day-hours {
  margin-left: auto; font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.ts-day.off .ts-day-hours { color: var(--ink-soft); }
.off-toggle {
  border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-soft); border-radius: 999px;
  font: inherit; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.off-toggle:hover { background: var(--surface-2); }
.ts-day.off .off-toggle { background: var(--brand); color: #fff; border-color: var(--brand); }

.ts-inputs {
  display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px;
  margin-top: 11px;
}
.ts-field { min-width: 0; }
.ts-field label {
  display: block; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 5px;
}
.ts-field input[type="time"],
.ts-field select {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 15px; font-weight: 700;
  color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line-strong); border-radius: 10px;
  padding: 9px 8px; height: 42px;
  -webkit-appearance: none; appearance: none;
}
.ts-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235E7079' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 24px;
}
.ts-field input:focus, .ts-field select:focus { border-color: var(--brand); outline: none; }
.ts-day.off .ts-inputs { opacity: 0.4; pointer-events: none; }
.ts-day.off .ts-inputs input, .ts-day.off .ts-inputs select { background: var(--surface); }

.ts-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px; margin-top: 2px;
  background: var(--brand); color: #fff;
  border-radius: var(--radius);
}
.ts-total .tt-label { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.ts-total .tt-value { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ts-total .tt-value small { font-size: 15px; font-weight: 700; opacity: 0.85; margin-left: 3px; }

.ts-note textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px;
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 11px 12px;
}
.ts-note textarea:focus { border-color: var(--brand); outline: none; }

.btn-send {
  display: block; width: 100%; margin-top: 6px;
  background: var(--brand);
  color: #fff; border: none; border-radius: 11px;
  font: inherit; font-size: 16px; font-weight: 800;
  padding: 15px; cursor: pointer;
}
.btn-send:hover { background: var(--brand-deep); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }
.send-hint { text-align: center; font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 10px; }

/* inline confirm bar */
.confirm-bar { text-align: center; }
.confirm-bar p { font-size: 14.5px; font-weight: 700; margin: 0 0 12px; }
.confirm-bar .row { display: flex; gap: 10px; }
.confirm-bar .btn-send { margin-top: 0; flex: 1.4; }
.btn-cancel {
  flex: 1; background: transparent; border: 1.5px solid var(--line-strong);
  color: var(--ink); border-radius: 14px; font: inherit; font-size: 15px; font-weight: 700;
  padding: 16px 12px; cursor: pointer;
}
.btn-cancel:hover { background: var(--surface-2); }

/* sent / locked state */
.sent-box { text-align: center; padding: 6px 4px 2px; }
.sent-check {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--success-surface); color: var(--success);
  display: grid; place-items: center; font-size: 26px; font-weight: 800;
}
.sent-box h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.sent-box p { margin: 0 auto; max-width: 300px; font-size: 14px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }
.sent-box .edit-link {
  display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 700;
  color: var(--brand); background: none; border: none; cursor: pointer; text-decoration: underline;
}
.locked-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
}

.ts-field input[type="number"] {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; font-weight: 700;
  color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line-strong); border-radius: 10px;
  padding: 9px 8px; height: 42px; -webkit-appearance: none; appearance: none;
}
.ts-field input[type="number"]:focus { border-color: var(--brand); outline: none; }

.ts-standard {
  margin-top: 9px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.ts-standard b { color: var(--brand); font-weight: 800; }

.extras-toggle {
  margin-top: 10px; background: none; border: none; cursor: pointer;
  color: var(--brand); font: inherit; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 0;
}
.extras-toggle .chev { transition: transform .15s ease; display: inline-block; font-size: 10px; }
.extras-toggle.open .chev { transform: rotate(90deg); }

.ts-extras { margin-top: 12px; padding-top: 13px; border-top: 1px dashed var(--line-strong); }
.ts-extras[hidden] { display: none; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.ex-full { grid-column: 1 / -1; }
.ex-ot { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; }

.extras-chip {
  margin-left: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--warn); background: var(--warn-surface); border-radius: 999px; padding: 3px 9px;
  white-space: nowrap;
}

.ts-breakdown { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 2px 0; }
.bd-chip {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.bd-chip b { color: var(--ink); font-weight: 800; }

.info-line {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--warn-surface); border: 1px solid rgba(180,121,26,0.25);
  border-radius: 12px; padding: 11px 13px; margin-bottom: 16px;
  font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.45;
}
.info-line .i-badge { font-weight: 800; color: var(--warn); flex: none; }

/* ---- weekly grid: days across the top, fields down the side (worker + edit) ---- */
.grid-hint { display: none; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 0 0 10px; }
.ts-week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 6px -2px 0; }
.ts-week { border-collapse: collapse; width: 100%; min-width: 812px; table-layout: fixed; }
.ts-week thead th {
  text-align: center; padding: 2px 5px 10px; white-space: nowrap;
  border-bottom: 1.5px solid var(--line-strong); background: var(--raised);
}
.ts-week thead th .wd { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); }
.ts-week thead th .wdate { display: block; font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-top: 1px; }
.ts-week .c-lab {
  position: sticky; left: 0; z-index: 1; background: var(--raised);
  width: 96px; min-width: 96px; text-align: left; white-space: nowrap;
  padding: 8px 12px 8px 2px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 800; color: var(--ink-soft);
  box-shadow: 1px 0 0 var(--line);
}
.ts-week tbody tr { border-bottom: 1px solid var(--line); }
.ts-week td { padding: 5px; text-align: center; vertical-align: middle; }
.ts-week input[type="time"], .ts-week select, .ts-week input[type="number"] {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line-strong);
  border-radius: 9px; padding: 7px 6px; height: 38px; text-align: center;
  -webkit-appearance: none; appearance: none;
}
.ts-week select {
  text-align: left; padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235E7079' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center;
}
.ts-week input:focus, .ts-week select:focus { border-color: var(--brand); outline: none; }
.ts-week .otc { display: flex; gap: 4px; }
.ts-week .otc input { min-width: 0; }
.ts-week .otc select { width: 50px; flex: none; padding-right: 15px; }
.ts-week tfoot .c-lab { color: var(--brand); }
.ts-week tfoot td { padding-top: 9px; border-top: 2px solid var(--line-strong); }
.ts-week tfoot td b { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ts-week [disabled] { opacity: 0.55; }

/* ---------------------------- manager's read-only week strip ------------ */
.wk-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 4px; }
.wk { width: 100%; border-collapse: collapse; min-width: 430px; }
.wk th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800;
  color: var(--ink-soft); padding: 6px 4px; text-align: center; border-bottom: 1.5px solid var(--line-strong);
}
.wk td {
  text-align: center; padding: 12px 4px 11px; font-weight: 800; font-size: 15px;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.wk td.rest { color: var(--ink-soft); font-weight: 600; }
.wk th.tot, .wk td.tot { border-left: 1px solid var(--line); }
.wk td.tot { color: var(--brand); }
.wk-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); vertical-align: super; margin-left: 2px; }
.wk-legend { margin-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.wk-legend .wk-dot { vertical-align: baseline; margin: 0; }

@media (max-width: 820px) { .grid-hint { display: block; } }

/* ---------------------------- timesheet records / archive --------------- */
.rec-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.rc-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.rc-field.rc-grow { flex: 1 1 200px; }
.rc-field label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.rc-field select, .rc-field input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  background: var(--raised); border: 1.5px solid var(--line-strong); border-radius: 10px;
  padding: 9px 10px; height: 42px; -webkit-appearance: none; appearance: none;
}
.rc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%235E7079' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 26px;
}
.rc-field select:focus, .rc-field input:focus { border-color: var(--brand); outline: none; }
.rec-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 2px 2px 14px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.rec-summary #count-label { color: var(--ink); font-weight: 800; }
.rec-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; }
.rec-meta span { color: var(--ink); font-weight: 700; }
.rec-meta b { color: var(--ink-soft); font-weight: 800; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; margin-right: 5px; }

/* ---------------------------- sick cert upload -------------------------- */
.cert-hint { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.45; }
.cert-drop {
  display: block; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: 12px;
  padding: 16px; font-size: 14px; font-weight: 700; color: var(--brand); background: var(--surface-2);
}
.cert-drop:hover { border-color: var(--coral); color: var(--coral-deep); }
.cert-status { margin-top: 12px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cert-ok { color: var(--success); font-weight: 800; }
.cert-none { color: var(--ink-soft); font-weight: 600; }
.cert-link { background: none; border: none; padding: 0; font: inherit; font-weight: 800; color: var(--brand); cursor: pointer; text-decoration: underline; }
.cert-remove { color: var(--danger); }
.cert-drop:hover { border-color: var(--brand); color: var(--brand-deep); }

/* ---------------------------- worker documents ------------------------- */
.doc-hint { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.doc-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.doc-form .rc-field { flex: 1 1 190px; }
.doc-empty { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 0; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.doc-row:first-child { border-top: none; }
.doc-id { min-width: 0; }
.doc-nm { font-weight: 800; font-size: 14px; }
.doc-sub { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.doc-right { display: flex; align-items: center; gap: 10px 12px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.doc-exp { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.pe-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.pe-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 8px; }
.jury-form { margin-top: 12px; }

/* ---------------------------- payroll-status roster (who to chase) ------ */
.chase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.chase-count { font-size: 13px; font-weight: 800; color: var(--coral-deep); white-space: nowrap; }
.chase-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.cchip { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.chase-list { margin-top: 6px; }
.chase-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--line); }
.chase-right { display: flex; align-items: center; gap: 8px; flex: none; }
.chase-nm { font-weight: 800; font-size: 14px; min-width: 0; }
.chase-co { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.cbadge { font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 4px 11px; white-space: nowrap; flex: none; }
.cm-missing  { color: var(--danger);     background: var(--danger-surface); }
.cm-rejected { color: var(--coral-deep); background: var(--coral-surface); }
.cm-draft    { color: var(--ink-soft);   background: var(--surface-2); }
.cm-awaiting { color: var(--warn);       background: var(--warn-surface); }
.cm-approved { color: var(--success);    background: var(--success-surface); }
/* grouped by manager */
.mgr-groups { margin-top: 6px; }
.mgr-group { border-top: 1px solid var(--line); }
.mgr-group:first-child { border-top: none; }
.mgr-head { display: flex; align-items: center; gap: 12px; padding: 13px 2px; cursor: pointer; }
.mgr-head .chev-r { transition: transform .15s ease; font-size: 11px; color: var(--ink-soft); flex: none; display: inline-block; }
.mgr-group.open .mgr-head .chev-r { transform: rotate(90deg); }
.mgr-id { flex: 1; min-width: 0; }
.mgr-name { font-weight: 800; font-size: 14.5px; }
.mgr-sub { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 1px; }
.mgr-count { font-size: 13px; font-weight: 800; color: var(--coral-deep); white-space: nowrap; flex: none; }
.mgr-count.ok { color: var(--success); }
.mgr-team { padding: 0 0 8px 26px; }
.mgr-team[hidden] { display: none; }
.mgr-team .chase-row:first-child { border-top: none; }
.btn-remind { flex: none; margin-left: 12px; font: inherit; font-size: 12px; font-weight: 800; letter-spacing: 0.01em;
  color: var(--brand); background: var(--surface-2); border: none; box-shadow: inset 0 0 0 1.5px var(--line-strong);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.btn-remind:hover { box-shadow: inset 0 0 0 1.5px var(--brand); background: rgba(0,95,131,0.08); }
.btn-remind:disabled { opacity: 0.55; cursor: default; }
.remind-done { flex: none; margin-left: 12px; font-size: 12px; font-weight: 800; color: var(--success); white-space: nowrap; }

/* approvals-by-team summary (Approvals page, Flexiforce/admin oversight) */
.team-card { margin-bottom: 18px; }
.team-rows .chase-row:first-child { border-top: none; }
.team-id { min-width: 0; }
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.team-right { display: flex; align-items: center; flex: none; }

/* ============================================== manager approval ======== */
.appr-summary { display: flex; gap: 10px; margin-bottom: 18px; }
.appr-stat {
  flex: 1; background: var(--raised); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 10px; text-align: center; box-shadow: var(--shadow-sm);
}
.appr-stat .n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.appr-stat .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin-top: 6px; }
.appr-stat.awaiting .n { color: var(--warn); }
.appr-stat.approved .n { color: var(--success); }

.person { padding: 16px; }
.person-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.person-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
}
.person-id { min-width: 0; }
.person-name { font-weight: 800; font-size: 15.5px; }
.person-role { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.person-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.person-hrs { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.person-hrs small { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.person .chev-r { transition: transform .15s ease; display: inline-block; font-size: 11px; color: var(--ink-soft); margin-left: 2px; }
.person.open .chev-r { transform: rotate(90deg); }

.person-detail { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.person-detail[hidden] { display: none; }
.person.done { opacity: 0.72; }

.mini { width: 100%; border-collapse: collapse; }
.mini th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-weight: 800; padding: 5px 4px; }
.mini td { font-size: 13.5px; font-weight: 600; padding: 8px 4px; border-top: 1px solid var(--line); color: var(--ink); }
.mini td.day { font-weight: 800; width: 42px; }
.mini td.hrs { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini td.rest { color: var(--ink-soft); font-weight: 600; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.tag.std { color: var(--ink-soft); background: var(--surface-2); }
.tag.bh  { color: var(--warn); background: var(--warn-surface); }
.tag.ot  { color: var(--brand); background: rgba(0,95,131,0.10); }
.tag.hol { color: var(--success); background: var(--success-surface); }
.tag.lieu{ color: var(--danger); background: var(--danger-surface); }

.mini tfoot td { border-top: 2px solid var(--line-strong); font-weight: 800; font-size: 14.5px; padding-top: 10px; }

.person-note {
  margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px; line-height: 1.45;
}
.person-note b { color: var(--ink); }

.appr-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-approve {
  flex: 1.5; background: var(--success); color: #fff; border: none;
  border-radius: 13px; font: inherit; font-size: 16px; font-weight: 800;
  padding: 14px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn-approve:hover { filter: brightness(1.05); }
.btn-query {
  flex: 1; background: transparent; border: 1.5px solid var(--line-strong);
  color: var(--ink); border-radius: 13px; font: inherit; font-size: 14.5px; font-weight: 700;
  padding: 14px 10px; cursor: pointer;
}
.btn-query:hover { background: var(--surface-2); }

.approved-flag {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  color: var(--success); font-size: 13.5px; font-weight: 700;
}
.approved-flag .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--success-surface); display: grid; place-items: center; font-size: 12px; }

.query-box { margin-top: 14px; }
.query-box textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px;
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px 12px;
}
.query-box textarea:focus { border-color: var(--brand); outline: none; }

.waiting-line { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }

/* commission + manager edit */
.commission-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.commission-box label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 7px; }
.commission-box .cwrap { display: flex; align-items: center; gap: 9px; }
.commission-box .euro { font-weight: 800; font-size: 17px; color: var(--ink-soft); }
.commission-box input {
  width: 150px; box-sizing: border-box; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 9px 11px;
}
.commission-box input:focus { border-color: var(--brand); outline: none; }
.commission-box .saved { font-size: 12.5px; font-weight: 700; color: var(--success); }
.ts-edit-actions { display: flex; gap: 10px; margin-top: 16px; }
.ts-edit-actions .btn-approve { background: var(--brand); }
.edit-total { margin-top: 14px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.edit-total .tt-value { font-size: 20px; font-variant-numeric: tabular-nums; }

/* manager review controls (pick week / filter / approve all) */
.ts-controls { display: flex; gap: 10px; margin-bottom: 14px; }
.ts-controls[hidden] { display: none; }
.ts-controls .ctrl { flex: 1; min-width: 0; }
.ts-controls label { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 6px; }
.ts-controls select {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  background: var(--raised); border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px 11px;
}
.ts-controls select:focus { border-color: var(--brand); outline: none; }
#approve-all { margin-bottom: 16px; }
#approve-all[hidden] { display: none; }

/* ============================================ app shell · top nav ======== */
.topnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  background: var(--raised); border-bottom: 1px solid var(--line);
  padding: 0 24px; height: 64px;
}
.tn-brand { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: none; text-decoration: none; }
.tn-logo { height: 30px; width: auto; display: block; }
/* the primary logo's four-colour underline, aligned under the wordmark */
.brand-underline { display: block; height: 3px; width: 88px; margin: 3.5px 0 0 32px; border-radius: 2px;
  background: linear-gradient(to right,
    var(--brand) 0 21%, transparent 21% 26.5%, var(--cyan) 26.5% 47.5%, transparent 47.5% 53%,
    var(--amber) 53% 74%, transparent 74% 79.5%, var(--coral) 79.5% 100%); }
.tn-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tn-nav::-webkit-scrollbar { display: none; }
.tn-link {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14.5px;
  padding: 21px 13px 19px; border-bottom: 2.5px solid transparent; white-space: nowrap;
  transition: color .12s ease, border-color .12s ease;
}
.tn-link:hover { color: var(--ink); }
.tn-link.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 800; }
.tn-right { display: flex; align-items: center; gap: 12px; flex: none; }
.tn-who { text-align: right; line-height: 1.15; }
.tn-name { font-size: 13.5px; font-weight: 800; }
.tn-role { font-size: 11.5px; color: var(--ink-soft); }
.tn-av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.tn-signout { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); border-radius: 9px; padding: 8px 13px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .12s ease; }
.tn-signout:hover { background: var(--surface-2); }
.tn-changepw { color: var(--ink-soft); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.tn-changepw:hover { color: var(--brand); text-decoration: underline; }
.tn-burger, .tn-backdrop, .tn-sheet { display: none; }

@media (max-width: 860px) {
  .topnav { gap: 12px; padding: 0 16px; }
  .tn-nav, .tn-who, .tn-signout, .tn-changepw { display: none; }
  .tn-right { margin-left: auto; }
  .tn-burger {
    display: grid; place-items: center; background: var(--surface-2);
    border: 1px solid var(--line-strong); color: var(--ink); border-radius: 9px;
    width: 40px; height: 40px; font-size: 18px; cursor: pointer; padding: 0;
  }
  .tn-backdrop.show { display: block; position: fixed; inset: 64px 0 0; background: rgba(6,20,28,.4); z-index: 38; }
  .tn-sheet {
    display: block; position: fixed; top: 64px; left: 0; right: 0; z-index: 39;
    background: var(--raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    padding: 8px; transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }
  .tn-sheet.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .tn-sheet-nav { display: flex; flex-direction: column; }
  .tn-sheet .tn-link { border-bottom: none; padding: 13px 14px; border-radius: 9px; }
  .tn-sheet .tn-link.active { background: rgba(0,95,131,.09); color: var(--brand); }
  .tn-signout-m { width: calc(100% - 16px); margin: 6px 8px 8px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); border-radius: 9px; padding: 12px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
}

@media (max-width: 420px) {
  .greeting h1 { font-size: 22px; }
  .brand-tag { display: none; }
  .ts-field input[type="time"], .ts-field select, .ts-field input[type="number"] { font-size: 14px; padding: 9px 6px; }
}
