:root {
  color-scheme: dark;
  --bg: #08101f;
  --bg-deep: #050a14;
  --sidebar: #0b1220;
  --sidebar-strong: #0f172a;
  --card: rgba(15, 23, 42, .82);
  --card-solid: #111a2d;
  --panel: rgba(17, 24, 39, .72);
  --ink: #eef6ff;
  --muted: #91a0b8;
  --muted-strong: #bac7da;
  --border: rgba(148, 163, 184, .18);
  --accent: #38bdf8;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 14%, rgba(59, 130, 246, .20), transparent 30rem),
    radial-gradient(circle at 86% 8%, rgba(139, 92, 246, .22), transparent 28rem),
    linear-gradient(145deg, var(--bg-deep), var(--bg) 42%, #0b1220);
  color: var(--ink);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 78%);
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(11, 18, 32, .96), rgba(9, 15, 29, .92));
  border-right: 1px solid var(--border);
  box-shadow: 18px 0 70px rgba(0, 0, 0, .35);
  backdrop-filter: blur(22px);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem .6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 0 34px rgba(56, 189, 248, .34), inset 0 1px 0 rgba(255,255,255,.35);
}
.sidebar-brand h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.sidebar-brand > div,
.topbar-account-copy,
.nav-link span:last-child {
  min-width: 0;
}
.eyebrow {
  margin: 0 0 .35rem;
  color: #80d8ff;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  font-weight: 800;
}

.portal-nav {
  display: grid;
  gap: .55rem;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 46px;
  padding: .72rem .85rem;
  color: var(--muted-strong);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
.nav-link:hover {
  transform: translateX(2px);
  color: white;
  background: rgba(148, 163, 184, .09);
  border-color: var(--border);
}
.nav-link.active {
  color: white;
  background: linear-gradient(135deg, rgba(37, 99, 235, .98), rgba(124, 58, 237, .98));
  box-shadow: 0 14px 38px rgba(79, 70, 229, .34), inset 0 1px 0 rgba(255,255,255,.25);
}
.nav-glyph {
  display: grid;
  place-items: center;
  width: 24px;
  opacity: .94;
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 14px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #22d3ee, #a855f7);
}
.logout-form { margin: 0; }
.logout-button, .link-button {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 999px;
  padding: .72rem .95rem;
  color: #dbeafe;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}
.logout-button:hover, .link-button:hover { background: rgba(255,255,255,.12); }

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.content-shell {
  grid-column: 2;
  width: min(1180px, calc(100vw - 250px - 3rem));
  padding: 1.4rem 0 3rem;
}
.shell-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.topbar-account-actions {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .28rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  background: rgba(15, 23, 42, .62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 38px rgba(0,0,0,.18);
}
.topbar-account-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .18rem .4rem .18rem .18rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}
.topbar-account-link:hover,
.topbar-account-link:focus-visible {
  background: rgba(255,255,255,.08);
  outline: 3px solid rgba(56, 189, 248, .75);
  outline-offset: 2px;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  font-size: .9rem;
}
.topbar-account-copy {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}
.topbar-account-copy strong {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
}
.topbar-account-copy small {
  color: var(--muted);
  font-size: .72rem;
  text-transform: capitalize;
}
.topbar-logout-form { margin: 0; }
.topbar-logout-button {
  width: auto;
  min-height: 34px;
  padding: .42rem .72rem;
  font-size: .84rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  color: #bbf7d0;
  font-size: .86rem;
  font-weight: 800;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(52, 211, 153, .28);
  box-shadow: 0 0 28px rgba(52, 211, 153, .12);
}
.status-pill span { color: var(--success); }

.topbar {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  color: white;
}
.auth-topbar { text-align: center; }
.auth-topbar h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 3rem); }
.auth-shell {
  width: min(520px, calc(100% - 2rem));
  margin-top: 2rem;
}

.hero-card, .dashboard-section, .auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(15, 23, 42, .86), rgba(17, 24, 39, .66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.35rem, 4vw, 2.35rem);
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 20rem;
  height: 20rem;
  right: -8rem;
  top: -9rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, .26), rgba(139, 92, 246, .10) 45%, transparent 68%);
  pointer-events: none;
}
.hero-card h2 {
  position: relative;
  margin: 0;
  max-width: 920px;
  font-size: clamp(2.35rem, 5vw, 4.65rem);
  line-height: .98;
  letter-spacing: -.07em;
  font-weight: 950;
  background: linear-gradient(90deg, #ffffff 4%, #8bdcff 42%, #a78bfa 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-card p {
  position: relative;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}
.dashboard-hero { margin-bottom: 1rem; }
.dashboard-control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .86fr);
  gap: clamp(1rem, 3vw, 1.6rem);
  align-items: stretch;
  padding: clamp(1.1rem, 3vw, 1.7rem);
}
.dashboard-control-panel h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  padding-bottom: .08em;
}
.dashboard-hero .hero-copy {
  font-size: 1rem;
  margin-bottom: 0;
}
.dashboard-hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}
.dashboard-priority-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.staff-dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(240px, .42fr);
  gap: clamp(.75rem, 2vw, 1rem);
  padding: clamp(.85rem, 2.2vw, 1.15rem);
}
.staff-dashboard-hero h2 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
}
.staff-dashboard-hero .hero-copy {
  max-width: 38rem;
  line-height: 1.45;
}
.staff-dashboard-hero-no-shift {
  grid-template-columns: minmax(0, 1fr) minmax(220px, .32fr);
  padding-block: clamp(.72rem, 1.8vw, .95rem);
}
.staff-dashboard-hero-no-shift .dashboard-hero-copy {
  align-self: center;
}
.staff-dashboard-hero-no-shift h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
}
.staff-dashboard-hero-no-shift .hero-copy {
  margin-top: .15rem;
}
.staff-dashboard-hero-has-actions {
  grid-template-columns: minmax(0, 1fr) minmax(210px, .28fr);
  padding-block: clamp(.62rem, 1.55vw, .82rem);
}
.staff-dashboard-hero-has-actions .dashboard-hero-copy {
  align-self: center;
}
.staff-dashboard-hero-has-actions .dashboard-hero-copy .eyebrow {
  margin-bottom: .16rem;
}
.staff-dashboard-hero-has-actions h2 {
  font-size: clamp(1.45rem, 2.35vw, 1.9rem);
  line-height: 1.02;
}
.staff-dashboard-hero-has-actions .hero-copy {
  margin-top: .12rem;
  font-size: .92rem;
  line-height: 1.32;
}
.staff-dashboard-hero-has-actions .staff-next-shift-card {
  min-height: 88px;
  padding: .62rem .72rem;
  border-radius: 18px;
}
.staff-dashboard-hero-has-actions .staff-next-shift-card strong {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}
.staff-dashboard-hero-has-actions .staff-next-shift-card-empty {
  min-height: 62px;
}
.staff-next-shift-card {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: .32rem;
  min-height: 118px;
  padding: .8rem;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 22px;
  background: rgba(8, 16, 31, .52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.staff-next-shift-card-empty {
  min-height: 76px;
  align-content: center;
  gap: .22rem;
  padding: .62rem .75rem;
  border-color: rgba(148, 163, 184, .18);
  background: rgba(8, 16, 31, .38);
}
.staff-next-shift-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, .38);
  background: rgba(15, 23, 42, .76);
}
.staff-next-shift-card strong {
  color: var(--accent);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.staff-next-shift-card.staff-next-shift-card-empty strong {
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.18rem);
  letter-spacing: -.02em;
}
.staff-next-shift-card small,
.staff-focus-label {
  color: var(--muted-strong);
  font-weight: 850;
}
.staff-next-shift-card.staff-next-shift-card-empty small {
  line-height: 1.25;
}
.priority-tile {
  display: grid;
  align-content: space-between;
  min-height: 118px;
  padding: .85rem;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 20px;
  background: rgba(8, 16, 31, .46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.priority-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, .34);
  background: rgba(15, 23, 42, .72);
}
.priority-tile span {
  color: var(--muted-strong);
  font-size: .86rem;
  font-weight: 850;
}
.priority-tile strong {
  color: var(--accent);
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.priority-tile small {
  color: var(--muted);
  line-height: 1.35;
}
.dashboard-action-bar {
  position: sticky;
  top: max(.6rem, calc(env(safe-area-inset-top) + .45rem));
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: .95rem 1rem;
}
.staff-dashboard-action-bar {
  position: static;
  margin-top: .75rem;
  padding: .7rem .85rem;
  gap: .7rem;
}
.staff-dashboard-action-bar .compact-heading .eyebrow {
  margin-bottom: .12rem;
}
.staff-dashboard-action-bar .compact-heading h3 {
  font-size: 1.05rem;
}
.staff-dashboard-action-bar .quick-action-grid {
  gap: .42rem;
}
.staff-dashboard-action-bar .quick-action-grid a {
  min-height: 36px;
  padding: .48rem .72rem;
  font-size: .86rem;
}
.dashboard-action-bar .section-heading { margin-bottom: 0; }
.compact-heading h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
.quick-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: flex-end;
}
.quick-action-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .65rem .9rem;
  color: #dbeafe;
  font-weight: 850;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  background: rgba(8, 16, 31, .42);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.quick-action-grid a:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, .30);
  background: rgba(37, 99, 235, .18);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.summary-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(15, 23, 42, .72));
  box-shadow: 0 18px 55px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
  text-decoration: none;
}
.compact-summary-grid { gap: .8rem; }
.compact-summary-card {
  min-height: 132px;
  padding: 1rem;
}
.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.summary-label {
  display: block;
  min-height: 2.4em;
  color: var(--muted-strong);
  font-weight: 800;
  margin-bottom: .85rem;
}
.summary-count {
  display: block;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: .95;
  letter-spacing: -.06em;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(56, 189, 248, .18);
}
.summary-card:nth-child(2) .summary-count { color: #a78bfa; }
.summary-card:nth-child(3) .summary-count { color: #34d399; }
.summary-card:nth-child(4) .summary-count { color: #f0abfc; }
.summary-card p { color: var(--muted); line-height: 1.55; }

.dashboard-section {
  margin-top: 1rem;
  padding: 1.15rem;
}
.today-action-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.today-action-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: 2rem;
  padding: .16rem .6rem;
  border: 1px solid rgba(125, 211, 252, .26);
  border-radius: 999px;
  color: #e0f2fe;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  background: rgba(14, 165, 233, .16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.today-action-count:hover,
.today-action-count:focus-visible {
  color: white;
  background: rgba(14, 165, 233, .26);
}
.attention-layout {
  border-color: rgba(251, 191, 36, .22);
  background: linear-gradient(145deg, rgba(30, 22, 9, .50), rgba(15, 23, 42, .78));
}
.manager-attention-details {
  padding: 0;
  overflow: hidden;
}
.manager-attention-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 46px;
  padding: .85rem 1rem;
  color: #fde68a;
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}
.manager-attention-details > summary::after {
  content: "Open lists";
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.manager-attention-details[open] > summary {
  border-bottom: 1px solid rgba(251, 191, 36, .18);
}
.manager-attention-details[open] > summary::after { content: "Hide lists"; }
.manager-attention-heading,
.manager-attention-grid {
  margin: 1rem;
}
.manager-attention-heading .hint {
  margin: .35rem 0 0;
  color: var(--muted);
}
.manager-attention-grid { gap: .75rem; }
.compact-dashboard-list { gap: .5rem; }
.compact-dashboard-list li { padding: .62rem .7rem; }
.rota-watch-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.rota-watch-card {
  display: grid;
  gap: .35rem;
  color: inherit;
  text-decoration: none;
}
.rota-watch-card strong {
  display: block;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.rota-watch-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.section-heading {
  display: block;
  margin-bottom: 1rem;
}
.section-heading h3 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  letter-spacing: -.04em;
}
.section-heading .eyebrow { color: #a78bfa; }
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.action-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: rgba(8, 16, 31, .44);
}
.action-panel h4 { margin: 0 0 .75rem; }
.dashboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .75rem;
}
.dashboard-list li {
  display: grid;
  gap: .25rem;
  padding: .75rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, .06);
}
.dashboard-list a {
  color: #bfdbfe;
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.dashboard-list a:hover { color: white; text-decoration: underline; }
.dashboard-list span, .empty-state {
  color: var(--muted);
  font-size: .95rem;
}
.compact-review-list li {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: .6rem;
}
.compact-review-list li > div:first-child {
  display: grid;
  gap: .22rem;
  min-width: 0;
}
.inline-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}
.inline-review-actions .inline-form {
  margin: 0;
}
.inline-review-actions button {
  min-height: 34px;
  margin: 0;
  padding: .42rem .65rem;
  white-space: nowrap;
}
.dashboard-list-overflow {
  margin-top: .8rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .38);
}
.dashboard-list-overflow > summary {
  min-height: 44px;
  padding: .72rem .85rem;
  color: #dbeafe;
  font-weight: 850;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.dashboard-list-overflow[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.dashboard-list-overflow-items {
  padding: .75rem;
}
.dashboard-list-more {
  display: inline-flex;
  margin: 0 .75rem .85rem;
  color: #bfdbfe;
  font-weight: 850;
  text-decoration: none;
}
.dashboard-list-more:hover,
.dashboard-list-more:focus-visible {
  color: white;
  text-decoration: underline;
}
.today-action-panel {
  min-width: 0;
}
.staff-today-actions-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .7rem;
}
.staff-today-actions-grid .today-action-panel {
  padding: .72rem;
  border-radius: 18px;
  background: rgba(8, 16, 31, .38);
}
.staff-today-actions-grid .today-action-heading {
  margin-bottom: .48rem;
  font-size: .98rem;
  line-height: 1.12;
}
.staff-today-actions-grid .dashboard-list {
  gap: .42rem;
}
.staff-today-actions-grid .dashboard-list li {
  padding: .52rem .58rem;
  border-radius: 12px;
}
.staff-today-actions-grid .dashboard-list span,
.staff-today-actions-grid .empty-state {
  font-size: .86rem;
  line-height: 1.25;
}
.staff-today-actions-grid .dashboard-list-overflow {
  margin-top: .5rem;
}
.staff-today-actions-grid .dashboard-list-overflow > summary {
  min-height: 38px;
  padding: .56rem .65rem;
  font-size: .86rem;
}
@media (max-width: 559.98px) {
  .staff-today-actions-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .staff-today-actions-grid .today-action-panel {
    padding: .62rem;
  }
  .staff-today-actions-grid .today-action-heading {
    margin-bottom: .38rem;
  }
}
.staff-empty-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .85fr);
  gap: .75rem;
  align-items: stretch;
}
.staff-caught-up-card,
.staff-rota-prompt-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
}
.staff-caught-up-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, .13), rgba(52, 211, 153, .10)), rgba(8, 16, 31, .48);
}
.staff-caught-up-card::before {
  content: "✓";
  position: absolute;
  inset: .85rem .95rem auto auto;
  color: rgba(52, 211, 153, .42);
  font-size: 2.5rem;
  font-weight: 950;
  line-height: 1;
}
.staff-caught-up-card h4,
.staff-rota-prompt-card h4 {
  margin: .2rem 0 .35rem;
  font-size: clamp(1.08rem, 2.5vw, 1.35rem);
}
.staff-caught-up-card p,
.staff-rota-prompt-card p {
  margin: 0;
  color: var(--muted-strong);
}
.staff-caught-up-card p { max-width: 46rem; }
.staff-rota-prompt-card {
  display: grid;
  gap: .38rem;
  align-content: start;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(14, 165, 233, .10)), rgba(8, 16, 31, .44);
}
.staff-rota-prompt-card .link-button {
  width: fit-content;
  min-height: 38px;
  margin-top: .25rem;
  text-decoration: none;
  font-weight: 900;
}
@media (max-width: 559.98px) {
  .staff-empty-dashboard-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .staff-caught-up-card,
  .staff-rota-prompt-card {
    min-height: 0;
    padding: .72rem;
  }
  .staff-rota-prompt-card .link-button {
    width: 100%;
    justify-content: center;
  }
}
.empty-state { margin: 0; }

.flash-messages { display: grid; gap: .75rem; margin-bottom: 1rem; }
.flash, .flash-list .flash {
  margin: 0;
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(59, 130, 246, .12);
  color: #dbeafe;
}
.flash-error, .flash.error { background: rgba(251, 113, 133, .13); color: #fecdd3; border-color: rgba(251, 113, 133, .28); }
.flash-success, .flash.success { background: rgba(52, 211, 153, .13); color: #bbf7d0; border-color: rgba(52, 211, 153, .28); }
.flash-list { list-style: none; padding: 0; display: grid; gap: .6rem; }

.auth-card { padding: clamp(1.35rem, 5vw, 2rem); }
.auth-card h2 { margin-top: 0; font-size: 2rem; }
.auth-card p, label { color: var(--muted-strong); }
form label { display: block; margin: 1rem 0 .4rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  color: var(--ink);
  background: rgba(8, 16, 31, .72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .78rem .9rem;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(56, 189, 248, .7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .12);
}
form button[type="submit"]:not(.logout-button), .auth-card button[type="submit"] {
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  padding: .82rem 1.1rem;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 14px 34px rgba(79, 70, 229, .28);
  cursor: pointer;
}
form button.button-secondary[type="submit"] {
  background: linear-gradient(135deg, rgba(37, 99, 235, .92), rgba(14, 165, 233, .88));
}
form button.button-danger[type="submit"] {
  background: linear-gradient(135deg, #dc2626, #fb7185);
  box-shadow: 0 14px 34px rgba(251, 113, 133, .24);
}

.panel {
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(15, 23, 42, .86), rgba(17, 24, 39, .66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow-x: auto;
}
.panel h3 { margin: 0 0 1rem; font-size: clamp(1.2rem, 3vw, 1.65rem); letter-spacing: -.03em; }
.panel[role="tabpanel"]:focus-visible {
  outline: 3px solid rgba(56, 189, 248, .42);
  outline-offset: 3px;
}
.panel h4 { margin: 0 0 .75rem; }
.panel p, .panel li, .panel dd, .panel dt { color: var(--muted-strong); }
.panel a { color: #bfdbfe; font-weight: 800; text-decoration-thickness: .08em; text-underline-offset: .18em; }

.stacked-form {
  display: grid;
  gap: .9rem;
}
.stacked-form label { margin: 0; }
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .7rem;
  margin: .35rem 0;
}
.inline-form label { margin: 0; min-width: min(100%, 12rem); flex: 1 1 12rem; }
.inline-form input, .inline-form select, .inline-form textarea { min-width: 10rem; }
.inline-form button[type="submit"] { width: auto; }

.checklist-list {
  display: grid;
  gap: 1rem;
}
.checklist-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin: -.35rem 0 .85rem;
}
.checklist-summary-strip:has(> .checklist-summary-pill:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.checklist-summary-pill {
  display: grid;
  align-content: center;
  min-height: 68px;
  padding: .75rem .9rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, rgba(15, 23, 42, .76), rgba(17, 24, 39, .48));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.checklist-summary-pill:hover,
.checklist-summary-pill:focus-visible {
  border-color: rgba(56, 189, 248, .44);
  outline: 3px solid rgba(56, 189, 248, .30);
  outline-offset: 2px;
}
.checklist-summary-pill strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
}
.checklist-summary-pill span {
  color: var(--muted-strong);
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.checklist-summary-pill-warning { border-color: rgba(251, 191, 36, .30); }
.checklist-summary-pill-warning strong { color: #fde68a; }
.checklist-summary-pill-success { border-color: rgba(52, 211, 153, .30); }
.checklist-summary-pill-success strong { color: #bbf7d0; }
.checklist-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 31, .48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.checklist-card h4 { color: var(--ink); font-size: 1.1rem; }
.checklist-items { display: grid; gap: .65rem; padding-left: 1.25rem; }
.checklist-item-overflow {
  margin-top: .75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .38);
}
.checklist-item-overflow > summary {
  min-height: 44px;
  padding: .7rem .85rem;
  color: #dbeafe;
  font-weight: 850;
  cursor: pointer;
}
.checklist-items-overflow {
  padding: .75rem .75rem .75rem 2rem;
}
.checklist-items li {
  padding: .58rem .62rem;
  border-radius: 14px;
  background: rgba(148, 163, 184, .06);
}
.checklist-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem .75rem;
}
.checklist-item-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}
.checklist-item-action {
  margin: 0;
  display: flex;
  justify-content: flex-end;
}
.checklist-item-action button[type="submit"] {
  width: auto;
  min-height: 38px;
  padding: .48rem .75rem;
  font-size: .86rem;
  white-space: nowrap;
}
.checklist-item-status {
  justify-self: end;
  margin-top: 0;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  width: fit-content;
  margin-top: .35rem;
  padding: .38rem .65rem;
  border-radius: 999px;
  color: #bbf7d0;
  font-size: .85rem;
  font-weight: 800;
  background: rgba(16, 185, 129, .13);
  border: 1px solid rgba(52, 211, 153, .28);
}
.meta, .hint {
  color: var(--muted);
  font-size: .92rem;
}
.hint { font-style: italic; }
.fault-history, .document-management, .account-details {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .30);
}
.fault-history ul, .acknowledgement-summary ul { display: grid; gap: .45rem; padding-left: 1.2rem; }
.document-management { display: grid; gap: 1rem; }
.account-details dl {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: .6rem 1rem;
  margin: 0;
}
.account-details dt { color: var(--muted); font-weight: 800; }
.account-details dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.acknowledgement-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
}
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--muted-strong);
}
thead, tbody, tr { min-width: max-content; }
th, td {
  padding: .75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--ink);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, .08);
}
td { background: rgba(8, 16, 31, .28); overflow-wrap: anywhere; }
tr:hover td { background: rgba(148, 163, 184, .06); }

.asset-register-table {
  width: 100%;
}
.asset-register-table td[data-label="Asset"] strong,
.asset-register-table td[data-label="Added by"],
.asset-register-table td[data-label="Notes"] {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.asset-register-table .badge {
  margin-top: 0;
}

@media (max-width: 640px) {
  .asset-table-wrapper {
    overflow-x: visible;
  }
  .asset-register-table,
  .asset-register-table tbody,
  .asset-register-table tr,
  .asset-register-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .asset-register-table {
    overflow-x: visible;
  }
  .asset-register-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .asset-register-table tr {
    margin-bottom: .85rem;
    padding: .85rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 20px;
    background: rgba(8, 16, 31, .46);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  }
  .asset-register-table td {
    display: grid;
    grid-template-columns: minmax(5.8rem, .35fr) minmax(0, 1fr);
    gap: .45rem .7rem;
    align-items: start;
    padding: .62rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background: transparent;
  }
  .asset-register-table tr:hover td {
    background: transparent;
  }
  .asset-register-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .asset-register-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .asset-register-table td[data-label="Asset"] strong {
    display: block;
    line-height: 1.18;
  }
  .asset-register-table td[data-label="Status"] .meta,
  .asset-register-table td[data-label="Asset"] .meta {
    display: block;
    margin-top: .28rem;
  }
  .asset-register-table td[data-label="Manage"] {
    display: block;
  }
  .asset-register-table td[data-label="Manage"]::before {
    display: block;
    margin-bottom: .45rem;
  }
  .asset-register-table .compact-details summary {
    width: 100%;
    padding: .72rem .85rem;
    border: 1px solid rgba(125, 211, 252, .24);
    border-radius: 16px;
    color: #dbeafe;
    background: rgba(37, 99, 235, .12);
  }
  .asset-register-table .compact-details[open] summary {
    margin-bottom: .65rem;
  }
}

.labour-cost-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .7rem;
  margin: .8rem 0 1rem;
}
.labour-cost-strip .metric-card {
  min-width: 0;
  padding: .7rem .8rem;
}
.labour-cost-strip .metric-card strong {
  margin: .15rem 0 0;
  font-size: 1.38rem;
}
.labour-cost-table {
  display: table;
  width: 100%;
  min-width: 760px;
}
.labour-cost-table th:not(:first-child),
.labour-cost-table td:not(:first-child) {
  white-space: nowrap;
  overflow-wrap: normal;
}
.labour-cost-table td:first-child {
  min-width: 18rem;
}

.staff-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  gap: 1rem;
}
.staff-admin-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 31, .38);
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 0;
  color: var(--muted-strong);
}
.checkbox-row input {
  width: auto;
  margin-top: .25rem;
  accent-color: var(--accent);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}
.form-actions button[type="submit"] { width: auto; }
.temporary-password-panel strong {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: .7rem .85rem;
  border-radius: 14px;
  color: #ecfeff;
  background: rgba(6, 182, 212, .16);
  border: 1px solid rgba(103, 232, 249, .30);
}
.staff-directory-panel { overflow: visible; }
.staff-filters {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) repeat(2, minmax(10rem, .45fr));
  gap: .8rem;
  align-items: end;
  width: min(100%, 48rem);
}
.staff-filters label { margin: 0; }
.staff-card-list {
  display: grid;
  gap: 1rem;
}
.staff-card {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: var(--radius-lg);
  background: rgba(8, 16, 31, .42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.staff-card[hidden] { display: none; }
.staff-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.staff-card-header h4 {
  margin: 0 0 .3rem;
  font-size: 1.18rem;
}
.staff-card-header a { overflow-wrap: anywhere; }
.staff-status { text-transform: capitalize; }
.staff-status-inactive {
  color: #fecaca;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(248, 113, 113, .28);
}
.staff-card-details {
  border-top: 1px solid var(--border);
  padding-top: .85rem;
}
.staff-card-details summary {
  width: fit-content;
  cursor: pointer;
  color: #bfdbfe;
  font-weight: 900;
}
.staff-manage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, .65fr);
  gap: .9rem;
  align-items: start;
  margin-top: .9rem;
}
.staff-edit-form { margin-top: 0; }
.staff-sensitive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  align-items: center;
  align-self: stretch;
  border-left: 1px solid rgba(248, 113, 113, .14);
  padding-left: .85rem;
}
.staff-sensitive-actions .inline-form {
  padding: .65rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, .45);
}
.staff-import-table { width: 100%; }
.staff-import-table td { vertical-align: top; }
.import-ready td:last-child { color: #bbf7d0; font-weight: 800; }
.import-error td:last-child { color: #fecaca; font-weight: 800; }


@media (max-width: 720px) {
  .staff-import-table,
  .document-ack-table,
  .labour-cost-table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .staff-import-table thead,
  .document-ack-table thead,
  .labour-cost-table thead {
    display: none;
  }
  .staff-import-table tbody,
  .staff-import-table tr,
  .staff-import-table td,
  .document-ack-table tbody,
  .document-ack-table tr,
  .document-ack-table td,
  .labour-cost-table tbody,
  .labour-cost-table tr,
  .labour-cost-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .staff-import-table tr,
  .document-ack-table tr,
  .labour-cost-table tr {
    margin-bottom: .7rem;
    padding: .75rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(8, 16, 31, .38);
  }
  .staff-import-table td,
  .document-ack-table td,
  .labour-cost-table td,
  .labour-cost-table td:first-child {
    padding: .48rem 0;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .staff-import-table td:last-child,
  .document-ack-table td:last-child,
  .labour-cost-table td:last-child {
    border-bottom: 0;
  }
  .staff-import-table td::before,
  .document-ack-table td::before,
  .labour-cost-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .22rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
}

@media (max-width: 720px) {
  .checklist-summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .staff-filters {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .staff-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
  }
  .staff-status {
    white-space: nowrap;
  }
  .staff-manage-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .staff-sensitive-actions {
    border-left: 0;
    border-top: 1px solid rgba(248, 113, 113, .14);
    padding-left: 0;
    padding-top: .85rem;
  }
  .staff-sensitive-actions,
  .staff-sensitive-actions .inline-form {
    width: 100%;
  }
  .staff-sensitive-actions button {
    width: 100%;
  }
}

/* Compatibility for legacy account-link classes if older pages render them. */
.account-link { color: #bfdbfe; }

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero-card h2 {
    background: none;
    color: #f8fbff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .nav-link:hover { transform: none; }
}

@media (forced-colors: active) {
  body, body::before, .sidebar, .hero-card, .dashboard-section, .auth-card, .panel, .summary-card, .action-panel, .checklist-card, .fault-history, .document-management, .account-details {
    background: Canvas;
    box-shadow: none;
  }
  .hero-card h2 {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
  .brand-mark, .avatar, .nav-link.active, form button[type="submit"]:not(.logout-button), .auth-card button[type="submit"] {
    background: ButtonFace;
    color: ButtonText;
  }
  a, .dashboard-list a, .panel a, .account-link { color: LinkText; }
  .status-pill, .badge, input, textarea, select, th, td, .logout-button, .link-button {
    border: 1px solid CanvasText;
  }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: relative;
    width: auto;
    min-height: auto;
    inset: auto;
    margin: .8rem;
    border: 1px solid var(--border);
    border-radius: 24px;
  }
  .portal-nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .portal-nav-admin { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .nav-link { border-radius: 16px; }
  .content-shell {
    width: min(100% - 1.6rem, 1180px);
    padding-top: .3rem;
  }
  .shell-topline {
    justify-content: space-between;
    align-items: center;
    gap: .6rem;
  }
  .section-heading { display: block; }

  .hero-card h2 { letter-spacing: -.06em; }
  .dashboard-control-panel { grid-template-columns: 1fr; }
  .dashboard-action-bar { grid-template-columns: 1fr; }
  .quick-action-grid { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .summary-grid, .action-grid { grid-template-columns: 1fr; }
  .dashboard-control-panel { padding: 1rem; }
  .dashboard-control-panel h2 { font-size: clamp(1.85rem, 11vw, 2.45rem); }
  .dashboard-hero .hero-copy { display: block; line-height: 1.55; }
  .dashboard-priority-strip { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .priority-tile { min-height: 96px; padding: .72rem; border-radius: 16px; }
  .priority-tile strong { font-size: 1.55rem; }
  .priority-tile small { font-size: .78rem; }
  .dashboard-action-bar { padding: .8rem; }
  .quick-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action-grid a { justify-content: center; min-height: 40px; padding: .58rem .7rem; font-size: .9rem; text-align: center; }
  .staff-caught-up-card { grid-template-columns: 1fr; min-height: auto; padding: .9rem; }
  .staff-dashboard-hero {
    padding: .85rem;
  }
  .staff-dashboard-hero .hero-copy {
    display: none;
  }
  .staff-dashboard-action-bar {
    margin-top: .6rem;
    padding: .65rem;
  }
  .staff-dashboard-action-bar .compact-heading {
    display: flex;
    align-items: baseline;
    gap: .45rem;
  }
  .staff-dashboard-action-bar .compact-heading .eyebrow {
    margin: 0;
    font-size: .62rem;
  }
  .staff-dashboard-action-bar .compact-heading h3 {
    font-size: .95rem;
  }
  .staff-dashboard-action-bar .quick-action-grid a {
    min-height: 38px;
    padding: .48rem .55rem;
  }
  .staff-caught-up-card::before { font-size: 1.9rem; opacity: .72; }
  .staff-caught-up-actions { justify-content: stretch; }
  .staff-caught-up-actions .link-button { flex: 1 1 9rem; text-align: center; }
  .compact-summary-card { min-height: 108px; }
  .sidebar {
    padding: .75rem;
    gap: .65rem;
    margin: .5rem;
    border-radius: 20px;
  }
  .sidebar-brand {
    align-items: center;
    padding: .25rem .2rem .5rem;
  }
  .sidebar-brand .eyebrow { display: none; }
  .sidebar-brand h1 { font-size: .95rem; }
  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }
  .portal-nav {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    overflow-x: visible;
    padding-bottom: .15rem;
  }
  .portal-nav-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .32rem;
  }
  .nav-link {
    min-height: 40px;
    padding: .58rem .75rem;
    border-radius: 999px;
    white-space: nowrap;
  }
  .portal-nav-admin .nav-link {
    min-height: 34px;
    padding: .46rem .48rem;
    gap: .32rem;
    font-size: .79rem;
  }
  .nav-glyph { width: 18px; }
  .portal-nav-admin .nav-glyph { width: 14px; }
  .portal-nav .nav-link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .compact-review-list li {
    grid-template-columns: 1fr;
  }
  .inline-review-actions {
    justify-content: flex-start;
  }
}


/* Phase 1 ops portal polish */
.summary-link { color: inherit; text-decoration: none; display: block; }
.summary-link:focus-visible, .quick-action-grid a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.quick-actions, .audit, .settings, .rota, .rota-dashboard { margin-top: 1.25rem; }
.hero-card,
.panel,
.action-panel,
.summary-card,
.dashboard-list li,
.checklist-card,
.fault-history,
.document-management,
.acknowledgement-summary,
.rota-list li,
.flash,
.auth-card {
  min-width: 0;
}
.hero-card,
.panel,
.action-panel,
.summary-card,
.dashboard-list,
.dashboard-list li,
.checklist-card,
.checklist-card h4,
.checklist-card p,
.fault-history li,
.document-management,
.acknowledgement-summary li,
.rota-list li,
.flash,
.auth-topbar,
.auth-topbar h1,
.auth-card,
.hint,
.meta {
  overflow-wrap: anywhere;
}
.quick-actions:not(.dashboard-action-bar) .quick-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.quick-actions:not(.dashboard-action-bar) .quick-action-grid a { border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: .9rem 1rem; background: rgba(255,255,255,.06); color: var(--ink); text-decoration: none; font-weight: 700; }
.quick-action-grid a:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.priority-tile:focus-visible,
.dashboard-action-bar .quick-action-grid a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.table-wrap { width: 100%; overflow-x: auto; }
.audit-table, .rota-table { min-width: 720px; }
.audit-table td, .rota-table td { vertical-align: top; }
.settings input, .rota input, .rota select, .rota textarea { max-width: 100%; }
.rota-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.rota-list li { border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: .85rem; background: rgba(255,255,255,.04); }
.rota-list span { display: block; color: var(--muted); margin-top: .25rem; }
.temporary-password-panel strong { display: block; max-width: 100%; padding: .65rem .85rem; border-radius: 12px; background: rgba(255,255,255,.08); letter-spacing: .04em; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.compact-hero { margin-bottom: 1rem; }
.section-tabs {
  position: sticky;
  top: max(.7rem, calc(env(safe-area-inset-top) + .5rem));
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 1rem 0;
  padding: .7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(5, 10, 20, .82);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(20px);
}
.section-tab {
  padding: .65rem .9rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  color: var(--muted-strong);
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,.04);
}
.section-tab:hover,
.section-tab:focus,
.section-tab.active {
  color: white;
  background: linear-gradient(135deg, rgba(56, 189, 248, .26), rgba(79, 70, 229, .18));
  border-color: rgba(125, 211, 252, .72);
}
.section-tab.active {
  box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 1px rgba(125, 211, 252, .18);
}
.split-panel-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }
.card-heading-row { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.card-heading-row h4 { margin-bottom: .2rem; }
.badge-warning { color: #fde68a; background: rgba(251, 191, 36, .13); }
.compact-details { margin-top: .85rem; }
.compact-details > summary { cursor: pointer; color: var(--accent); font-weight: 900; }
.compact-details[open] { padding-top: .75rem; border-top: 1px solid rgba(148, 163, 184, .14); }
.document-card {
  display: grid;
  gap: .75rem;
  scroll-margin-top: max(1rem, calc(env(safe-area-inset-top) + 1rem));
}
.content-shell:has(.document-card) .section-tabs {
  position: static;
}
.document-card .card-heading-row {
  align-items: flex-start;
}
.document-preview {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.55;
}
.document-read-details {
  margin-top: 0;
  padding: .7rem;
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 16px;
  background: rgba(15, 23, 42, .42);
}
.document-read-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  list-style: none;
}
.document-read-details > summary::-webkit-details-marker { display: none; }
.document-read-details > summary::before {
  content: "+";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
}
.document-read-details[open] > summary::before { content: "–"; }
.document-read-details > summary span {
  flex: 1 1 auto;
  min-width: 0;
}

.document-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
  align-items: center;
}
.document-export-actions .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .58rem .8rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  color: #dbeafe;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,.06);
}
.document-export-actions .button-secondary:hover,
.document-export-actions .button-secondary:focus-visible {
  color: white;
  background: rgba(56, 189, 248, .15);
  border-color: rgba(125, 211, 252, .42);
}
.document-read-details > summary strong {
  flex: 0 0 auto;
  padding: .3rem .55rem;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(251, 191, 36, .12);
  font-size: .78rem;
  white-space: nowrap;
}
.document-reader {
  max-height: min(62vh, 42rem);
  margin-top: .75rem;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(125, 211, 252, .7) rgba(15, 23, 42, .7);
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  background: rgba(2, 6, 23, .34);
}
.document-reader:focus {
  outline: 3px solid rgba(56, 189, 248, .34);
  outline-offset: 2px;
}
.document-body {
  padding: .9rem;
  color: #e5eefb;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.document-action-bar {
  position: sticky;
  bottom: max(.4rem, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .75rem;
  padding: .7rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: rgba(5, 10, 20, .92);
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}
.document-action-bar .meta {
  margin: 0;
  line-height: 1.35;
}
.document-sign-form,
.document-typed-ack-form {
  display: grid;
  gap: .65rem;
  min-width: min(100%, 24rem);
  margin: 0;
}
.document-typed-ack-form {
  padding-top: .7rem;
  border-top: 1px solid rgba(148, 163, 184, .16);
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--ink);
  font-weight: 800;
}
.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: .2rem;
  flex: 0 0 auto;
}
.signature-pad {
  display: grid;
  gap: .4rem;
}
.signature-pad label {
  margin: 0;
  color: #dbeafe;
  font-size: .86rem;
  font-weight: 950;
}
.signature-canvas {
  width: 100%;
  height: 112px;
  display: block;
  border: 2px dashed rgba(125, 211, 252, .45);
  border-radius: 14px;
  background: #f8fafc;
  touch-action: none;
  cursor: crosshair;
}
.signature-pad-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.signature-pad-actions .hint {
  font-size: .78rem;
}
.signature-pad-actions .link-button {
  width: auto;
  min-height: 34px;
  padding: .38rem .65rem;
}
.document-action-bar button[type="submit"] {
  margin-top: 0;
  white-space: nowrap;
}
.document-action-bar button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.28);
}
.signature-evidence {
  display: grid;
  gap: .35rem;
  max-width: 18rem;
  margin: 0;
}
.signature-evidence img {
  width: min(100%, 14rem);
  min-height: 3.2rem;
  object-fit: contain;
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
}
.signature-evidence figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.signature-evidence small {
  color: var(--muted);
  font-weight: 800;
}
/* Scroll-reduction pass: keep secondary details available without making the first screen heavy. */
.dashboard-more-summary,
.staff-onboarding-details {
  margin-top: .85rem;
}
.dashboard-more-summary > summary,
.staff-onboarding-details > summary,
.rota-tool-details > summary,
.rota-time-off-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 950;
  list-style: none;
}
.dashboard-more-summary > summary::-webkit-details-marker,
.staff-onboarding-details > summary::-webkit-details-marker,
.rota-tool-details > summary::-webkit-details-marker,
.rota-time-off-details > summary::-webkit-details-marker { display: none; }
.dashboard-more-summary > summary::before,
.staff-onboarding-details > summary::before,
.rota-tool-details > summary::before,
.rota-time-off-details > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
}
.dashboard-more-summary[open] > summary::before,
.staff-onboarding-details[open] > summary::before,
.rota-tool-details[open] > summary::before,
.rota-time-off-details[open] > summary::before { content: "–"; }
.dashboard-more-summary .compact-summary-grid,
.staff-onboarding-details .section-heading,
.rota-tool-details .hint,
.rota-time-off-details .hint { margin-top: .75rem; }
.today-actions-section.is-empty-compact .action-grid { gap: .6rem; }
.today-actions-section.is-empty-compact .action-panel { padding: .75rem; }
.today-actions-section.is-empty-compact .empty-state { font-size: .88rem; }
.dashboard-admin-actions {
  margin-top: .65rem;
}
.dashboard-admin-actions > summary,
.fault-history > summary,
.fault-management > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 950;
  white-space: nowrap;
  list-style: none;
}
.dashboard-admin-actions > summary::-webkit-details-marker,
.fault-history > summary::-webkit-details-marker,
.fault-management > summary::-webkit-details-marker { display: none; }
.dashboard-admin-actions > summary::before,
.fault-history > summary::before,
.fault-management > summary::before {
  content: "+";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
}
.dashboard-admin-actions[open] > summary::before,
.fault-history[open] > summary::before,
.fault-management[open] > summary::before { content: "–"; }
.compact-admin-action-grid {
  margin-top: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.fault-table-wrap { margin-top: .75rem; }
.fault-table { min-width: 760px; }
.fault-table th:last-child,
.fault-table td[data-label="Manage"] { min-width: 10.5rem; }
.fault-table td { vertical-align: top; }
.fault-row-anchor {
  scroll-margin-top: max(5rem, calc(env(safe-area-inset-top) + 5rem));
}
.fault-row-anchor:target {
  outline: 3px solid rgba(56, 189, 248, .72);
  outline-offset: -3px;
  background: rgba(56, 189, 248, .10);
  box-shadow: inset 4px 0 0 var(--accent);
}
.checklist-card-anchor {
  scroll-margin-top: max(5rem, calc(env(safe-area-inset-top) + 5rem));
}
.checklist-card-anchor:target {
  outline: 3px solid rgba(56, 189, 248, .72);
  outline-offset: 3px;
  background: rgba(56, 189, 248, .10);
  box-shadow: inset 4px 0 0 var(--accent), 0 18px 48px rgba(56, 189, 248, .16);
}
.document-card-anchor {
  scroll-margin-top: max(5rem, calc(env(safe-area-inset-top) + 5rem));
}
.document-card-anchor:target {
  outline: 3px solid rgba(56, 189, 248, .72);
  outline-offset: 3px;
  background: rgba(56, 189, 248, .10);
  box-shadow: inset 4px 0 0 var(--accent), 0 18px 48px rgba(56, 189, 248, .16);
}
.fault-description {
  display: block;
  margin-top: .28rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.fault-history,
.fault-management {
  margin-top: .65rem;
  padding: .62rem;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  background: rgba(15, 23, 42, .34);
}
.fault-history ul {
  margin: .65rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: .42rem;
}
.fault-history li,
.fault-history span {
  overflow-wrap: anywhere;
}
.fault-note-form,
.fault-manage-form {
  margin-top: .7rem;
}
.fault-management .fault-manage-form + .fault-manage-form {
  padding-top: .7rem;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; }
  body::before, .sidebar, .shell-topline, .print-hidden, form, button, .inline-form { display: none !important; }
  .app-shell, .content-shell, .shell { display: block; width: 100%; margin: 0; padding: 0; }
  .panel, .hero-card, .printable-rota { background: #fff; color: #111; box-shadow: none; border: 0; padding: 0; }
  .table-wrap, table { display: table; width: 100%; overflow: visible; }
  table { border-collapse: collapse; color: #111; }
  thead, tbody, tr { min-width: 0; }
  th, td { border: 1px solid #999; color: #111; background: #fff; padding: .35rem; }
  a { color: #111; text-decoration: none; }
}

@media (max-width: 720px) {
  .quick-actions:not(.dashboard-action-bar) .quick-action-grid { grid-template-columns: 1fr; }
  .summary-link, .action-panel, .panel { border-radius: 18px; }
  .staff-dashboard-hero-no-shift {
    padding: .75rem;
    gap: .6rem;
  }
  .staff-dashboard-hero-has-actions {
    grid-template-columns: minmax(0, 1fr);
    padding: .65rem .7rem;
    gap: .5rem;
  }
  .staff-dashboard-hero-has-actions .hero-copy {
    display: none;
  }
  .staff-dashboard-hero-has-actions .staff-next-shift-card {
    min-height: 0;
    padding: .55rem .62rem;
  }
  .staff-next-shift-card-empty {
    min-height: 0;
  }
  .inline-form { align-items: stretch; }
  .split-panel-grid { grid-template-columns: 1fr; }
  .section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tab { flex: 0 0 auto; white-space: nowrap; }
  .audit .table-wrap {
    overflow-x: visible;
  }
  .audit-table {
    min-width: 0;
  }
  .audit-table,
  .audit-table thead,
  .audit-table tbody,
  .audit-table tr,
  .audit-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .audit-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .audit-table th {
    display: none;
  }
  .audit-table tr {
    margin: 0 0 .75rem;
    padding: .8rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(15, 23, 42, .58);
  }
  .audit-table td {
    display: grid;
    grid-template-columns: 5.6rem minmax(0, 1fr);
    gap: .55rem;
    align-items: start;
    padding: .4rem 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .audit-table td + td {
    border-top: 1px solid rgba(148, 163, 184, .10);
  }
  .audit-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .document-card { padding: .8rem; }
  .document-card .card-heading-row,
  .document-admin-card .card-heading-row,
  .document-chase-panel .card-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
  }
  .document-export-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
  .document-export-actions .button-secondary {
    width: 100%;
    min-height: 44px;
    text-align: center;
    white-space: normal;
  }
  .document-card h4 { font-size: 1rem; line-height: 1.25; }
  .document-card .meta { font-size: .82rem; }
  .document-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .9rem;
  }
  .document-read-details { padding: .58rem; }
  .document-read-details > summary {
    gap: .5rem;
    min-height: 42px;
  }
  .document-reader {
    max-height: 58vh;
  }
  .document-body {
    padding: .78rem;
    font-size: .95rem;
    line-height: 1.62;
  }
  .document-action-bar {
    display: grid;
    gap: .55rem;
    padding: .62rem;
  }
  .document-action-bar button[type="submit"] {
    width: 100%;
  }
  .rota-manager-grid { grid-template-columns: minmax(0, 1fr); }
  .panel.rota,
  .rota .action-panel {
    overflow-x: hidden;
  }
  .rota .action-panel,
  .rota-form,
  .rota-form label,
  .rota-form input,
  .rota-form select,
  .rota-form textarea {
    min-width: 0;
    max-width: 100%;
  }
  .rota-form input[type="date"],
  .rota-form input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    text-align: left;
  }
  .rota-form input[type="date"]::-webkit-date-and-time-value,
  .rota-form input[type="time"]::-webkit-date-and-time-value {
    min-inline-size: 0;
    max-inline-size: 100%;
    text-align: left;
  }
}


/* Rota manager workspace — Shipleys-inspired portal-native polish */
.rota-compact-toolbar {
  display: grid;
  grid-template-columns: minmax(13rem, .42fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.15rem);
  padding: clamp(.85rem, 2vw, 1.2rem);
}
.rota-compact-toolbar::after {
  width: 14rem;
  height: 14rem;
  right: -5rem;
  top: -6rem;
  opacity: .72;
}
.rota-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.rota-compact-toolbar h2 {
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  letter-spacing: -.055em;
}
.rota-compact-toolbar .eyebrow { margin-bottom: .22rem; }
.rota-compact-toolbar .rota-hero-copy > p:last-child {
  margin: .25rem 0 0;
  max-width: 34rem;
  line-height: 1.35;
}
.rota-compact-toolbar > .rota-week-nav {
  position: relative;
  z-index: 1;
  justify-content: flex-end;
}
.rota-hero .rota-week-nav { margin-top: 0; display: flex; flex-wrap: wrap; gap: .65rem; align-items: stretch; }
.rota-nav-button-group,
.rota-date-jump {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.rota-date-jump {
  padding: .55rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.rota-date-jump label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: 0;
  color: var(--muted-strong);
  font-weight: 900;
}
.rota-date-jump input[type="date"] {
  width: auto;
  min-height: 40px;
  padding: .5rem .65rem;
}
.rota-date-jump button[type="submit"] {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: .55rem .85rem;
}
.rota-mobile-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .9rem 0;
}
.rota-day-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  margin: .25rem 0 1rem;
  padding: .45rem .1rem;
  color: var(--muted);
  font-size: .88rem;
}
.rota-day-jump-label {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-weight: 900;
}
.rota-mobile-quicklinks a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .58rem .78rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,.055);
}
.rota-day-jump a {
  color: var(--muted-strong);
  font-weight: 850;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 211, 252, .28);
}
.rota-day-jump a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.rota-mobile-quicklinks a:hover { background: rgba(56, 189, 248, .14); }
.rota-day-jump a:hover { color: white; border-bottom-color: rgba(125, 211, 252, .75); }
.rota-hero .link-button, .rota-panel .link-button { width: auto; text-decoration: none; display: inline-flex; }
.rota-tabs {
  /* Rota tabs inherit the shared section-tab strip styling. */
}
.content-shell:has(.rota-tabs) {
  width: min(1680px, calc(100% - 3rem));
}
.rota-tab {
  padding: .65rem .9rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 999px;
  color: var(--muted-strong);
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,.04);
}
.rota-tab:hover, .rota-tab:focus { color: white; background: rgba(56, 189, 248, .15); }
.rota-tab.active {
  color: white;
  background: linear-gradient(135deg, rgba(56, 189, 248, .26), rgba(79, 70, 229, .18));
  border-color: rgba(125, 211, 252, .72);
  box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 1px rgba(125, 211, 252, .18);
}
.rota-panel { scroll-margin-top: max(6rem, calc(env(safe-area-inset-top) + 6rem)); }
.rota-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.rota-summary-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(8, 16, 31, .62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 40px rgba(0,0,0,.22);
}
.rota-summary-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rota-summary-card span, .rota-summary-card small { display: block; color: var(--muted); font-weight: 800; }
.rota-summary-card strong { display: block; margin: .25rem 0; color: var(--ink); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.06em; }
.rota-manager-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.rota-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
}
.rota-form-grid.compact { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.rota-add-shift,
.rota-shift-edit {
  border: 1px solid rgba(125, 211, 252, .16);
  border-radius: 16px;
  background: rgba(15, 23, 42, .50);
}
.rota-add-shift {
  margin: 0 0 .65rem;
  padding: .56rem .68rem;
}
.rota-add-shift:not([open]) {
  display: inline-flex;
  margin: -.15rem 0 .55rem;
  padding: .38rem .55rem;
}
.rota-shift-edit {
  min-width: 0;
  padding: .22rem .28rem;
}
.rota-add-shift > summary,
.rota-shift-edit > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 950;
  list-style: none;
}
.rota-add-shift:not([open]) > summary {
  min-height: 32px;
}
.rota-add-shift > summary::-webkit-details-marker,
.rota-shift-edit > summary::-webkit-details-marker { display: none; }
.rota-add-shift > summary::before,
.rota-shift-edit > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
}
.rota-add-shift[open] > summary::before,
.rota-shift-edit[open] > summary::before { content: "–"; }
.rota-add-shift .rota-form,
.rota-shift-edit .rota-form {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(148, 163, 184, .14);
}
.rota-edit-form textarea,
.rota-create-form textarea { min-height: 74px; }
.rota-quick-assign select { min-width: 8.5rem; }
.compact-form { margin-top: .85rem; }
.rota-day-grid { display: grid; gap: .75rem; }
.rota-day-card {
  padding: .8rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 18px;
  background: rgba(8, 16, 31, .42);
}
.rota-day-card-summary, .print-rota-day > header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  align-items: flex-start;
  margin-bottom: .55rem;
}
.rota-day-card-summary > small {
  flex: 1 1 100%;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.rota-day-card h4 { margin: 0; font-size: 1.12rem; }
.rota-day-card-summary { cursor: pointer; list-style: none; }
.rota-day-card-summary::-webkit-details-marker { display: none; }
.rota-day-card-summary::after {
  content: "+";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
  font-weight: 950;
}
.rota-day-planner[open] > .rota-day-card-summary::after { content: "–"; }
.rota-day-card-summary small { color: var(--muted); font-weight: 900; }
.rota-day-table {
  display: table;
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  overflow: visible;
}
.rota-day-table thead { display: table-header-group; }
.rota-day-table tbody { display: table-row-group; }
.rota-day-table tr { display: table-row; min-width: 0; }
.rota-day-table-time { width: 6.7rem; }
.rota-day-table-role { width: 9.5rem; }
.rota-day-table-assigned { width: 7rem; }
.rota-day-table-status { width: 5.9rem; }
.rota-day-table-actions-col { width: 9.4rem; }
.rota-day-table th,
.rota-day-table td {
  padding: .46rem .58rem;
  font-size: .9rem;
  line-height: 1.25;
}
.rota-day-table th {
  padding: .42rem .58rem;
  font-size: .68rem;
  letter-spacing: .07em;
}
.rota-day-table .shift-type-tag {
  padding: .24rem .42rem;
  font-size: .72rem;
}
.rota-day-table td[data-label="Time"],
.rota-day-table td[data-label="Assigned"],
.rota-day-table td[data-label="Status"] {
  white-space: nowrap;
}
.rota-day-table .status-badge {
  white-space: nowrap;
}
.rota-day-table td[data-label="Actions"] {
  min-width: 0;
}
.rota-day-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  width: 100%;
}
.rota-day-table-actions > .rota-shift-edit,
.rota-day-table-actions > .rota-row-manage {
  flex: 1 1 4.75rem;
}
.rota-day-table-actions > .rota-shift-edit > summary,
.rota-row-manage > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .42rem .68rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 900;
  list-style: none;
}
.rota-day-table-actions > .rota-shift-edit > summary::-webkit-details-marker,
.rota-row-manage > summary::-webkit-details-marker {
  display: none;
}
.rota-row-manage[open] {
  flex: 1 1 100%;
  width: 100%;
  display: grid;
  gap: .45rem;
}
.rota-day-table-actions .inline-form {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0;
}
.rota-day-table-actions .rota-quick-assign {
  flex: 1 1 10rem;
  min-width: min(100%, 9rem);
}
.rota-day-table-actions .rota-shift-edit {
  max-width: 100%;
}
.rota-day-table-actions .rota-shift-edit[open] {
  flex: 1 1 100%;
  width: 100%;
}
.rota-day-table-actions .rota-edit-form {
  width: 100%;
  max-width: 100%;
}
.rota-day-table-actions .rota-form-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}
.rota-day-table-actions input,
.rota-day-table-actions select,
.rota-day-table-actions textarea {
  min-width: 0;
}
.rota-day-table-actions select {
  width: auto;
  min-width: min(100%, 6.5rem);
  flex: 1 1 6.5rem;
  padding-block: .52rem;
}
.rota-day-table-actions button[type="submit"] {
  width: auto;
  flex: 0 0 auto;
  min-height: 34px;
  margin-top: 0;
  padding: .46rem .68rem;
  box-shadow: none;
}
.rota-day-table-actions form[data-confirm] button.button-danger[type="submit"] {
  border: 1px solid rgba(251, 113, 133, .42);
  color: #fecdd3;
  background: rgba(127, 29, 29, .28);
}
.rota-mobile-day-list { display: none; }
.rota-day-summary {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  min-height: 44px;
  cursor: pointer;
}
.rota-day-summary::-webkit-details-marker { display: none; }
.rota-day-summary::after {
  content: "＋";
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 950;
}
.rota-day-details[open] .rota-day-summary::after { content: "−"; }
.rota-day-summary > span:first-child { display: grid; gap: .1rem; min-width: 0; }
.rota-day-summary strong { color: var(--ink); overflow-wrap: anywhere; }
.rota-day-summary-meta {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 900;
  text-align: right;
}
.rota-shift-chips {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.rota-shift-chip {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  min-width: 0;
}
.rota-chip-time { color: var(--ink); font-weight: 950; white-space: nowrap; }
.rota-chip-role,
.rota-chip-person { color: var(--muted-strong); font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.rota-chip-note-details,
.rota-chip-actions {
  flex-basis: 100%;
  color: var(--muted);
  font-size: .9rem;
}
.rota-chip-note-details summary,
.rota-chip-actions summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--accent-2);
}
.rota-chip-actions {
  border-top: 1px solid rgba(148, 163, 184, .12);
  padding-top: .45rem;
}
.rota-chip-actions .inline-form {
  display: grid;
  gap: .45rem;
  margin-top: .5rem;
}
.status-badge { display: inline-flex; padding: .35rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 900; text-transform: capitalize; border: 1px solid rgba(148, 163, 184, .18); }
.status-published { color: #bbf7d0; background: rgba(52, 211, 153, .13); }
.status-draft { color: #fde68a; background: rgba(251, 191, 36, .13); }
.status-cancelled { color: #fecdd3; background: rgba(251, 113, 133, .13); }
.staff-week-rota {
  background:
    radial-gradient(circle at 12% 4%, rgba(56, 189, 248, .14), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(17, 24, 39, .72));
}
.staff-rota-grid { display: grid; gap: 1rem; }
.staff-rota-priority-grid:empty { display: none; }
.staff-rota-extra-days {
  margin-top: .8rem;
  padding: .75rem;
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 18px;
  background: rgba(8, 16, 31, .36);
}
.staff-rota-extra-days > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 950;
  list-style: none;
}
.staff-rota-extra-days > summary::-webkit-details-marker { display: none; }
.staff-rota-extra-days > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  color: #07111f;
  background: var(--accent);
}
.staff-rota-extra-days[open] {
  border-color: rgba(125, 211, 252, .38);
  background: rgba(8, 16, 31, .52);
}
.staff-rota-extra-days[open] > summary::before { content: "–"; }
.staff-rota-extra-days[open] .staff-rota-secondary-grid { margin-top: .75rem; }
.staff-rota-day {
  --day-accent: #38bdf8;
  border: 1px solid color-mix(in srgb, var(--day-accent) 36%, rgba(148, 163, 184, .18));
  border-radius: 22px;
  padding: 1rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--day-accent) 14%, rgba(8, 16, 31, .76)), rgba(15, 23, 42, .60)),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--day-accent) 18%, transparent), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.staff-rota-day-0 { --day-accent: #38bdf8; }
.staff-rota-day-1 { --day-accent: #a78bfa; }
.staff-rota-day-2 { --day-accent: #f472b6; }
.staff-rota-day-3 { --day-accent: #fb923c; }
.staff-rota-day-4 { --day-accent: #34d399; }
.staff-rota-day-5 { --day-accent: #facc15; }
.staff-rota-day-6 { --day-accent: #22d3ee; }
.staff-rota-day-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: .75rem;
  margin-bottom: .75rem;
  cursor: pointer;
  list-style: none;
}
.staff-rota-day-summary::-webkit-details-marker { display: none; }
.staff-rota-day-summary strong { display: block; margin: 0; color: var(--ink); font-size: 1.25rem; }
.staff-rota-day-summary small { color: #e0f2fe; font-weight: 950; text-align: right; }
.staff-rota-day-body { display: grid; gap: .65rem; }
.staff-shift-grid {
  display: grid;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.staff-shift-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .35rem .7rem;
  align-items: center;
  min-height: 68px;
  padding: .82rem .9rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-left: 6px solid var(--day-accent);
  border-radius: 18px;
  background: rgba(8, 16, 31, .54);
}
.staff-shift-card.is-day { border-left-color: #fbbf24; background: linear-gradient(135deg, rgba(251, 191, 36, .15), rgba(8, 16, 31, .54)); }
.staff-shift-card.is-night { border-left-color: #818cf8; background: linear-gradient(135deg, rgba(129, 140, 248, .17), rgba(8, 16, 31, .58)); }
.staff-shift-card.is-mine { outline: 2px solid #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .12); }
.staff-shift-time {
  display: inline-flex;
  justify-content: center;
  padding: .36rem .58rem;
  border-radius: 999px;
  color: #07111f;
  background: color-mix(in srgb, var(--day-accent) 76%, white);
  font-size: .84rem;
  font-weight: 950;
  white-space: nowrap;
}
.staff-shift-card strong { color: var(--ink); overflow-wrap: anywhere; }
.shift-label-with-tag,
.rota-chip-role {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .32rem;
  min-width: 0;
}
.shift-type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .16rem .42rem;
  border: 1px solid rgba(125, 211, 252, .24);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(56, 189, 248, .11);
  font-size: .68em;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
.is-day .shift-type-tag { color: #fde68a; border-color: rgba(251, 191, 36, .34); background: rgba(251, 191, 36, .13); }
.is-night .shift-type-tag { color: #c7d2fe; border-color: rgba(129, 140, 248, .34); background: rgba(129, 140, 248, .14); }
.priority-tile .shift-label-with-tag,
.rota-watch-card .shift-label-with-tag,
.rota-list .shift-label-with-tag { display: inline-flex; color: inherit; font-weight: inherit; margin-top: 0; }
.priority-tile .shift-type-tag,
.rota-watch-card .shift-type-tag,
.rota-list .shift-type-tag { display: inline-flex; font-size: .68em; margin-top: 0; }
.staff-shift-card small,
.staff-shift-card em,
.staff-shift-person,
.staff-shift-mine {
  grid-column: 2;
  color: var(--muted-strong);
  font-size: .85rem;
  font-style: normal;
}
.staff-shift-person { color: #e0f2fe; font-weight: 950; }
.staff-shift-mine { color: #bbf7d0; font-weight: 950; }
.print-rota-header {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(125, 211, 252, .25);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, .20), transparent 34%),
    linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(124, 58, 237, .16));
}
.print-rota-header h2 { margin: 0; }
.print-rota-days { display: grid; gap: 1rem; }
.print-rota-day {
  --day-accent: #38bdf8;
  --day-accent-soft: rgba(56, 189, 248, .16);
  border: 1px solid color-mix(in srgb, var(--day-accent) 38%, rgba(148, 163, 184, .22));
  border-radius: 24px;
  padding: 1rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--day-accent) 16%, rgba(8, 16, 31, .86)), rgba(15, 23, 42, .72)),
    radial-gradient(circle at 95% 8%, color-mix(in srgb, var(--day-accent) 18%, transparent), transparent 38%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .20), inset 0 1px 0 rgba(255,255,255,.06);
}
.print-rota-day-0 { --day-accent: #38bdf8; }
.print-rota-day-1 { --day-accent: #a78bfa; }
.print-rota-day-2 { --day-accent: #f472b6; }
.print-rota-day-3 { --day-accent: #fb923c; }
.print-rota-day-4 { --day-accent: #34d399; }
.print-rota-day-5 { --day-accent: #facc15; }
.print-rota-day-6 { --day-accent: #22d3ee; }
.print-rota-day > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: .8rem;
}
.print-rota-day h3 { margin: 0; font-size: 1.35rem; }
.print-rota-day > header > p {
  margin: 0;
  color: #e0f2fe;
  font-weight: 950;
}
.print-shift-grid {
  display: grid;
  gap: .65rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.print-shift-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .35rem .75rem;
  align-items: center;
  min-height: 72px;
  padding: .85rem .95rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-left: 6px solid var(--day-accent);
  border-radius: 18px;
  background: rgba(15, 23, 42, .68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.print-shift-card.is-day { border-left-color: #fbbf24; background: linear-gradient(135deg, rgba(251, 191, 36, .16), rgba(15, 23, 42, .68)); }
.print-shift-card.is-night { border-left-color: #818cf8; background: linear-gradient(135deg, rgba(129, 140, 248, .18), rgba(15, 23, 42, .72)); }
.print-shift-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .38rem .6rem;
  border-radius: 999px;
  color: #07111f;
  background: color-mix(in srgb, var(--day-accent) 76%, white);
  font-size: .86rem;
  font-weight: 950;
  white-space: nowrap;
}
.print-shift-card strong {
  color: var(--ink);
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}
.print-shift-card small,
.print-shift-card em {
  grid-column: 2;
  color: var(--muted-strong);
  font-size: .86rem;
  font-style: normal;
}

@media (max-width: 560px) {
  .content-shell {
    width: min(100% - 1rem, 1180px);
    padding-left: max(.5rem, env(safe-area-inset-left));
    padding-right: max(.5rem, env(safe-area-inset-right));
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
  }
  .shell-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .45rem;
    margin-bottom: .55rem;
  }
  .status-pill {
    flex: 1 1 8rem;
    justify-content: center;
    min-width: 0;
    padding: .45rem .55rem;
    font-size: .76rem;
    white-space: nowrap;
  }
  .topbar-account-actions {
    flex: 0 1 auto;
    max-width: 100%;
    margin-left: auto;
    gap: .25rem;
    padding: .18rem;
  }
  .topbar-account-link {
    gap: .35rem;
    padding: .12rem .28rem .12rem .12rem;
  }
  .topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }
  .topbar-account-copy small { display: none; }
  .topbar-account-copy strong {
    max-width: 5.8rem;
    font-size: .82rem;
  }
  .topbar-logout-button {
    min-height: 30px;
    padding: .35rem .5rem;
    font-size: .78rem;
  }
  @media (max-width: 380px) {
    .shell-topline { justify-content: flex-end; }
    .status-pill { display: none; }
    .topbar-account-actions { width: 100%; justify-content: space-between; }
    .topbar-account-copy strong { max-width: min(8.5rem, 46vw); }
  }
  .today-action-heading {
    gap: .5rem;
  }
  .today-action-count {
    min-width: 2.4rem;
    min-height: 2rem;
    padding: .16rem .6rem;
  }
  .rota-hero {
    padding: .85rem;
  }
  .rota-compact-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: .55rem;
  }
  .rota-hero .eyebrow,
  .rota-hero > p,
  .rota-hero-copy > p:last-child { display: none; }
  .rota-hero h2 {
    font-size: 1.8rem;
    line-height: 1;
  }
  .rota-hero .rota-week-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
    margin-top: .55rem;
    overflow: visible;
  }
  .rota-nav-button-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    width: 100%;
  }
  .rota-nav-button-group[aria-label="Move by day"] {
    grid-column: 1 / -1;
  }
  .rota-nav-button-group[aria-label="Move by week"] {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .rota-date-jump {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .4rem;
    width: 100%;
    padding: .45rem;
  }
  .rota-date-jump label {
    display: grid;
    gap: .2rem;
    width: 100%;
    font-size: .74rem;
    letter-spacing: .02em;
  }
  .rota-date-jump input[type="date"] {
    width: 100%;
  }
  .rota-date-jump button[type="submit"] {
    width: auto;
    align-self: end;
    white-space: nowrap;
  }
  .rota-hero .rota-week-nav > a.link-button {
    grid-column: 1 / -1;
  }
  .rota-mobile-quicklinks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin: .6rem 0;
    overflow: visible;
  }
  .rota-mobile-quicklinks::-webkit-scrollbar { display: none; }
  .rota-hero .link-button,
  .rota-mobile-quicklinks a {
    width: 100%;
    flex: 1 1 auto;
    min-height: 40px;
    padding: .5rem .55rem;
    white-space: normal;
    overflow-wrap: anywhere;
    justify-content: center;
    text-align: center;
    font-size: .82rem;
    line-height: 1.15;
  }
  .rota-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }
  .rota-summary-card {
    min-height: 0;
    padding: .65rem;
    border-radius: 14px;
  }
  .rota-summary-card small { display: none; }
  .rota-summary-card strong {
    font-size: 1.55rem;
    margin: .1rem 0 0;
  }
  .panel,
  .action-panel,
  .rota-day-card {
    padding: .85rem;
  }
  .rota-manager-grid { grid-template-columns: minmax(0, 1fr); }
  .rota-form-grid,
  .rota-form-grid.compact { grid-template-columns: minmax(0, 1fr); }
  .rota-add-shift,
  .rota-shift-edit { padding: .65rem; }
  .rota-day-grid-desktop { display: none; }
  .rota-mobile-day-list {
    display: grid;
    gap: .65rem;
  }
  .rota-day-details {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(8, 16, 31, .42);
    padding: .75rem;
  }
  .rota-day-summary {
    align-items: center;
  }
  .rota-day-summary-meta {
    text-align: left;
    font-size: .8rem;
  }
  .rota-day-jump {
    display: none;
  }
  .rota-form button[type="submit"],
  .rota-panel .link-button,
  .rota-day-jump a {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  .rota-tab,
  .rota-chip-note-details summary,
  .rota-chip-actions summary,
  .rota-form input,
  .rota-form select,
  .rota-form textarea,
  .rota-form button[type="submit"],
  .rota .inline-form button[type="submit"],
  .rota-mobile-quicklinks a {
    min-height: 44px;
  }
  .rota-chip-note-details summary,
  .rota-chip-actions summary {
    display: flex;
    align-items: center;
    width: 100%;
    padding: .35rem 0;
  }
  .rota-day-card-summary,
  .print-rota-day > header {
    flex-direction: column;
    gap: .35rem;
  }
  .rota-day-card-summary small {
    width: 100%;
  }
  .rota-tabs {
    margin: .6rem 0;
    padding: .55rem;
  }
  .staff-week-rota {
    padding: .85rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(17, 24, 39, .70));
  }
  .staff-rota-grid { gap: .55rem; }
  .staff-rota-extra-days {
    margin-top: .55rem;
    padding: .55rem;
    border-radius: 16px;
  }
  .staff-rota-extra-days > summary {
    min-height: 44px;
    font-size: .88rem;
  }
  .staff-rota-extra-days[open] .staff-rota-secondary-grid { margin-top: .55rem; }
  .staff-rota-day {
    border-radius: 16px;
    padding: 0;
    border-color: rgba(148, 163, 184, .18);
    background: rgba(8, 16, 31, .46);
  }
  .staff-rota-day-summary {
    align-items: center;
    margin: 0;
    padding: .75rem .85rem;
    gap: .65rem;
  }
  .staff-rota-day-summary::after {
    content: "+";
    flex: 0 0 1.85rem;
    display: inline-grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    color: var(--accent-2);
    background: rgba(56, 189, 248, .10);
    font-size: 1rem;
    line-height: 1;
    font-weight: 950;
  }
  .staff-rota-day[open] .staff-rota-day-summary::after { content: "−"; }
  .staff-rota-day[open] .staff-rota-day-summary {
    background: rgba(56, 189, 248, .10);
    border-bottom: 1px solid rgba(125, 211, 252, .18);
  }
  .staff-rota-day-summary .eyebrow { margin-bottom: .1rem; }
  .staff-rota-day-summary strong { font-size: 1.05rem; }
  .staff-rota-day-summary small {
    margin-left: auto;
    font-size: .78rem;
    color: var(--muted-strong);
    white-space: nowrap;
  }
  .staff-rota-day-body {
    padding: 0 .65rem .65rem;
  }
  .staff-shift-grid {
    grid-template-columns: 1fr;
    gap: .42rem;
  }
  .staff-shift-card {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .25rem .55rem;
    padding: .6rem .65rem;
    border-left-width: 4px;
    border-radius: 13px;
    background: rgba(15, 23, 42, .66);
  }
  .staff-shift-card.is-day,
  .staff-shift-card.is-night {
    background: rgba(15, 23, 42, .66);
  }
  .staff-shift-time {
    padding: .28rem .46rem;
    font-size: .76rem;
    background: rgba(226, 232, 240, .90);
  }
  .staff-shift-card strong { font-size: .92rem; }
  .staff-shift-card small,
  .staff-shift-card em,
  .staff-shift-person,
  .staff-shift-mine { font-size: .78rem; }
  .inline-form input,
  .inline-form select,
  .inline-form textarea,
  .inline-form button[type="submit"],
  .stacked-form button[type="submit"] {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
  }
  .rota .table-wrap {
    overflow-x: visible;
  }
  .rota-table,
  .rota-day-table {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  .rota-table thead {
    display: none;
  }
  .rota-table tbody,
  .rota-table tr,
  .rota-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .rota-table tr {
    margin-bottom: .75rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(8, 16, 31, .38);
    overflow: hidden;
  }
  .rota-table td {
    padding: .75rem;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
  }
  .rota-table td:last-child {
    border-bottom: 0;
  }
  .rota-table td[data-label="Actions"] {
    display: grid;
    gap: .6rem;
  }
  .rota-day-table-actions {
    display: grid;
    gap: .6rem;
  }
  .rota-table td[data-label="Actions"] .inline-form {
    display: grid;
    gap: .5rem;
    margin: 0;
  }
  .rota-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .25rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .fault-table-wrap {
    overflow-x: visible;
  }
  .fault-table {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  .fault-table thead {
    display: none;
  }
  .fault-table tbody,
  .fault-table tr,
  .fault-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .fault-table tr {
    margin-bottom: .75rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(8, 16, 31, .38);
    overflow: hidden;
  }
  .fault-table td {
    padding: .75rem;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
  }
  .fault-table td:last-child {
    border-bottom: 0;
  }
  .fault-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .25rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .account-details dl {
    grid-template-columns: 1fr;
    gap: .25rem;
  }
}
@media print {
  @page { size: A4; margin: 10mm; }
  .print-rota-days { display: block; }
  .print-rota-day { break-inside: avoid; page-break-inside: avoid; margin: 0 0 .7rem; padding: .25rem 0; border: 0; background: #fff; }
  .print-rota-day > header { color: #111; border-bottom: 1px solid #111; padding-bottom: .2rem; margin-bottom: .25rem; }
  .print-rota-day h3, .print-rota-day p, .print-rota-header p, .print-rota-header h2 { color: #111; }
  .print-shift-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #999;
    border-left: 4px solid #111;
    box-shadow: none;
  }
  .print-shift-card strong,
  .print-shift-card small,
  .print-shift-card em,
  .print-shift-time,
  .printable-rota .shift-type-tag {
    color: #111 !important;
    background: #fff !important;
  }
  .status-badge { color: #111; background: #fff; border-color: #999; }
}


.manager-action-centre-grid,
.export-pack-grid,
.chasing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.manager-action-centre .summary-card,
.export-pack-grid .action-panel,
.chasing-grid .action-panel {
  min-height: 100%;
}

.chasing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.chasing-ack-panel {
  grid-column: 1 / -1;
}

.payroll-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1rem;
  align-items: center;
}

.payroll-export-actions .link-button,
.payroll-export-actions .button-link {
  width: auto;
  text-decoration: none;
  white-space: nowrap;
}

.fault-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  justify-content: flex-end;
}

.fault-export-actions .link-button {
  width: auto;
  white-space: nowrap;
  text-align: center;
}

.export-range-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(10rem, 14rem)) auto;
  align-items: end;
  gap: .75rem;
  margin: .75rem 0 0;
}

.export-range-form label {
  margin: 0;
}

.export-range-form input[type="date"] {
  min-height: 2.35rem;
  padding: .55rem .7rem;
  border-radius: .85rem;
}

.export-range-form button[type="submit"] {
  width: auto;
  min-height: 2.35rem;
  margin-top: 0;
  padding: .55rem .85rem;
  white-space: nowrap;
}

.export-range-actions {
  margin-top: .75rem;
}

.export-range-hint {
  margin: .65rem 0 1rem;
}

.chase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .15rem;
  align-items: center;
}

.chase-action-steps {
  gap: .6rem;
  align-items: stretch;
}

.chase-action-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  min-height: 2.15rem;
  padding: .38rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: .9rem;
  background: rgba(15, 23, 42, .34);
}

.step-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chase-action-step.inline-chase-form {
  margin: 0;
}

.chase-filter-form {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(11rem, .35fr) repeat(4, auto);
  gap: .55rem;
  align-items: end;
  margin: .6rem 0 .85rem;
}

.chase-filter-form label {
  display: none;
}

.chase-filter-form input,
.chase-filter-form select {
  min-height: 2.35rem;
  padding: .55rem .7rem;
  border-radius: .85rem;
}

.inline-chase-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  margin: 0;
}

.inline-chase-form input[name="note"] {
  width: min(13rem, 100%);
  min-height: 0;
  padding: .42rem .62rem;
  border-radius: .75rem;
  font-size: .78rem;
}

.chase-last-action {
  display: block;
  margin-top: .15rem;
}

.chase-email-draft,
.top-staff-ack-chases {
  display: grid;
  gap: .7rem;
  margin: .85rem 0 1rem;
  padding: .9rem;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: var(--radius-md);
  background: rgba(8, 16, 31, .48);
}

.chase-email-draft .section-heading,
.top-staff-ack-chases .section-heading {
  margin-bottom: 0;
}

.compact-staff-chase-list li {
  gap: .45rem;
}

.compact-staff-chase-list .chase-actions {
  justify-content: flex-start;
}

.copy-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: start;
}

.copy-field-row textarea,
.copy-field-row input {
  min-height: 2.35rem;
  padding: .55rem .7rem;
  border-radius: .85rem;
}

.copy-field-row textarea[readonly],
.copy-field-row input[readonly] {
  color: var(--muted-strong);
  background: rgba(2, 6, 23, .42);
}

.date-helper {
  display: block;
  flex: 1 1 100%;
  color: var(--muted-strong);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.35;
}
.rota-date-jump .date-helper,
.rota-form .date-helper {
  margin-top: -.2rem;
}
button[disabled],
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .62;
  box-shadow: none;
}
.summary-priority-label {
  display: inline-flex;
  width: fit-content;
  margin-bottom: .35rem;
  padding: .24rem .48rem;
  border: 1px solid rgba(251, 191, 36, .32);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(251, 191, 36, .12);
  font-size: .66rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.summary-priority-label.info {
  border-color: rgba(125, 211, 252, .32);
  color: #bae6fd;
  background: rgba(56, 189, 248, .11);
}
.summary-count-text {
  font-size: clamp(1rem, 2.2vw, 1.32rem);
  line-height: 1.12;
  letter-spacing: -.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compact-button {
  width: auto;
  min-height: 0;
  padding: .42rem .7rem;
  font-size: .78rem;
  line-height: 1.1;
  text-decoration: none;
}

.copy-feedback {
  outline: 2px solid rgba(56, 189, 248, .5);
}

@media (max-width: 760px) {
  .manager-action-centre-grid,
  .export-pack-grid,
  .chasing-grid {
    grid-template-columns: 1fr;
  }

  .payroll-export-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .export-range-form,
  .chase-filter-form {
    grid-template-columns: 1fr;
  }

  .grouped-chase-list .grouped-chase-item {
    grid-template-columns: 1fr;
  }

  .chase-action-drawer {
    justify-self: stretch;
  }

  .chase-action-drawer > summary {
    width: 100%;
  }

  .export-range-form button[type="submit"] {
    width: 100%;
  }

  .payroll-export-actions .link-button,
  .payroll-export-actions .button-link,
  .chase-filter-form .button-link,
  .chase-actions .button-link,
  .chase-action-step,
  .copy-field-row,
  .copy-field-row .button-link,
  .inline-chase-form,
  .inline-chase-form input[name="note"] {
    width: 100%;
    text-align: center;
  }
}


.grouped-chase-list {
  gap: .85rem;
}

.grouped-chase-list .grouped-chase-item {
  align-items: start;
  gap: .75rem 1rem;
  padding: .9rem;
  grid-template-columns: minmax(17rem, .52fr) minmax(0, 1fr) auto;
}

.chase-document-main {
  display: grid;
  gap: .28rem;
  min-width: 0;
}

.chase-meta {
  color: var(--muted-strong);
  font-size: .88rem;
}

.chase-people {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  margin-top: 0;
  min-width: 0;
}

.chase-person {
  display: inline-flex;
  max-width: 100%;
  padding: .28rem .58rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .5);
  color: var(--muted-strong);
  font-size: .82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chase-action-drawer {
  justify-self: end;
  min-width: min(100%, 9rem);
}

.chase-action-drawer > summary {
  min-height: 2.45rem;
  padding: .66rem 1rem;
  border: 1px solid rgba(56, 189, 248, .32);
  border-radius: 999px;
  color: #e0f2fe;
  font-weight: 900;
  font-size: .9rem;
  line-height: 1.1;
  text-align: center;
  background: rgba(56, 189, 248, .12);
  cursor: pointer;
  list-style-position: inside;
}

.chase-action-drawer[open] {
  grid-column: 1 / -1;
  justify-self: stretch;
  padding: .72rem;
  border: 1px solid rgba(56, 189, 248, .20);
  border-radius: 16px;
  background: rgba(8, 16, 31, .42);
}

.chase-action-drawer[open] > summary {
  width: fit-content;
  margin-bottom: .65rem;
}

.chase-action-drawer[open] .chase-action-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.chase-action-drawer[open] .chase-action-step {
  min-width: 0;
}

.chase-more {
  color: var(--accent);
  border-color: rgba(56, 189, 248, .35);
}

/* Social media planner */
.social-media-hero {
  background: linear-gradient(135deg, rgba(56, 189, 248, .18), rgba(139, 92, 246, .18)), var(--card);
}
.metric-grid.social-media-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .9rem;
  margin: 1rem 0 1.25rem;
}
.metric-card,
.social-post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, .72);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .22);
}
.metric-card {
  padding: 1rem;
}
.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: .86rem;
}
.metric-card strong {
  display: block;
  margin: .25rem 0;
  font-size: 1.7rem;
}
.social-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}
.social-filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  align-items: end;
  margin: .9rem 0 .45rem;
  padding: .8rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 18px;
  background: rgba(8, 16, 31, .36);
}
.social-filter-form label { margin: 0; }
.social-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}
.social-filter-actions button[type="submit"] { width: auto; margin-top: 0; }
.social-filter-summary { margin: 0 0 .8rem; }
.social-calendar-groups {
  display: grid;
  gap: 1rem;
}
.social-calendar-group {
  display: grid;
  gap: .65rem;
}
.social-calendar-group > h4 {
  margin: 0;
  padding: .35rem .6rem;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: rgba(56, 189, 248, .10);
}
.social-post-card {
  padding: 1rem;
}
.social-post-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .8rem;
}
.social-post-card h4 {
  margin: 0;
  font-size: 1.05rem;
}
.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .28rem .55rem;
  font-size: .72rem;
  font-weight: 800;
  color: #08101f;
  background: var(--muted-strong);
  text-transform: capitalize;
}
.status-approved,
.status-scheduled,
.status-posted { background: var(--success); }
.status-needs-image,
.status-ready-for-approval { background: var(--warning); }
.status-archived { background: var(--muted); }
.copy-caption-label textarea {
  width: 100%;
  margin-top: .35rem;
  resize: vertical;
}
.social-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .55rem 0 .75rem;
}
.social-copy-actions .compact-button {
  width: auto;
  min-height: 34px;
  padding: .42rem .75rem;
}
.social-edit-details {
  margin-top: .8rem;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 14px;
  background: rgba(15, 23, 42, .45);
}
.social-edit-details > summary {
  cursor: pointer;
  padding: .65rem .75rem;
  color: var(--muted-strong);
  font-weight: 800;
}
.social-edit-details[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.social-edit-form {
  padding: .75rem;
}
.compliance-warning {
  margin: .75rem 0;
  padding: .75rem;
  border: 1px solid rgba(251, 191, 36, .45);
  border-left: 4px solid var(--warning);
  border-radius: 14px;
  background: rgba(251, 191, 36, .10);
}
.compliance-warning p { margin: .3rem 0 0; white-space: pre-line; }
.social-status-form {
  display: flex;
  align-items: end;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.social-delete-form {
  margin-top: .45rem;
}
.social-delete-button {
  width: auto;
  min-height: 34px;
  padding: .45rem .8rem;
  color: #fecdd3;
  border-color: rgba(251, 113, 133, .45);
  background: rgba(251, 113, 133, .10);
}
.social-delete-button:hover,
.social-delete-button:focus-visible {
  background: rgba(251, 113, 133, .18);
}
.two-column-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}
.social-template-layout {
  align-items: start;
}
.social-template-form,
.social-template-library {
  min-width: 0;
}
.social-template-library {
  display: grid;
  gap: .75rem;
}
.social-template-card p {
  margin: .35rem 0 .7rem;
  color: var(--ink);
  white-space: pre-line;
}
.social-template-use-form {
  padding: .75rem;
}
.inline-checkbox {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
}
.inline-checkbox input {
  width: auto;
  margin: 0;
}

/* Scroll performance polish: keep the glass look with opaque gradients, but
   avoid live backdrop blurs on fixed/sticky and repeated card surfaces. These
   elements move or repaint during scrolling on phones/tablets, and backdrop
   filtering forces costly compositing work that makes the site feel laggy. */
.sidebar,
.hero-card,
.dashboard-section,
.auth-card,
.panel,
.section-tabs,
.document-action-bar {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* End scroll performance polish */
