/* ─────────────────────────────────────────────────────────────────────────────
   One Home Deck — brand tokens & components
   Colours from the One Home Care Brand Guidelines.
   Fonts: Playfair Display + DM Sans stand in for Clarendon Text Pro / SantElia /
   Gill Sans Nova (Adobe Fonts). Swap --font-display / --font-body to use a kit.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* Primary */
  --teal: #30626b;
  --yellow: #fbc13d;
  --orange: #ee701b;
  /* Secondary */
  --teal-dark: #2c4a56;
  --teal-light: #81b0b3;
  --corporate-blue: #336374;  /* as used in the Branded Line Strip */

  /* Derived */
  --orange-text: #b9520c;     /* orange darkened for small text contrast (AA) */
  --orange-wash: #fdeee3;
  --teal-wash: #eef2f1;
  --bg: #f7f6f2;
  --surface: #fdfcf9;
  --line: #ebe8e1;
  --ink: var(--teal-dark);
  --muted: #5f7177;
  --danger: #b3261e;
  --success: #2f7a4f;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', 'Gill Sans Nova', 'Gill Sans', system-ui, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgb(44 74 86 / 0.05), 0 8px 28px rgb(44 74 86 / 0.06);
  --shadow-btn: 0 10px 24px -8px rgb(44 74 86 / 0.45);
  --brand-gradient: linear-gradient(90deg, var(--orange) 0%, var(--yellow) 55%, var(--teal-light) 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--orange-text); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Type ─────────────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.eyebrow--yellow { color: var(--yellow); }
.eyebrow--teal { color: var(--teal); }

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--teal-dark);
}
.display em { font-style: italic; color: var(--orange); letter-spacing: -0.03em; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 3px;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  text-decoration: none;
}
.btn:hover { background: #24404b; text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--teal-dark); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--teal-wash); }
.btn--danger { background: var(--danger); box-shadow: none; }
.btn--danger:hover { background: #8f1e18; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; gap: 8px; box-shadow: none; }

.link-btn {
  border: 0; background: none; padding: 4px 6px; cursor: pointer;
  color: var(--orange-text); font-weight: 700; font-size: 14px;
}
.link-btn:hover { text-decoration: underline; }

/* ── Decorative background shapes ─────────────────────────────────────────── */

.bg-shape { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
.bg-shape--tr { width: 560px; height: 560px; top: -340px; right: -260px; background: #e7ece9; }
.bg-shape--bl { width: 300px; height: 300px; bottom: -180px; left: -170px; background: #fdf2dc; }

/* ── Welcome ──────────────────────────────────────────────────────────────── */

.welcome {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 48px 20px;
  text-align: center;
}
.welcome__logo { width: 170px; height: auto; margin: -36px 0 -12px; }
.welcome__title { margin-top: 26px; font-size: clamp(44px, 9vw, 76px); }
.welcome__title em { display: block; }
.welcome__lede { max-width: 440px; margin: 26px auto 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.welcome__actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 30px; }
.welcome__secure { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.welcome__secure svg { width: 14px; height: 14px; }
.welcome__new {
  padding: 3px 6px; border: 1.5px solid #f4b48a; border-radius: 2px;
  background: transparent; color: var(--orange-text); font-weight: 700; font-size: 12.5px; cursor: pointer;
}
.welcome__new:hover { background: var(--orange-wash); }
.welcome__admin { font-size: 13px; }
.family { display: flex; align-items: center; gap: 8px; margin-top: 30px; color: var(--muted); font-size: 11.5px; }
.family img { width: 22px; height: auto; }

/* Avoid flashing the wrong state before the session check returns. */
body[data-state="loading"] .welcome__actions,
body[data-state="loading"] .welcome__title,
body[data-state="loading"] .welcome__lede { visibility: hidden; }

/* ── Sign-in modal ────────────────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 20px;
  background: rgb(44 74 86 / 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: fade-in .2s ease;
}
.modal__card {
  position: relative;
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  width: min(1000px, 100%);
  min-height: 560px;
  background: var(--surface);
  box-shadow: 0 40px 80px -20px rgb(0 0 0 / 0.45);
  animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
.modal__brand {
  position: relative;
  overflow: hidden;
  padding: 48px 44px;
  background: var(--teal-dark);
  color: #fff;
}
.modal__brand-logo { width: 220px; height: auto; margin: -38px auto 0; }
.modal__brand .eyebrow { margin-top: 64px; }
.modal__brand h2 {
  position: relative; z-index: 1;
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 3.6vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.modal__brand h2 em { color: var(--orange); }
.modal__arc {
  position: absolute; right: -150px; bottom: -150px;
  width: 340px; height: 340px; border-radius: 50%;
  border: 50px solid var(--teal); opacity: .75;
}
.modal__panel { position: relative; padding: 64px 56px 48px; }
.modal__close {
  position: absolute; top: 16px; right: 16px;
  display: grid; place-items: center;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.modal__close:hover { background: var(--teal-wash); color: var(--ink); }
.modal__close svg { width: 20px; height: 20px; }
.modal__title { margin-top: 12px; font-size: 44px; }
.modal__sub { margin: 6px 0 28px; color: var(--muted); }
.modal__foot { margin: 24px 0 0; text-align: center; color: var(--muted); font-size: 14px; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 20px; }
.field__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.field__hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.input-wrap { position: relative; }
.input-wrap > svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
.input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border: 1.5px solid #dfe3e1;
  border-radius: 2px;
  background: var(--surface);
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-wrap > svg ~ .input { padding-left: 52px; }
.input:hover { border-color: #c7cfcd; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgb(48 98 107 / 0.15); }
.input::placeholder { color: #99a6a8; }
.input--compact { height: 44px; font-size: 15px; }
select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f7177' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.peek {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%;
}
.peek:hover { color: var(--ink); background: var(--teal-wash); }
.peek svg { width: 20px; height: 20px; }
.input-wrap--peek .input { padding-right: 56px; }

.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 28px; font-size: 14.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal-dark); }

.btn--signin { justify-content: space-between; min-height: 64px; padding: 0 24px; font-size: 17px; }
.btn--signin .heart { width: 32px; height: 32px; flex: none; }
.btn--signin span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }
@media (max-width: 420px) { .btn--signin { padding: 0 16px; gap: 10px; font-size: 15.5px; } }

.alert {
  margin: 0 0 20px; padding: 12px 14px;
  border-left: 3px solid var(--danger); background: #fbeeed; color: #7d1a15;
  font-size: 14px; border-radius: 2px;
}
.alert--ok { border-color: var(--success); background: #ebf5ef; color: #1f5537; }
.note { padding: 16px 18px; background: var(--teal-wash); border-radius: var(--radius-sm); color: var(--ink); font-size: 15px; line-height: 1.6; }

@media (max-width: 820px) {
  .modal { place-items: start center; padding: 0; }
  .modal__card { grid-template-columns: 1fr; min-height: 100dvh; }
  .modal__brand { padding: 28px 24px 30px; }
  .modal__brand-logo { width: 160px; margin: -28px 0 -10px -14px; }
  .modal__brand .eyebrow { margin-top: 8px; }
  .modal__brand h2 { font-size: 30px; margin-top: 10px; }
  .modal__arc { width: 200px; height: 200px; border-width: 32px; right: -90px; bottom: -110px; }
  .modal__panel { padding: 32px 22px 40px; }
  .modal__title { font-size: 36px; }
  .modal__close { top: 12px; right: 12px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── App shell (deck & admin) ─────────────────────────────────────────────── */

.app { position: relative; z-index: 1; width: min(980px, 100%); margin: 0 auto; padding: 30px 20px 140px; }
.app__top {
  position: absolute; top: 30px; right: 20px; z-index: 2;
  display: flex; align-items: flex-start; gap: 16px;
}
/* The logo file has empty space around the artwork; the negative margins line the visible
   logo up with the top of the page heading and the right-hand edge of the content. */
.app__logo { display: block; width: 200px; height: auto; margin: -29px -34px -28px 0; }
.app__top-action { order: -1; }
.app__head { margin: 0 0 34px; }
.app__title { margin-top: 18px; font-size: clamp(40px, 7vw, 66px); }

/* ── Deck cards ───────────────────────────────────────────────────────────── */

.deck { display: grid; grid-template-columns: 0.72fr 1fr; gap: 30px; }
.deck > .card--wide { grid-column: 1 / -1; }
/* Mid-width: Annual leave runs full width under Colleague + Pay */
.deck > .leave { grid-column: 1 / -1; }
/* Below wide screens, the second-row cards run full width */
.deck > .card--third { grid-column: 1 / -1; }
/* Wide screens: two rows of three equal cards —
   Colleague · Pay · Annual leave, then Next shift · Documents · Training */
@media (min-width: 1100px) {
  .deck { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck > .leave, .deck > .card--third { grid-column: auto; }
  .card--third .shift__date { font-size: 26px; }
  .card--third .shift__when { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 24px; }
  .card--third .shift__countdown { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .card--third .shift__countdown strong { font-size: 28px; }
  .card--third .shift__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--third .training__stats { gap: 8px; }
  .card--third .training__stat { padding: 12px; }
  .card--third .training__stat strong { font-size: 26px; }
  .card--third .training__list li { flex-direction: column; gap: 6px; }
  .card--third .docs-item .chip { display: none; } /* the card heading already says they need signing */
  .card--third .training__stat span { font-size: 12.5px; white-space: nowrap; }
  .card--third .shift__list li:nth-child(n+3) { display: none; } /* two days here; the rest are on the Rota */
}

/* Cards with a link at the bottom: body fills the card so the link sits at the foot */
.card--third { display: flex; flex-direction: column; }
.card--third .card__body { flex: 1; display: flex; flex-direction: column; }
.card__more {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  margin-top: auto; padding-top: 20px; font-size: 14.5px;
}
.card__more svg { width: 16px; height: 16px; transition: transform .15s ease; }
.card__more:hover svg { transform: translateX(3px); }

/* Annual leave card */
.leave__figure { margin: 30px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.leave__figure small { font-size: 22px; color: var(--teal-light); font-weight: 700; }
.leave__figure-label { margin: 6px 0 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.leave__bar { display: flex; height: 10px; margin: 24px 0 16px; border-radius: 99px; background: #edece6; overflow: hidden; }
.leave__bar span { height: 100%; transition: width 1s cubic-bezier(.2,.8,.2,1); width: 0; }
.leave__bar .is-taken { background: var(--corporate-blue); }
.leave__bar .is-booked { background: #81b0b3; }
.leave__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.leave__legend li { display: flex; align-items: center; gap: 7px; }
.leave__legend b { color: var(--ink); }
.leave__dot { width: 10px; height: 10px; border-radius: 50%; }
.leave__dot--taken { background: var(--corporate-blue); }
.leave__dot--booked { background: #81b0b3; }
.leave__dot--left { background: #edece6; box-shadow: inset 0 0 0 1.5px #d6d3cb; }
.leave__reset { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.leave__reset b { color: var(--ink); white-space: nowrap; }
.leave__note { margin: 10px 0 0; font-size: 13.5px; color: #7a5a0c; font-weight: 600; }
.leave__empty { margin: 30px 0 0; color: var(--muted); }

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: deal .5s cubic-bezier(.2,.8,.2,1) backwards;
}
.card::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: var(--orange); }
.card--spectrum::before { background: var(--corporate-blue); }
.card__body { padding: 30px 30px 32px; }
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .14s; }
.card:nth-child(4) { animation-delay: .21s; }
@keyframes deal { from { opacity: 0; transform: translateY(18px) rotate(-.6deg); } }

.icon-tile {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 8px;
  background: var(--teal-wash); color: var(--teal-dark);
}
.icon-tile svg { width: 22px; height: 22px; }
.icon-tile--orange { width: 56px; height: 56px; background: var(--orange-wash); color: var(--orange); }
.icon-tile--orange svg { width: 26px; height: 26px; }
.icon-tile--lg { width: 68px; height: 68px; border-radius: 50%; background: var(--teal-dark); color: #fff; }
.icon-tile--lg svg { width: 30px; height: 30px; }

/* Colleague card */
.colleague__row { display: flex; align-items: center; gap: 18px; padding: 24px 30px; }
.colleague__row + .colleague__row { border-top: 1px solid var(--line); }
.colleague__row:first-child { padding-top: 40px; padding-bottom: 22px; }
.colleague__name { margin: 2px 0 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.colleague__row:first-child { flex-wrap: wrap; row-gap: 14px; }
.colleague__email { flex-basis: 100%; min-width: 0; margin: 0; color: var(--muted); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-label { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.colleague__role { margin: 0; font-weight: 700; font-size: 17px; }

.home-select { position: relative; display: inline-flex; align-items: center; }
.home-select svg.lead { position: absolute; left: 20px; width: 20px; height: 20px; pointer-events: none; }
.home-select select {
  appearance: none; min-width: 210px; height: 52px; padding: 0 44px 0 52px;
  border: 1px solid var(--line); border-radius: 6px; background: #f1f0eb;
  font-weight: 700; font-size: 17px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f7177' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.home-select select:disabled { cursor: default; background-image: none; padding-right: 22px; opacity: 1; color: var(--ink); }
.home-select select:hover:not(:disabled) { background-color: #ebeae4; }

/* Pay card */
.pay__head { display: flex; align-items: center; gap: 16px; }
.pay__head .eyebrow { color: var(--teal-dark); flex: 1; white-space: nowrap; }
.pay__month { white-space: nowrap; }
.pay__month { color: var(--muted); font-weight: 600; font-size: 15px; }
.pay__hours { display: flex; align-items: center; gap: 16px; margin-top: 34px; }
.pay__figure { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.pay__figure small { font-size: 24px; color: var(--teal-light); font-weight: 700; }
.pay__figure-label { margin: 4px 0 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.meter { height: 8px; margin: 28px 0 22px; border-radius: 99px; background: #edece6; overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand-gradient); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.pay__amount { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; color: var(--orange); font-variant-numeric: lining-nums; }
.pay__note { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pay__projection { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #f3f2ed; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pay__projection b { color: var(--ink); }
.pay__month.is-today { color: var(--orange-text); font-weight: 700; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  background: #fdf3dc; color: #7a5a0c; font-size: 12px; font-weight: 700;
}
.chip--teal { background: var(--teal-wash); color: var(--teal); }
.chip--orange { background: var(--orange-wash); color: var(--orange-text); }
.chip--red { background: #fbeeed; color: var(--danger); }
.chip--green { background: #ebf5ef; color: var(--success); }
.card__chip { margin: -14px 30px 24px; }

/* Next shift */
.shift__head { display: flex; align-items: center; gap: 18px; }
.shift__empty { margin: 36px 0 0; color: var(--muted); font-size: 17px; }
.shift__when { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 30px; }
.shift__date { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.025em; line-height: 1.1; }
.shift__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.shift__meta span { display: inline-flex; align-items: center; gap: 7px; }
.shift__meta svg { width: 17px; height: 17px; }
.shift__countdown { text-align: right; }
.shift__countdown strong { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--orange); line-height: 1; }
.shift__countdown span { color: var(--muted); font-weight: 600; font-size: 13px; }
.shift__list { list-style: none; margin: 26px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.shift__list li { padding: 12px 14px; border-radius: 8px; background: #f3f2ed; font-size: 14px; }
.shift__list b { display: block; font-size: 14.5px; }
.shift__list span { color: var(--muted); }
.shift__list li.is-leave { background: #fdf3dc; }
.shift__list li.is-leave span { color: #7a5a0c; font-weight: 600; }

/* Training */
.training__open { margin-left: auto; }
.training__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; }
.training__stat { padding: 16px 18px; border-radius: 8px; background: #f3f2ed; }
.training__stat strong { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1; }
.training__stat span { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.training__stat--valid strong { color: var(--success); }
.training__stat--expiring strong { color: #b7791f; }
.training__stat--expired strong { color: var(--danger); }
.training__list { list-style: none; margin: 18px 0 0; padding: 0; }
.training__list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.training__list b { font-weight: 600; }

/* Skeleton loading */
.skeleton { display: inline-block; min-width: 3ch; border-radius: 4px; color: transparent !important; background: linear-gradient(90deg, #eeede7 0%, #f6f5f1 50%, #eeede7 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Bottom navigation ────────────────────────────────────────────────────── */

.tabbar {
  position: fixed; left: 50%; bottom: 0; z-index: 20;
  transform: translateX(-50%);
  width: min(860px, 100%);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0 0 env(safe-area-inset-bottom);
  background: var(--surface);
  box-shadow: 0 -8px 30px rgb(44 74 86 / 0.07);
}
.tabbar::after { content: ''; position: fixed; left: -50vw; right: -50vw; bottom: 0; height: 4px; background: var(--brand-gradient); opacity: .35; z-index: -1; }
.tabbar button, .tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 4px 14px; border: 0; background: none; cursor: pointer;
  color: #8a989b; font-size: 13px; font-weight: 700;
}
.tabbar a { text-decoration: none; }
.tab-icon { position: relative; display: inline-flex; }
.tab-badge {
  position: absolute; top: -6px; right: -10px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--orange-text); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; /* darker orange: white text passes AA */
  box-shadow: 0 0 0 2px var(--surface);
}
.tabbar button svg, .tabbar a svg { width: 26px; height: 26px; }
.tabbar [aria-current="page"] { color: var(--teal-dark); }
.tabbar [aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 44px; height: 4px; border-radius: 0 0 4px 4px; background: var(--orange); }
.tabbar button:hover, .tabbar a:hover { color: var(--teal-dark); }

.sheet {
  position: fixed; left: 50%; bottom: 96px; z-index: 30;
  transform: translateX(-50%);
  width: min(360px, calc(100% - 32px));
  padding: 8px; border-radius: 12px; background: var(--surface);
  box-shadow: 0 20px 50px -10px rgb(44 74 86 / 0.35); border: 1px solid var(--line);
  animation: rise .2s ease;
}
.sheet a, .sheet button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 14px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--ink); font-weight: 600; font-size: 15px; text-align: left; text-decoration: none;
}
.sheet a:hover, .sheet button:hover { background: var(--teal-wash); }
.sheet svg { width: 20px; height: 20px; color: var(--muted); }
.sheet hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.sheet .sheet__ext { width: 15px; height: 15px; margin-left: auto; color: #a3afb2; }
.sheet__tag { margin-left: auto; padding: 2px 8px; border-radius: 99px; background: #f1f0eb; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.sheet #more-links:empty + hr { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 110px; z-index: 60;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 8px;
  background: var(--teal-dark); color: #fff; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 14px 30px -10px rgb(0 0 0 / .4);
  animation: rise .2s ease;
}

@media (max-width: 760px) {
  .deck { grid-template-columns: 1fr; gap: 20px; }
  .app { padding: 14px 16px 120px; }
  .app__top { top: 14px; right: 16px; }
  .app__logo { width: 150px; margin: -22px -25px -21px 0; }
  .app__head { margin: 0 0 24px; }
  .app__title { margin-top: 28px; } /* clear the logo */
  .card__body { padding: 26px 22px 28px; }
  .colleague__row { padding: 20px 22px; }
  .card__chip { margin: -12px 22px 22px; }
  .colleague__row:first-child { padding-top: 34px; }
  .shift__countdown { text-align: left; }
  .shift__head { flex-wrap: wrap; }
  .training__open { margin-left: 0; width: 100%; }
  .training__stats { gap: 8px; }
  .training__stat { padding: 12px; }
  .training__stat strong { font-size: 26px; }
  .tabbar button, .tabbar a { padding: 12px 2px 10px; font-size: 11.5px; }
  .sheet { bottom: 84px; }
}

/* ── Dialog (admin & account) ─────────────────────────────────────────────── */

dialog.panel {
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 40px);
  padding: 0; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 40px 80px -20px rgb(0 0 0 / 0.45);
}
dialog.panel::backdrop { background: rgb(44 74 86 / 0.6); backdrop-filter: blur(4px); }
dialog.panel[open] { animation: rise .22s ease; }
.panel__head { position: relative; padding: 26px 28px 0; }
.panel__head::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: var(--brand-gradient); border-radius: 12px 12px 0 0; }
.panel__head h2 { margin: 6px 0 0; font-family: var(--font-display); font-size: 28px; letter-spacing: -0.02em; }
.panel__body { padding: 22px 28px 8px; }
.panel__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 8px 28px 26px; }
.panel .field { margin-bottom: 16px; }
.panel .field__label { font-size: 13.5px; margin-bottom: 6px; }

.email-row { display: flex; gap: 8px; }
.email-row .input { flex: 1; min-width: 0; }
.email-row .btn { flex: none; min-height: 44px; }
.homes-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.homes-pick label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid #dfe3e1; border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 600; }
.homes-pick input { accent-color: var(--teal-dark); margin: 0; }
.homes-pick label:has(input:checked) { border-color: var(--teal); background: var(--teal-wash); }

/* ── Admin ────────────────────────────────────────────────────────────────── */

.admin-tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.admin-tabs button { position: relative; padding: 12px 14px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 700; }
.admin-tabs button[aria-selected="true"] { color: var(--teal-dark); }
.admin-tabs button[aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--orange); border-radius: 3px 3px 0 0; }
.admin-tabs .count { margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 11.5px; }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input-wrap { flex: 1; min-width: 220px; }
.toolbar .input-wrap > svg { left: 14px; width: 18px; height: 18px; }
.toolbar .input-wrap > svg ~ .input { padding-left: 42px; }

.table-card { padding: 0; }
.table-card::before { display: none; }
.members { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.members th { padding: 14px 18px; text-align: left; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: #f3f2ed; }
.members td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.members tr:hover td { background: #faf9f6; }
.members .who b { display: block; font-size: 15px; }
.members .who span { color: var(--muted); font-size: 13px; word-break: break-all; }
.members .actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--teal-wash); color: var(--ink); }
.icon-btn--danger:hover { background: #fbeeed; color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

@media (max-width: 760px) {
  .members thead { display: none; }
  .members tr { display: grid; grid-template-columns: 1fr auto; padding: 14px 16px; border-top: 1px solid var(--line); }
  .members td { padding: 2px 0; border: 0; }
  .members td.col-homes, .members td.col-role { grid-column: 1; font-size: 13.5px; color: var(--muted); }
  .members td.col-status { grid-column: 1; }
  .members td.col-actions { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
}
.note + .btn { margin-top: 22px; }

/* ── Rota ─────────────────────────────────────────────────────────────────── */

.app--wide { width: min(1180px, 100%); }

/* Shift categories: a solid bar in the category colour; Approved shifts are tinted,
   Pending shifts are outlined with a dashed border. */
.rs--care     { --rs: #336374; --rs-tint: rgb(51 99 116 / 0.14); }
.rs--overtime { --rs: #ee701b; --rs-tint: rgb(238 112 27 / 0.16); }
.rs--sleep    { --rs: #81b0b3; --rs-tint: rgb(129 176 179 / 0.28); }
.rs--training { --rs: #7a5ea8; --rs-tint: rgb(122 94 168 / 0.16); }
.rs--leave    { --rs: #a89f91; --rs-tint: rgb(168 159 145 / 0.24); }
.rs--other    { --rs: #8a989b; --rs-tint: rgb(138 152 155 / 0.20); }
.rs--open     { --rs: #fbc13d; --rs-tint: rgb(251 193 61 / 0.30); } /* corporate yellow; text uses --open-ink for contrast */

.rs {
  display: flex; align-items: baseline; gap: 5px; min-width: 0;
  padding: 3px 6px 3px 8px; border-radius: 4px;
  background: var(--rs-tint); box-shadow: inset 3px 0 0 var(--rs);
  font-size: 12px; line-height: 1.25; color: var(--ink); text-align: left;
}
.rs b { font-weight: 700; white-space: nowrap; }
.rs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 600; }
.rs.is-open { background: repeating-linear-gradient(135deg, var(--rs-tint) 0 6px, transparent 6px 10px), var(--surface); box-shadow: inset 3px 0 0 var(--rs); }
.rs.is-open b { color: #8a5f00; }
.rs.is-clash { --rs: var(--danger); outline: 1.5px solid var(--danger); outline-offset: -1.5px; }
.rs.is-pending { background: var(--surface); box-shadow: inset 3px 0 0 var(--rs); outline: 1.5px dashed var(--rs); outline-offset: -1.5px; }
.rs--key { display: inline-flex; padding: 3px 10px 3px 12px; font-weight: 700; }
.rs-swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 3px; background: var(--rs); }

.rota { overflow: visible; }
.rota::before { border-radius: var(--radius) var(--radius) 0 0; background: var(--corporate-blue); }
.rota__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 26px 28px 12px; }
.rota__nav { display: flex; align-items: center; gap: 6px; }
.rota__month { min-width: 210px; margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.025em; text-align: center; }
.rota__step { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.rota__step svg { width: 20px; height: 20px; }
.rota__step--next svg { transform: scaleX(-1); }
.rota__step:disabled { opacity: .35; cursor: default; background: var(--surface); }
.rota__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rota__summary { margin: 0; color: var(--muted); font-weight: 600; font-size: 14.5px; }

.home-select--compact select { height: 42px; min-width: 180px; font-size: 15px; padding-left: 46px; }
.home-select--compact svg.lead { left: 16px; width: 18px; height: 18px; }

.rota__months { display: flex; gap: 8px; overflow-x: auto; padding: 4px 28px 16px; scrollbar-width: thin; }
.month-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer;
}
.month-chip small { padding: 1px 7px; border-radius: 99px; background: #f1f0eb; color: var(--muted); font-size: 12px; }
.month-chip:hover { border-color: var(--teal-light); }
.month-chip[aria-pressed="true"] { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.month-chip[aria-pressed="true"] small { background: rgb(255 255 255 / 0.18); color: #fff; }

.rota__grid { padding: 0 28px; }
.rota__loading { padding: 40px 0; text-align: center; color: var(--muted); }
.rota__weekdays, .rota__cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rota__weekdays span { padding: 6px 4px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rota__cell {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  min-height: 112px; padding: 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rota__cell:hover { border-color: var(--teal-light); }
.rota__cell--blank { border: 0; background: transparent; cursor: default; }
.rota__cell.is-past { background: #f6f5f1; }
.rota__cell.is-past .rs { opacity: .75; }
.rota__cell.is-selected { border-color: var(--teal-dark); box-shadow: 0 0 0 2px var(--teal-dark); }
.rota__date { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.rota__cell.is-today .rota__date {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: var(--orange); color: #fff;
}
/* Bank holidays: soft purple, distinct from every shift colour */
.rota__cell.is-bh { background: #f3edf7; border-color: #d9c8e4; }
/* Booked annual leave: soft green day, after bank holidays so it wins if both fall on one day */
.rota__cell.is-al { background: #e9f4ec; border-color: #bcdcc6; }
.rota__cell.is-al.is-past { background: #eef4ef; }
.rota__bh { font-size: 11px; font-weight: 700; color: #5b3a6b; line-height: 1.2; }
.rota__shifts { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.rota__day { margin: 18px 28px 0; padding: 18px 0 26px; border-top: 1px solid var(--line); }
.rota__day-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rota__day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rota__day-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 8px; background: #f3f2ed; }
.rota__day-list li > div { flex: 1; min-width: 0; }
.rota__day-list b { display: block; font-size: 15px; }
.rota__day-list span { color: var(--muted); font-size: 14px; }
.rota__day-list span svg { display: inline; width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.rota__day-list .rs-swatch { width: 6px; height: 36px; border-radius: 3px; }
.rota__day-empty { margin: 0; color: var(--muted); }
.chip--pending { background: var(--surface); color: var(--ink); outline: 1.5px dashed #8a989b; outline-offset: -1.5px; }
.chip--bh { background: #f3edf7; color: #5b3a6b; font-family: var(--font-body); letter-spacing: 0; }
.chip--al { background: #e9f4ec; color: #2f6b45; font-family: var(--font-body); letter-spacing: 0; }

.rota-key { margin-top: 24px; }
.rota-key::before { background: var(--corporate-blue); }
.rota-key__groups { display: flex; flex-wrap: wrap; gap: 16px 48px; margin-top: 16px; }
.rota-key__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 22px; }
.rota-key__list li { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; }
.rota-key__day { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.rota-key__day--bh { background: #f3edf7; border: 1px solid #d9c8e4; }
.rota-key__day--al { background: #e9f4ec; border: 1px solid #bcdcc6; }
.rota-key__day--today { border-radius: 50%; background: var(--orange); color: #fff; }

@media (max-width: 760px) {
  .rota__bar { padding: 22px 16px 10px; }
  .rota__nav { width: 100%; justify-content: space-between; }
  .rota__month { min-width: 0; font-size: 24px; }
  .rota__tools { width: 100%; justify-content: space-between; }
  .home-select--compact select { min-width: 0; }
  .rota__months { padding: 4px 16px 12px; }
  .rota__grid { padding: 0 8px; }
  .rota__weekdays, .rota__cells { gap: 3px; }
  .rota__weekdays span { padding: 4px 0; text-align: center; letter-spacing: .04em; font-size: 11px; }
  /* Phone: each shift becomes a coloured bar; tap a day for the details below. */
  .rota__cell { min-height: 64px; padding: 5px 4px; align-items: center; border-radius: 6px; }
  .rota__cell.is-today .rota__date { margin: -2px 0 0; width: 24px; height: 24px; }
  .rota__bh { display: none; }
  .rota__shifts { width: 100%; }
  .rs { height: 7px; padding: 0; border-radius: 3px; background: var(--rs); box-shadow: none; }
  .rs.is-pending { background: transparent; outline-width: 1.5px; }
  .rs.is-open { background: repeating-linear-gradient(135deg, var(--rs) 0 3px, transparent 3px 5px); box-shadow: none; }
  .rs b, .rs span { display: none; }
  .rs--key { height: auto; padding: 3px 10px; background: var(--rs-tint); box-shadow: inset 3px 0 0 var(--rs); }
  .rs--key.is-pending { background: var(--surface); }
  .rota__day { margin: 14px 16px 0; }
  .rota__day-list li { flex-wrap: wrap; gap: 10px; }
}

/* ── Tasks ────────────────────────────────────────────────────────────────── */
.tasks__empty { margin-top: 26px; padding: 22px 24px; border-radius: 10px; background: #f3f2ed; }
.tasks__empty h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tasks__empty p { margin: 0; color: var(--muted); max-width: 60ch; }
.tasks__list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.tasks__item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 8px; background: #f3f2ed; box-shadow: inset 3px 0 0 var(--corporate-blue); }
.tasks__item.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.tasks__item.is-done { opacity: .7; }
.tasks__item b { display: block; }
.tasks__item span { color: var(--muted); font-size: 14px; }

/* ── Docs ─────────────────────────────────────────────────────────────────── */
.docs-action { margin-bottom: 24px; }
.docs-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.docs-list > li { min-width: 0; } /* lets long names shorten with "…" instead of widening the card */
.docs-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border-radius: 8px; background: #f3f2ed; color: var(--ink); font-weight: 400; text-decoration: none;
  transition: background-color .15s ease;
}
.docs-item:hover { background: #ebeae4; text-decoration: none; }
.docs-item__icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--surface); color: var(--corporate-blue); }
.docs-item__icon svg { width: 20px; height: 20px; }
.docs-item__text { flex: 1; min-width: 0; }
.docs-item__text b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-item__text span { color: var(--muted); font-size: 13.5px; }
.docs-item .chip { flex: none; }
.docs-help { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.docs-sign { margin-top: 14px; }
.docs-filter { padding: 18px 0 0; }
.docs-source { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .docs-item { flex-wrap: wrap; }
  .docs-item .chip { margin-left: 52px; }
}

/* Deck: Documents card */
.docs-card__figure { margin: 26px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--orange); font-variant-numeric: lining-nums; }
.docs-card__figure.is-clear { color: var(--success); }
.docs-card__label { margin: 6px 0 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.docs-card .docs-list { margin-top: 16px; }
.docs-all .pay__month { margin-left: auto; }

/* Leave requests */
.leave__request { margin-top: 18px; align-self: flex-start; }
.leave .card__body { display: flex; flex-direction: column; }
.leave__requests { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.leave__requests li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #fdf3dc; font-size: 13.5px; }
.leave__requests b { color: #7a5a0c; }
.leave__requests .link-btn { font-size: 13px; padding: 2px 4px; }
.leave-preview { margin: -4px 0 16px; padding: 12px 14px; border-radius: 8px; background: var(--teal-wash); font-size: 14.5px; }
.leave-preview b { font-family: var(--font-display); font-size: 20px; }
.leave-preview.is-error { background: #fbeeed; color: #7d1a15; }
.leave-note { height: auto; padding: 10px 14px; resize: vertical; }
.field__hint--inline { display: inline; margin: 0; }

/* My Deck ⇄ My Homes switch (managers only) */
.view-switch {
  display: inline-flex; gap: 4px; margin-bottom: 16px; padding: 4px;
  border-radius: 99px; background: #ecebe5; border: 1px solid var(--line);
}
.view-switch a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 99px;
  color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none;
}
.view-switch a svg { width: 16px; height: 16px; }
.view-switch a:hover { color: var(--ink); text-decoration: none; }
.view-switch a[aria-current="page"] { background: var(--teal-dark); color: #fff; box-shadow: 0 4px 12px -4px rgb(44 74 86 / .5); }

/* ── Manager view ─────────────────────────────────────────────────────────── */
.mgr-homes { padding: 0 0 6px; }
.mgr-updated { margin: 4px 0 20px; color: var(--muted); font-size: 13px; }
.mgr-deck { margin-top: 0; }
.mgr-card.is-alert::before { background: var(--orange); }
.mgr-card:not(.is-alert)::before { background: var(--corporate-blue); }
.mgr-sub { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mgr-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.mgr-sub + .mgr-list { margin-top: 0; }
.mgr-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #f3f2ed; font-size: 14px; min-width: 0; }
.mgr-person { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.mgr-person small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgr-open { color: var(--danger); }
.mgr-time { flex: none; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.mgr-list .chip { flex: none; }
.chip--fa { background: #e9f4ec; color: #2f6b45; font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.mgr-note { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
.mgr-period { margin: 18px 0 0; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.mgr-hours { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.mgr-hours li { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; align-items: center; gap: 10px; font-size: 13.5px; }
.mgr-bar { height: 7px; border-radius: 99px; background: #edece6; overflow: hidden; }
.mgr-bar span { display: block; height: 100%; width: 0; background: var(--corporate-blue); border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.training__stat--valid strong, .training__stat--expired strong, .training__stat--expiring strong { font-variant-numeric: lining-nums; }

.mgr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.mgr-tile { display: flex; flex-direction: column; gap: 14px; padding: 26px 24px 22px; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); }
.mgr-tile::before { background: var(--corporate-blue); }
.mgr-tile:hover { box-shadow: 0 1px 2px rgb(44 74 86 / .05), 0 14px 34px rgb(44 74 86 / .12); }
.mgr-tile__name { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.mgr-kpis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mgr-kpis li { padding: 10px 12px; border-radius: 8px; background: #f3f2ed; }
.mgr-kpis b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: lining-nums; }
.mgr-kpis span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.mgr-kpis li.is-bad { background: #fdeee3; }
.mgr-kpis li.is-bad b { color: var(--orange-text); }
.mgr-tile .card__more { margin-top: auto; }

/* ── Open shifts (Deck card + Rota) ─────────────────────────────────────────── */
.open-card::before { background: #fbc13d; }
.open-card .icon-tile--orange { background: rgb(251 193 61 / 0.22); color: #8a5f00; }
.open-card .docs-card__figure { color: #b07d0a; }
.open-card__clashes { color: var(--danger); }
.open-list { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.open-list li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: rgb(251 193 61 / 0.14); box-shadow: inset 3px 0 0 #fbc13d; font-size: 14px; }
.open-list b { font-size: 14.5px; }
.open-list span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.open-list svg { flex: none; width: 14px; height: 14px; }
.open-list li.is-clash { background: #fbeeed; box-shadow: inset 3px 0 0 var(--danger); }
.open-list .open-list__clash { align-items: flex-start; color: var(--danger); }
.open-list .open-list__clash svg { margin-top: 2px; }
.open-card__more { margin: 12px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; }
.open-card__links { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: auto; }
.rota__day-sub { margin: 22px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8a5f00; }
.rota__day-list li.is-open { background: rgb(251 193 61 / 0.14); }
.rota__day-list li.is-clash { background: #fbeeed; }
.rota__day-list .open-clash { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--danger); font-weight: 600; }
.rota__day-list .open-clash svg { width: 14px; height: 14px; }
.chip--open { background: rgb(251 193 61 / 0.30); color: #6b4a00; }
.chip--clash, .rota__day-list .chip--clash { background: #fff; color: var(--danger); font-weight: 700; outline: 1.5px solid var(--danger); outline-offset: -1.5px; }
.rota-key__day--clash { border: 1.5px solid var(--danger); background: #fbeeed; }

/* ── Expenses (Pleo) ─────────────────────────────────────────────────────── */
.exp-item { cursor: default; }
.exp-item:hover { background: #f3f2ed; }
.exp-item__amount { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.exp-month { display: flex; justify-content: space-between; margin: 24px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.exp-month span { letter-spacing: 0; text-transform: none; color: var(--ink); font-size: 14px; }
.exp-more { padding: 6px 4px; color: var(--muted); font-weight: 600; font-size: 14px; }
.exp-summary + .docs-all { margin-top: 24px; }
.exp-summary .training__stats { margin-top: 22px; }
.exp-list li.is-clash { background: #fbeeed; box-shadow: inset 3px 0 0 var(--danger); }
@media (max-width: 760px) {
  .exp-item { flex-wrap: wrap; }
  .exp-item .exp-item__amount { margin-left: 52px; }
}
.exp-card__spent { margin: 10px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.exp-card__spent b { color: var(--ink); }
.card--third .open-list { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; }
.card--third .open-list li { padding: 10px 12px; }
.card--third .open-card__links { padding-top: 4px; gap: 0 20px; }

/* ── On-call card (managers) ─────────────────────────────────────────────── */
.oncall { margin-top: 22px; padding: 14px 16px; border-radius: 8px; background: #f3f2ed; }
.oncall + .oncall { margin-top: 12px; }
.oncall:first-child { background: var(--orange-wash); box-shadow: inset 3px 0 0 var(--orange); }
.oncall__name { margin: 4px 0 6px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.oncall__line { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 0; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.oncall__line span { min-width: 0; overflow-wrap: break-word; }
.oncall__line svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.oncall__when { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.oncall.is-unassigned .oncall__name { color: var(--danger); }
.admin-help { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.admin-sub { margin: 26px 0 12px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.oncall-form { flex-wrap: wrap; align-items: flex-end; }
.oncall-form .field--inline { margin: 0; }
.members tr.is-current td { background: var(--orange-wash); }
.mgr-home-pick { flex: none; }
.mgr-home-pick select { min-width: 220px; height: 40px; border-radius: 99px; padding-left: 16px; font-weight: 600; }
.mgr-home-pick.is-active select { background-color: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }

/* ── Homes rota (senior leaders) ─────────────────────────────────────────── */
.hr-card + .hr-card, .hr-pair { margin-top: 24px; }
.hr-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.hr-pair .hr-card { margin-top: 0; }
.hr-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hr-week { min-width: 190px; margin: 0; text-align: center; font-weight: 700; }
.hr-key { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.hr-scroll { margin-top: 16px; overflow-x: auto; }
.hr-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 4px; font-size: 14px; }
.hr-table thead th { padding: 6px 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: center; }
.hr-table thead th span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hr-table thead th.is-today { color: var(--orange-text); }
.hr-table tbody th { padding: 8px 10px 8px 0; text-align: left; font-weight: 700; white-space: nowrap; }
.hr-table td { padding: 8px 6px; border-radius: 8px; background: #f3f2ed; text-align: center; vertical-align: top; }
.hr-table td.is-today { box-shadow: inset 0 0 0 2px var(--orange); }
.hr-table td.has-open { background: rgb(251 193 61 / 0.18); }
.hr-n { display: block; font-variant-numeric: tabular-nums; font-weight: 600; }
.hr-open { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 99px; background: #fbc13d; color: #4a3500; font-size: 11.5px; font-weight: 700; }
.hr-key .hr-open { margin-top: 0; }
.hr-error { color: var(--danger); font-weight: 600; }
.hr-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.hr-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 8px; background: #f3f2ed; }
.hr-list li > div { flex: 1; min-width: 160px; }
.hr-list b { display: block; font-size: 15px; }
.hr-list li > div span, .hr-dates { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.hr-list li.is-current { background: var(--orange-wash); box-shadow: inset 3px 0 0 var(--orange); }
.hr-list li.is-unassigned b { color: var(--danger); }
.hr-call { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink); }
.hr-call svg { width: 15px; height: 15px; }
.hr-empty { color: var(--muted); }
@media (max-width: 900px) { .hr-pair { grid-template-columns: minmax(0, 1fr); } }
.hr-clash { display: inline-flex; align-items: center; gap: 5px; flex-basis: 100%; color: var(--danger); font-size: 13.5px; font-weight: 700; }
.hr-clash svg { width: 14px; height: 14px; }
.hr-list li.has-clash { box-shadow: inset 3px 0 0 var(--danger); }
/* Open-shift requests */
.open-req { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.open-req__btn { padding: 6px 12px; font-size: 13px; }
.open-req__link { padding: 0; border: 0; background: none; color: var(--orange-text); font-weight: 600; font-size: 13px; cursor: pointer; }
.open-decisions { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.open-decisions .chip { margin-right: 4px; }
button.chip { border: 0; cursor: pointer; font-family: inherit; }
button.chip:disabled { opacity: .6; cursor: default; }
.rota__day-list li .chip + .chip { margin-left: 6px; }
.sr-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sr-list > li { padding: 10px 12px; border-radius: 8px; background: rgb(251 193 61 / 0.14); box-shadow: inset 3px 0 0 #fbc13d; }
.sr-shift { margin: 0 0 6px; font-size: 14px; }
.sr-req { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0 0; border-top: 1px solid rgb(0 0 0 / 0.06); }
.sr-req:first-of-type { border-top: 0; }
.sr-req small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.sr-req .sr-clash { display: flex; align-items: center; gap: 4px; color: var(--danger); font-weight: 600; }
.sr-req .sr-clash svg { width: 13px; height: 13px; }
.sr-actions { display: flex; gap: 6px; }
.sr-actions .btn { padding: 6px 12px; font-size: 13px; }
