:root {
  --navy: #13233d;
  --navy-2: #1f3a5f;
  --gold: #b8923f;
  --gold-hover: #a17f36;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e5ea;
  --text: #1b2430;
  --text-2: #5b6472;
  --open: #2f5fa8;
  --filled: #2e7d5b;
  --completed: #5b6472;
  --warn: #b3432f;
  --night-bg: #1e1b4b;     /* night shift card - deep indigo, reads as a dark card among white ones */
  --night-bar: #818cf8;    /* bright periwinkle left bar */
  --night-text: #f1f2ff;
  --night-meta: #c7cbf5;
  --night-line: #3a3675;
  --night-badge: #c7d2fe;  /* light badge on dark card */
  --radius: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
/* min-height, not height: with a fixed height the light background stopped after the first screen and the dark
   html background showed below the cards on longer pages */
body {
  min-height: 100%;
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 700; }
p { margin: 0 0 8px; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 13px 18px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity .12s;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--gold); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-danger { background: #fff; color: var(--warn); border-color: var(--warn); }
.btn-logout { background: #fff; color: var(--text-2); border-color: var(--border); margin-top: 22px; }
.btn-logout:active { color: var(--warn); border-color: var(--warn); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--navy-2); }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; min-width: 0; margin-bottom: 12px; }
.field-hint { font-size: 11.5px; color: var(--text-2); margin: 0 0 12px; line-height: 1.4; }
.field-hint-strong { color: var(--text); font-weight: 600; font-size: 12px; }
.field-notice {
  font-size: 11.5px; color: var(--text-2); background: var(--bg); border-radius: 8px;
  padding: 9px 11px; margin-bottom: 12px; line-height: 1.4;
}
.field-divider { height: 1px; background: var(--border); margin: 14px 0; }
.checkbox-line {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500;
  color: var(--text); margin-bottom: 12px; cursor: pointer;
}
.checkbox-line input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); flex-shrink: 0; }
.error-msg { background: #fdeceb; color: var(--warn); border: 1px solid #f5c8c1; border-radius: var(--radius); padding: 12px 14px; font-size: 13px; margin-bottom: 16px; }
.info-msg { background: #fdf6e7; color: #7a5a17; border: 1px solid #ecd9a8; border-radius: var(--radius); padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.4; }

/* ---------- SMS code sign-in ---------- */
.otp-sent-to { font-size: 13px; color: var(--text-2); text-align: center; margin: 0 0 14px; line-height: 1.4; }
.otp-sent-to b { color: var(--text); }
.field input.otp-input { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 10px; padding: 12px 8px; font-variant-numeric: tabular-nums; }
.otp-links { display: flex; justify-content: space-between; margin-top: 14px; }
.link-btn { background: none; border: 0; padding: 4px 0; font-size: 13px; font-weight: 600; color: var(--navy-2); cursor: pointer; }
.link-btn:disabled { color: var(--text-2); font-weight: 500; cursor: default; }
.otp-blocked { text-align: center; background: #fdeceb; border: 1px solid #f5c8c1; border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; }
.otp-blocked-icon { font-size: 26px; margin-bottom: 4px; }
.otp-blocked h2 { font-size: 16px; color: var(--warn); margin: 0 0 6px; }
.otp-blocked p { font-size: 13px; color: var(--text); margin: 0 0 4px; line-height: 1.4; }

/* ---------- Login screen ---------- */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy), var(--navy-2)); padding: 24px; }
.auth-box { background: #fff; border-radius: 16px; padding: 32px 26px; width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand .brand-mark { width: 68px; height: 68px; margin: 0 auto 14px; display: block; object-fit: contain; }
.brand h1 { font-size: 20px; color: var(--navy); }
.brand p { color: var(--text-2); font-size: 13px; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; padding-bottom: 64px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  padding-top: max(14px, env(safe-area-inset-top));
}
.topbar h2 { font-size: 17px; color: #fff; }
.main-content { flex: 1; padding: 16px; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.15); border: none;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

.bell-wrap { position: relative; }
.bell-btn { background: none; border: none; cursor: pointer; padding: 6px; color: #fff; position: relative; }
.bell-dot { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: #e2574c; border: 2px solid var(--navy); }

/* ---------- Offline sync ---------- */
.sync-wrap { position: relative; }
.sync-btn { background: none; border: none; cursor: pointer; padding: 6px; color: #fff; position: relative; display: flex; align-items: center; }
.sync-btn.spinning svg { animation: sync-spin 1s linear infinite; }
@keyframes sync-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sync-dot {
  position: absolute; top: 0; right: -2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 20px;
  background: var(--gold); color: var(--navy); border: 2px solid var(--navy); font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.offline-banner {
  background: #3a2a12; color: #f5d9a8; font-size: 12px; font-weight: 600; text-align: center;
  padding: 8px 14px; line-height: 1.4;
}
.offline-cache-notice {
  background: var(--bg); color: var(--text-2); font-size: 11.5px; font-weight: 600; border-radius: var(--radius);
  padding: 9px 12px; margin-bottom: 10px;
}
.pill-pending { background: #fdf1de; color: #8a6215; }

.notif-panel {
  position: fixed; top: 58px; right: 10px; left: 10px; max-height: 70vh; overflow-y: auto;
  background: #fff; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50;
}
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-panel-head h4 { font-size: 14.5px; }
.notif-item { padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f8f9fc; }
.notif-item .title { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.notif-item .body { font-size: 12.5px; color: var(--text-2); }
.notif-item .time { font-size: 11px; color: #9aa3b0; margin-top: 5px; }
.notif-empty { padding: 34px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
.notif-panel-foot { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }

/* ---------- Notifications page (received-only) ---------- */
.notif-list-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.btn-link { background: none; border: none; color: var(--open); cursor: pointer; padding: 0; font-weight: 700; font-size: 12.5px; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--border); display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 0 8px; color: var(--text-2); cursor: pointer; font-size: 10.5px; font-weight: 700;
}
.tabbar-item.active { color: var(--navy); }
.tabbar-item svg { width: 22px; height: 22px; }
.tabbar-item.active svg { stroke: var(--gold); }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.section-title { font-size: 12.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 8px; }
.section-title:first-child { margin-top: 0; }

/* ---------- iOS "Add to Home Screen" install banner + walkthrough ---------- */
.install-banner {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  background: #fbf1e2; border: 1px solid #e8cf9f; border-radius: var(--radius); padding: 14px 34px 14px 14px; margin-bottom: 16px;
}
.install-banner-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.install-banner-body strong { display: block; font-size: 13.5px; color: var(--navy); margin-bottom: 3px; }
.install-banner-body p { font-size: 12.5px; color: var(--text-2); margin: 0 0 8px; line-height: 1.4; }
.install-banner-close {
  position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 18px;
  line-height: 1; color: var(--text-2); cursor: pointer; padding: 4px;
}
.install-step { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.install-step:last-of-type { border-bottom: none; }
.install-step-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff;
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.install-step-body { flex: 1; min-width: 0; }
.install-step-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.install-step-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.install-step-icon { color: var(--navy); flex-shrink: 0; }

.greeting-card { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.greeting-card h3 { font-size: 19px; color: #fff; }
.greeting-card p { color: rgba(255,255,255,.75); font-size: 13px; margin-bottom: 0; }
.greeting-stat { display: flex; gap: 20px; margin-top: 14px; }
.greeting-stat .num { font-size: 24px; font-weight: 800; }
.greeting-stat .lbl { font-size: 11px; color: rgba(255,255,255,.7); }

.job-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; transition: background-color .3s, box-shadow .3s; }
/* Briefly flashed on the shift a tapped notification deep-links to, so it's obvious which one it meant. */
.job-item.notif-highlight { background-color: #fdf6e8; box-shadow: 0 0 0 2px var(--gold); }
/* Already started (or starting within 2h) - emergency/last-minute cover, so it needs to stand out. */
.job-item.urgent { background-color: #fdeceb; box-shadow: 0 0 0 2px var(--warn); }
/* Night shift - dark indigo card with a bright left bar, clearly different from white day cards.
   Urgent / notif-highlight keep their coloured ring on top of the dark card. */
.job-item.night {
  background-color: var(--night-bg); color: var(--night-text); border-color: var(--night-bg);
  background-image: linear-gradient(var(--night-bar), var(--night-bar));
  background-repeat: no-repeat; background-size: 5px 100%; background-position: left top;
}
.job-item.night h4 { color: var(--night-text); }
.job-item.night .meta { color: var(--night-meta); }
.job-item.night.urgent { background-color: var(--night-bg); box-shadow: 0 0 0 2px var(--warn); }
.job-item.night.notif-highlight { background-color: var(--night-bg); box-shadow: 0 0 0 2px var(--gold); }
.job-item h4 { font-size: 14.5px; }
.job-item .meta { font-size: 12.5px; color: var(--text-2); margin: 3px 0 8px; }
.job-item .job-address { display: flex; align-items: flex-start; gap: 4px; margin-top: 3px; font-size: 12.5px; line-height: 1.35; color: var(--navy-2); text-decoration: none; }
.job-item .job-address:active { text-decoration: underline; }
.job-item .job-address-pin { font-size: 11px; line-height: 1.5; flex-shrink: 0; }
.job-item.night .job-address { color: var(--night-meta); }
.job-item .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-item .pills { display: flex; gap: 4px; flex-wrap: wrap; }
.job-item .apply-options { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--text-2); }
.pill-applied { background: #eef3fa; color: var(--open); }
.pill-urgent { background: var(--warn); color: #fff; }
.pill-night { background: var(--night-badge); color: var(--night-bg); }
.cancel-link { display: block; margin-top: 10px; font-size: 12px; color: var(--warn); }
.cancel-pending {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); line-height: 1.4;
}
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-2); font-size: 13.5px; }

/* ---------- Availability calendar ---------- */
.cal-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-controls button { background: none; border: none; font-size: 20px; color: var(--navy); padding: 6px 12px; cursor: pointer; }
.cal-controls h4 { font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: 10.5px; color: var(--text-2); font-weight: 700; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px;
  font-size: 13px; cursor: pointer; background: #fff; border: 1px solid var(--border); position: relative;
}
.cal-day.empty { border: none; cursor: default; }
.cal-day.past { color: #c3c9d1; cursor: default; }
.cal-day { flex-direction: column; gap: 1px; line-height: 1.1; }
.cal-day .cal-tag { font-size: 8.5px; font-weight: 800; letter-spacing: .02em; }
.cal-day.locked { cursor: default; opacity: 0.7; }
.cal-day.locked::after {
  content: '\1F512'; position: absolute; bottom: 1px; right: 2px; font-size: 7px; line-height: 1;
}
.avail-legend { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.avail-legend span { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.type-picker-title { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 14px 0 8px; }
.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-chip {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 54px; padding: 8px 6px; border-radius: var(--radius); border: 1.5px solid var(--chip-border);
  background: #fff; color: var(--chip-fg); font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer;
}
.type-chip small { font-size: 10.5px; font-weight: 500; opacity: .85; }
.type-chip.on { background: var(--chip-bg); box-shadow: inset 0 0 0 1.5px var(--chip-border); }
.type-chip-check {
  position: absolute; top: 4px; right: 5px; width: 15px; height: 15px; border-radius: 50%; font-size: 10px; line-height: 15px;
  border: 1.5px solid var(--chip-border); background: #fff; color: #fff; text-align: center;
}
.type-chip.on .type-chip-check { background: var(--chip-border); }
.type-picker-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.type-picker-actions #availRemoveBtn { margin-right: auto; }

/* ---------- Timesheet ---------- */
/* ---------- Timesheet: List Duty (grouped by care home + week) ---------- */
/* ---------- Timesheet: List Duty (grouped by care home + week) ---------- */
.ts-filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ts-filter-bar select {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text); font-size: 13px;
}
.ts-filter-clear { font-size: 12px; color: var(--warn); white-space: nowrap; cursor: pointer; }
.ts-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.ts-pagination span { font-size: 12.5px; color: var(--text-2); }

.duty-group-list { display: flex; flex-direction: column; gap: 10px; }
.duty-group-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.duty-group-top { display: flex; align-items: flex-start; justify-content: space-between; }
.duty-group-home { font-size: 14px; font-weight: 700; color: var(--text); }
.duty-group-range { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.duty-group-hours { font-size: 18px; font-weight: 800; color: var(--navy); }
.duty-group-hours span { font-size: 12px; font-weight: 600; color: var(--text-2); margin-left: 1px; }
.duty-group-actions { display: flex; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.duty-group-actions .btn-link { font-size: 12.5px; padding: 0; }

.duty-day-card { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.duty-day-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.duty-day-hours { color: var(--navy); }
.duty-day-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-2); padding: 3px 0; }
.duty-day-row span:last-child { color: var(--text); font-weight: 500; }
.duty-day-sig { height: 30px; margin-top: 6px; }
.duty-day-total { text-align: right; font-size: 13px; color: var(--text-2); margin: 12px 4px; }


/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(19,35,61,.55); display: flex; align-items: flex-end; z-index: 100; }
.modal-box { background: #fff; border-radius: 18px 18px 0 0; width: 100%; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 17px; }
.modal-head .sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-2); cursor: pointer; padding: 4px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 78px; left: 16px; right: 16px; background: var(--navy); color: #fff; padding: 13px 16px; border-radius: var(--radius); font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 200; text-align: center; }

/* ---------- My Profile screen ---------- */
.profile-header-card {
  display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.profile-photo-circle {
  width: 56px; height: 56px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; color: var(--text-2); cursor: pointer;
}
.profile-photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.profile-header-card h3 { font-size: 16px; }
.profile-mobile { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.profile-subtabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.profile-subtabs::-webkit-scrollbar { display: none; }
.profile-subtab {
  flex-shrink: 0; padding: 8px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  color: var(--text-2); background: #fff; border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
.profile-subtab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.profile-panel .field { margin-bottom: 14px; }

/* Shared search input style - Available Jobs, My Shifts, Blocked Homes */
.pwa-search-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; background: #fff; color: var(--text); margin-bottom: 12px;
}
.pwa-search-input:focus { border-color: var(--navy-2); outline: none; }
.pwa-load-more-btn { margin-top: 10px; }

.home-block-list { display: flex; flex-direction: column; gap: 8px; }
.home-block-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.home-block-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.yn-radio { display: flex; gap: 20px; padding-top: 6px; }
.yn-radio label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; }
.yn-radio input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); cursor: pointer; }

.profile-training-row {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 6px;
}
.profile-training-label { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.profile-training-controls { display: flex; align-items: center; gap: 12px; }
.profile-training-row .yn-radio { padding-top: 0; gap: 12px; flex-shrink: 0; }
.profile-training-row input[type="date"] {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px;
}
.profile-training-row input[type="date"]:disabled { background: var(--bg); color: #b0b6c0; }

.profile-photo-preview {
  width: 170px; height: 160px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  display: flex; align-items: center; justify-content: center; overflow: hidden; margin-top: 12px;
}
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-preview #pfPhotoPreviewEmpty { font-size: 12px; color: var(--text-2); }

/* ---------- My Profile: app-style overview, read-only section pages, edit forms ---------- */
.pf-page { padding-bottom: 8px; }
.pf-hero {
  background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 20px;
  padding: 24px 18px 18px; text-align: center; margin-bottom: 20px; box-shadow: 0 6px 18px rgba(19,35,61,.22);
}
.pf-avatar {
  position: relative; width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; padding: 0; cursor: pointer; overflow: visible;
}
.pf-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.pf-avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold);
  border: 2px solid var(--navy); display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal;
}
.pf-name { font-size: 20px; margin: 12px 0 2px; color: #fff; }
.pf-sub { font-size: 13px; color: rgba(255,255,255,.78); margin-top: 2px; word-break: break-all; }
.pf-progress { margin-top: 18px; background: rgba(255,255,255,.1); border-radius: 12px; padding: 11px 13px; text-align: left; }
.pf-progress-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 8px; color: rgba(255,255,255,.88); }
.pf-progress-top b { color: #fff; }
.pf-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #e3c071, var(--gold)); transition: width .3s; }

.pf-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin: 0 4px 8px; }
.pf-list { background: #fff; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 3px rgba(19,35,61,.05); }
.pf-row {
  display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border: 0; text-align: left;
  padding: 13px 14px; cursor: pointer; color: var(--text); -webkit-tap-highlight-color: transparent;
}
.pf-row + .pf-row { border-top: 1px solid var(--border); }
.pf-row:active { background: var(--bg); }
.pf-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.pf-ico-personal { background: #2f5fa8; } .pf-ico-profileCheck { background: #2e7d5b; } .pf-ico-training { background: #8a5cc2; }
.pf-ico-billing { background: #c98a1f; } .pf-ico-photo { background: #d2566e; } .pf-ico-homes { background: #5b6472; }
.pf-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-row-main b { font-size: 14.5px; font-weight: 700; }
.pf-row-main small { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { color: #aab1bd; display: flex; flex-shrink: 0; }
.pf-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; flex-shrink: 0; display: inline-flex; align-items: center; }
.pf-chip.warn { background: #fdf1d9; color: #8a6112; }
.pf-chip.ok { background: #e1f3ea; color: var(--filled); padding: 3px 6px; }
.pf-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 20px; padding: 13px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; font-size: 14.5px; font-weight: 700; color: var(--warn); cursor: pointer;
}
.pf-logout:active { background: #fdeceb; }

.pf-subhead { display: flex; align-items: center; gap: 6px; margin: -4px 0 14px; min-height: 40px; }
.pf-subhead h3 { flex: 1; font-size: 17px; text-align: center; margin: 0; }
.pf-back, .pf-edit-btn { background: none; border: 0; cursor: pointer; color: var(--navy); }
.pf-back { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); flex-shrink: 0; }
.pf-edit-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; padding: 8px 14px; border-radius: 20px; background: var(--navy); color: #fff; flex-shrink: 0; }
.pf-edit-spacer { width: 40px; flex-shrink: 0; }

.pf-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 4px 14px; box-shadow: 0 1px 3px rgba(19,35,61,.05); }
.pf-kv { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 13px 0; font-size: 14px; }
.pf-kv + .pf-kv { border-top: 1px solid var(--border); }
.pf-kv span { color: var(--text-2); flex-shrink: 0; }
.pf-kv b { font-weight: 600; text-align: right; word-break: break-word; }
.pf-kv b.empty { color: #aab1bd; font-weight: 500; }
.pf-train { display: flex; align-items: center; gap: 10px; padding: 11px 0; font-size: 13.5px; }
.pf-train + .pf-train { border-top: 1px solid var(--border); }
.pf-train-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd4dc; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.pf-train.done .pf-train-dot { background: var(--filled); border-color: var(--filled); }
.pf-train-name { flex: 1; min-width: 0; font-weight: 600; }
.pf-train small { color: var(--text-2); flex-shrink: 0; }
.pf-train.done small { color: var(--filled); font-weight: 600; }

/* edit form */
.pf-card-form { padding: 16px 14px 4px; }
.pf-card-form .field input, .pf-card-form .field textarea { background: var(--bg); border-color: transparent; border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.pf-card-form .field input:focus, .pf-card-form .field textarea:focus { background: #fff; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(47,95,168,.12); }
.pf-card-form .field label { text-transform: uppercase; letter-spacing: .4px; font-size: 11.5px; }
.pf-save { margin-top: 16px; padding: 15px; border-radius: 14px; position: sticky; bottom: 78px; box-shadow: 0 6px 16px rgba(184,146,63,.35); }
/* Yes / No as segmented pills */
.pf-page .yn-radio { gap: 8px; padding-top: 2px; }
.pf-page .yn-radio { flex-wrap: wrap; }
.pf-page .yn-radio label, .pf-card-form .field .yn-radio label { position: relative; padding: 8px 15px; border-radius: 22px; background: var(--bg); border: 1px solid var(--border); font-weight: 600; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; display: flex; }
.pf-page .yn-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.pf-page .yn-radio label:has(input:checked), .pf-card-form .field .yn-radio label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.pf-page .profile-training-row { background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 0; margin: 0; }
.pf-page .profile-training-row:last-child { border-bottom: 0; }
.pf-page .profile-training-row input[type="month"], .pf-page .profile-training-row input[type="date"] { background: var(--bg); border: 0; border-radius: 10px; padding: 9px 10px; font-size: 14px; }
.pf-page .profile-training-controls { flex-wrap: wrap; }

.pf-photo-card { padding: 20px 16px; text-align: center; }
.pf-page .profile-photo-preview { width: 160px; height: 160px; border-radius: 50%; margin: 0 auto; border: 3px solid var(--border); }
.pf-page .profile-photo-preview #pfPhotoPreviewEmpty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #aab1bd; }
.pf-file { display: none; }
.pf-choose { cursor: pointer; }
.pf-note { background: #eef3fb; color: #34527f; border-radius: 12px; padding: 11px 13px; font-size: 12.5px; line-height: 1.45; margin-bottom: 12px; }
.pf-page .home-block-list { background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; gap: 0; }
.pf-page .home-block-row { border: 0; border-radius: 0; border-top: 1px solid var(--border); }
.pf-page .home-block-row:first-child { border-top: 0; }

/* ---------- Supervisor sign-off signature pad ---------- */
.sig-pad-wrap { position: relative; width: 100%; }
#cjSigPad {
  width: 100%; height: 90px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  cursor: crosshair; display: block; touch-action: none;
}
.sig-clear-link { position: absolute; bottom: 6px; right: 10px; font-size: 11px; color: var(--text-2); text-decoration: underline; }
.sig-clear-link:hover { color: var(--navy); }

/* ---------- In-app timesheet viewer (replaces the old pop-up window) ---------- */
.ts-viewer { position: fixed; inset: 0; z-index: 1000; background: #78828f; display: flex; flex-direction: column; }
.ts-viewer-bar {
  display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; flex-shrink: 0;
}
.ts-viewer-back { background: none; border: 0; color: #fff; font-size: 15px; font-weight: 700; padding: 6px 8px 6px 0; cursor: pointer; }
.ts-viewer-title { flex: 1; font-size: 15px; font-weight: 700; text-align: center; }
.ts-viewer-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); }
.ts-viewer-sheet { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); overflow: hidden; }
.ts-viewer-sheet iframe { position: absolute; top: 0; left: 0; width: 794px; border: 0; transform-origin: top left; background: #fff; }
body.ts-viewer-open { overflow: hidden; }

.otp-email-wrap { text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.otp-email-wrap .link-btn { font-size: 13px; }
.otp-email-hint { font-weight: 500; color: var(--text-2); }

.type-picker-hint { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.type-picker-hint b { color: #c0620f; }

.type-picker.type-picker-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.type-picker-4 .type-chip { padding: 8px 3px; }
.type-picker-4 .type-chip small { font-size: 10px; }
@media (max-width: 340px) { .type-picker.type-picker-4 { grid-template-columns: repeat(2, 1fr); } }

/* "Shift already filled / expired" popup from a tapped notification */
.job-gone-box { text-align: center; padding: 26px 22px 20px; }
.job-gone-icon { font-size: 34px; color: var(--gold, #b8913d); line-height: 1; margin-bottom: 8px; }
.job-gone-box h3 { margin: 0 0 8px; font-size: 18px; }
.job-gone-box p { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.job-gone-box .job-gone-sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 16px; }

/* ---------- Prominent map link, date and shift on job cards ---------- */
.job-item .job-address { display: flex; align-items: center; gap: 6px; margin-top: 7px; padding: 7px 10px; border-radius: 10px;
  background: #e8f0fe; border: 1px solid #b9cdf5; color: #174ea6; font-size: 12.5px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.job-item .job-address:active { background: #d6e4fd; text-decoration: none; }
.job-item .job-address-pin { font-size: 14px; line-height: 1; flex-shrink: 0; }
.job-item .job-address-text { flex: 1; min-width: 0; }
.job-item .job-address-go { flex-shrink: 0; background: #1a73e8; color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.job-item.night .job-address { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: #fff; }
.job-when { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 8px; }
.when-date, .when-shift { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 800; line-height: 1.2; }
.when-date { background: var(--navy, #13233d); color: #fff; }
.when-shift small { font-size: 11.5px; font-weight: 700; opacity: .9; }
.when-early { background: #d8f0e3; color: #17663f; border: 1px solid #9fd4b6; }
.when-late { background: #d4eef3; color: #135f6f; border: 1px solid #93cfdb; }
.when-long { background: #fde4cc; color: #9a4a06; border: 1px solid #f3b77f; }
.when-night { background: #dfe1fb; color: #2e348f; border: 1px solid #aeb3f0; }
.when-other { background: #eceff3; color: #2b3442; border: 1px solid #c9d0da; }
.job-item.night .when-date { background: #fff; color: var(--night-bg, #1e1b4b); }

/* ---------- Home: clickable "Upcoming shifts" + Next shift card ---------- */
.greeting-stat-btn { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 10px;
  padding: 8px 14px; text-align: left; cursor: pointer; font: inherit; }
.greeting-stat-btn:active { background: rgba(255,255,255,.22); }
.next-shift { background: #fff; border: 2px solid var(--gold, #b8913d); border-radius: 14px; padding: 14px; margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(19,35,61,.08); cursor: pointer; }
.next-shift .ns-top { display: flex; gap: 14px; align-items: stretch; }
.ns-date { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px;
  background: var(--navy, #13233d); color: #fff; padding: 6px 4px; }
.ns-dow { font-size: 12px; font-weight: 700; text-transform: uppercase; opacity: .85; }
.ns-day { font-size: 28px; font-weight: 800; line-height: 1.05; }
.ns-mon { font-size: 12px; font-weight: 700; text-transform: uppercase; opacity: .85; }
.ns-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ns-rel { font-size: 12px; font-weight: 800; color: var(--gold, #b8913d); text-transform: uppercase; letter-spacing: .03em; }
.ns-rel.now { color: #17663f; }
.ns-shift { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.ns-shift .when-shift { font-size: 14px; }
.ns-home { font-size: 15.5px; font-weight: 800; color: var(--text); }
.ns-cat { font-size: 12.5px; color: var(--text-2); }
.ns-ok { color: #17663f; font-weight: 700; }
.ns-wait { color: #9a5b00; font-weight: 700; }
.ns-map { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #1a73e8; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.ns-map:active { background: #1558b0; }
.ns-map-pin { font-size: 16px; line-height: 1; }
.ns-map-addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-map-go { flex-shrink: 0; font-weight: 800; background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 999px; }
.next-shift.night { background: var(--night-bg, #1e1b4b); border-color: #8b8ff0; }
.next-shift.night .ns-home, .next-shift.night .ns-shift { color: #fff; }
.next-shift.night .ns-cat { color: rgba(255,255,255,.75); }
.next-shift.night .ns-date { background: #fff; color: var(--night-bg, #1e1b4b); }

.withdraw-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-2); }
.withdraw-link { color: #c0392b; font-weight: 700; font-size: 12.5px; }
.job-item.night .withdraw-row { color: var(--night-meta); border-top-color: rgba(255,255,255,.2); }
.job-item.night .withdraw-link { color: #ffb4a6; }

/* ---------- "i" button + Contact & Info page ---------- */
.info-btn { background: none; border: none; cursor: pointer; padding: 5px; color: #fff; display: flex; align-items: center; border-radius: 50%; }
.info-btn.active { background: rgba(255,255,255,.18); }
.info-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.info-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.info-head h3 { font-size: 16px; margin: 0; }
.info-ico { font-size: 18px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); background: #f8fafc; }
.info-row:active { background: #eef3f9; }
.info-row-main { display: flex; flex-direction: column; min-width: 0; }
.info-row-main small { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.info-row-main b { font-size: 14.5px; overflow-wrap: anywhere; }
.info-go { flex-shrink: 0; background: #1a73e8; color: #fff; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.info-go-call { background: #17663f; }
.info-note { font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.info-payslip { text-decoration: none; text-align: center; display: block; }
.info-url { font-size: 11px; color: var(--text-2); margin-top: 6px; text-align: center; overflow-wrap: anywhere; }

/* Jobs tab: status chips + my-status pills */
.job-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.job-chip { border: 1px solid #d5dae2; background: #fff; color: #1b2430; border-radius: 999px; padding: 5px 9px; font-size: 12.5px; font-weight: 600; }
.job-chip span { display: inline-block; min-width: 18px; margin-left: 2px; padding: 0 5px; border-radius: 999px; background: #eef1f6; color: #3c4a60; font-size: 11px; }
.job-chip.active { background: #13233d; border-color: #13233d; color: #fff; }
.job-chip.active span { background: rgba(255,255,255,.2); color: #fff; }
.pill-assigned { background: #e6f4ea; color: #1e7b3a; }
.pill-cancelreq { background: #fff4e0; color: #8a5a00; }
.pill-cancelled { background: #fdecea; color: #b3261e; }

/* "Application received" popup (first application of the day) */
.apply-notice-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: #e6f4ea; color: #1e7b3a; font-size: 28px; font-weight: 700; line-height: 52px; }
.apply-notice-box p { line-height: 1.45; }
.apply-notice-list { text-align: left; margin: 10px 0 12px; padding: 0; list-style: none; }
.apply-notice-list li { font-size: 13.5px; line-height: 1.45; background: #f5f6f8; border-radius: 8px; padding: 9px 11px; margin-bottom: 7px; }
.pill-reopened { background: #fff4d6; color: #8a5a00; }

/* ---------- Clock in / out ("I've arrived") ---------- */
.btn-clockin {
  display: block; width: 100%; margin-top: 10px; padding: 13px 14px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #1f8a5b, #2e7d5b); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(46,125,91,.28); cursor: pointer;
}
.btn-clockin:disabled { opacity: .75; }
.clock-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 9px 12px;
  border-radius: 10px; background: #e9f6ef; color: #1f6b47; font-size: 13px; font-weight: 600; }
.clock-row .btn { flex: none; }
.clock-row.clock-wait { background: #f3f5f8; color: #5b6472; font-weight: 500; }
.ns-clock { margin-top: 4px; }
.job-item.night .clock-row, .next-shift.night .clock-row { background: rgba(255,255,255,.12); color: #d9f5e6; }
.job-item.night .clock-row.clock-wait, .next-shift.night .clock-row.clock-wait { color: var(--night-meta, #c7cbf5); }

/* ---------- File attached to an office message ---------- */
.notif-attach { display: flex; align-items: center; gap: 11px; margin: 9px 0 4px; padding: 9px 12px 9px 9px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--text); max-width: 100%; }
.notif-attach:active { background: #f1f4f8; }
.notif-attach-ic { flex-shrink: 0; width: 38px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.notif-attach-pdf { background: #d64535; } .notif-attach-xls { background: #1f7a4a; } .notif-attach-doc { background: #2b5fb4; } .notif-attach-img { background: #7a5bc4; }
.notif-attach-text { display: flex; flex-direction: column; min-width: 0; }
.notif-attach-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-attach-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
