/* Roboto (SIL Open Font License 1.1, Google), served from here so no visitor's browser contacts Google */
@font-face {
	font-family: "Roboto"; font-style: normal; font-weight: 400 700; font-display: swap;
	src: url("../fonts/roboto-latin.665db5e157d2.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Roboto"; font-style: normal; font-weight: 400 700; font-display: swap;
	src: url("../fonts/roboto-latin-ext.a6323dda0842.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--bg: #f4f6fa;
	--surface: #ffffff;
	--surface-2: #f1f4f9;
	--border: #e3e8ef;
	--text: #111827;
	--muted: #5f6876; /* 4.5:1 or better on every light surface (WCAG AA) */
	--blue: #1d4ed8;
	--blue-dark: #1e3a8a;
	--blue-soft: #e8efff;
	--green: #047857;
	--green-soft: #e3f6ee;
	--amber: #b45309;
	--amber-soft: #fdf3e1;
	--red: #b91c1c;
	--red-soft: #fdeaea;
	--faint: #7d8696; /* icons and lines only (3:1); text uses --muted */
	--line-strong: #c4cad4;
	--input-border: #cfd6e1;
	--blue-hover: #1a43c0;
	--blue-light: #3b82f6;
	--topbar: var(--blue-dark);
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
	--nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--text);
	background: var(--bg);
	min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
/* links inside a sentence are underlined, so they don't rely on colour alone */
p a:not(.btn), .small a:not(.btn), .muted a:not(.btn), td > a:not(.btn):not(.chip), .doc-row a:not(.btn) { text-decoration: underline; }
.icon { flex: none; vertical-align: middle; }

/* ---------- layout ---------- */

.topbar {
	position: sticky; top: 0; z-index: 20;
	height: 56px;
	display: flex; align-items: center; justify-content: space-between;
	padding: 0 16px;
	background: var(--topbar);
	color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand-mark {
	width: 30px; height: 30px; border-radius: 8px; flex: none;
	display: grid; place-items: center;
	background: #fff; color: var(--blue-dark);
}
img.brand-mark { background: none; display: block; }
.avatar {
	width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center;
	background: rgba(255,255,255,.16); color: #fff;
	font-size: 13px; font-weight: 600;
}
.avatar:hover { text-decoration: none; background: rgba(255,255,255,.26); }

main.page {
	max-width: 760px;
	margin: 0 auto;
	padding: 16px 16px calc(var(--nav-h) + 24px);
}
main.page.wide { max-width: 1180px; }

nav.tabs {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
	height: var(--nav-h);
	display: flex; justify-content: space-around; align-items: stretch;
	background: var(--surface);
	border-top: 1px solid var(--border);
	padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a {
	flex: 1;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	color: var(--muted);
	font-size: 12px; font-weight: 500;
}
nav.tabs a:hover { text-decoration: none; color: var(--text); }
nav.tabs a.active { color: var(--blue); }

@media (min-width: 960px) {
	body.app { padding-left: 220px; }
	.topbar { margin-left: -220px; padding-left: 24px; }
	body.app.platform { padding-left: 0; }
	body.platform .topbar { margin-left: 0; }
	nav.tabs {
		top: 56px; right: auto; width: 220px; height: auto;
		flex-direction: column; justify-content: flex-start;
		padding: 16px 12px; gap: 4px;
		border-top: 0; border-right: 1px solid var(--border);
	}
	nav.tabs a {
		flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
		padding: 10px 12px; border-radius: 10px;
		font-size: 14px;
	}
	nav.tabs a.active { background: var(--blue-soft); }
	main.page { padding-bottom: 40px; }
}

/* ---------- type & helpers ---------- */

h1 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.pre { white-space: pre-line; }

/* ---------- cards ---------- */

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px;
}
.card > h2:first-child, .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 8px 2px 8px; }

.list { list-style: none; }
.list > li + li, .list > a + a { border-top: 1px solid var(--border); }
.list-item {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 16px;
	color: inherit;
}
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .chev { color: var(--faint); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .icon { color: var(--faint); margin-bottom: 6px; }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 12px;
	box-shadow: var(--shadow);
}
.stat .label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* ---------- pills & badges ---------- */

.pill {
	display: inline-flex; align-items: center; gap: 4px;
	padding: 2px 9px; border-radius: 999px;
	font-size: 12px; font-weight: 600; white-space: nowrap;
	background: var(--surface-2); color: var(--muted);
}
.pill.scheduled { background: var(--blue-soft); color: var(--blue); }
.pill.in_progress, .pill.open, .pill.medium { background: var(--amber-soft); color: var(--amber); }
.pill.completed, .pill.closed, .pill.low { background: var(--green-soft); color: var(--green); }
.pill.cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.pill.high, .pill.critical { background: var(--red-soft); color: var(--red); }
.pill.reviewing { background: var(--blue-soft); color: var(--blue); }
.notice { border-left: 4px solid transparent; }
.notice.urgent { border-left-color: var(--red); }
.notice.action { border-left-color: var(--amber); }
.notice-title { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.notice.urgent .notice-title { color: var(--red); }
.notice.action .notice-title { color: var(--amber); }
.notice-group { font-size: .95rem; padding: 14px 16px 8px; display: flex; align-items: center; gap: 8px; }
.notice-group::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.notice-group.urgent { color: var(--red); }
.notice-group.urgent::before { background: var(--red); }
.notice-group.action { color: var(--amber); }
.notice-group.action::before { background: var(--amber); }
.notice-group.earlier { color: var(--muted); }
.notice-group.earlier::before { background: var(--muted); }

.client-badge {
	width: 40px; height: 40px; border-radius: 50%;
	display: grid; place-items: center; flex: none;
	background: var(--blue-soft); color: var(--blue);
	font-weight: 700; font-size: 14px;
}
.client-badge.lg { width: 56px; height: 56px; font-size: 18px; }

.alert-box {
	display: flex; gap: 10px; align-items: flex-start;
	padding: 12px 14px; border-radius: 12px;
	background: var(--red-soft); color: var(--red);
	font-size: 14px;
}
.info-box { background: var(--blue-soft); color: var(--blue-dark); }

/* ---------- buttons & forms ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 40px; padding: 0 16px;
	border-radius: 10px; border: 1px solid var(--border);
	background: var(--surface); color: var(--text);
	font: inherit; font-weight: 600; font-size: 14px;
	cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; height: 48px; font-size: 15px; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; }
button.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
button.linklike:hover { text-decoration: underline; }
.geo-results { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; flex-basis: 100%; }
.geo-results:empty { display: none; }
.geo-pick { height: auto; min-height: 32px; padding: 6px 10px; text-align: left; white-space: normal; }
.btn.icon-only { width: 36px; height: 36px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.form .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error, .errorlist { font-size: 13px; color: var(--red); margin-top: 4px; list-style: none; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input:not([type]), select, textarea {
	width: 100%;
	font: inherit; font-size: 15px; color: var(--text);
	background: var(--surface);
	border: 1px solid var(--input-border); border-radius: 10px;
	padding: 10px 12px;
	min-height: 42px;
}
textarea { resize: vertical; }
input[type=file] { max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
/* keyboard users always see where they are */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible, input[type=checkbox]:focus-visible, input[type=radio]:focus-visible {
	outline: 2px solid var(--blue); outline-offset: 2px;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); color: var(--blue); padding: 10px 14px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); }
.skip-link:focus { top: 8px; }
.legal-footer { text-align: center; margin-top: 16px; display: grid; gap: 4px; max-width: 380px; padding: 8px 14px; border-radius: 12px; background: rgba(15, 20, 29, .55); color: #fff; }
.legal-footer a { color: inherit; }

/* ---------- messages ---------- */

.messages { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; }
.messages li { padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--blue-soft); color: var(--blue-dark); }
.messages li.success { background: var(--green-soft); color: var(--green); }
.messages li.error { background: var(--red-soft); color: var(--red); }
.messages li.warning { background: var(--amber-soft); color: var(--amber); }

/* ---------- key/value ---------- */

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* ---------- shift rows ---------- */

.shift-row { display: flex; gap: 14px; padding: 14px 16px; color: inherit; align-items: center; }
a.shift-row:hover { background: var(--surface-2); text-decoration: none; }
.shift-time { width: 62px; flex: none; font-weight: 600; font-size: 14px; }
.shift-time span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.shift-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--blue); flex: none; }
.shift-bar.in_progress { background: var(--amber); }
.shift-bar.completed { background: var(--green); }
.shift-bar.cancelled { background: var(--line-strong); }
.shift-main { flex: 1; min-width: 0; }
.shift-main .name { font-weight: 600; }
.shift-main .meta { font-size: 13px; color: var(--muted); display: flex; align-items: flex-start; gap: 4px; }
.alert-dot { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 1px 7px; vertical-align: middle; }

.note { padding: 14px 16px; }
.note + .note { border-top: 1px solid var(--border); }
.note .head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------- login ---------- */

.auth {
	min-height: 100vh; display: grid; place-items: center; padding: 20px;
	background: linear-gradient(160deg, var(--blue-dark), var(--blue) 60%, var(--blue-light));
}
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { color: var(--text); justify-content: center; margin-bottom: 6px; font-size: 22px; }
.auth .brand-mark { width: 44px; height: 44px; }
.auth .tagline { text-align: center; color: var(--text); font-weight: 500; margin: 2px 0 0; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; background: var(--surface-2); }
tfoot td { font-weight: 700; border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
	.stats { gap: 8px; }
	.stat { padding: 10px; }
	.stat .value { font-size: 19px; }
	.form .two { grid-template-columns: minmax(0, 1fr); }
	.kv { grid-template-columns: 110px 1fr; }
}

.auth .card.wide { max-width: 520px; }
.auth-links { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.auth-links .btn { font-weight: 500; }

.org-name { display: block; font-size: 11px; font-weight: 500; opacity: .75; letter-spacing: .2px; margin-top: -2px; }
.nav-icon { position: relative; display: inline-flex; }
.badge {
	position: absolute; top: -6px; right: -10px;
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
details.card summary { cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }

/* ---------- manage area ---------- */
.subnav { display: flex; gap: 4px; overflow-x: auto; margin: -4px -4px 16px; padding: 4px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav.groups { margin-bottom: 2px; }
.subnav-pages { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 4px 12px 10px; margin-bottom: 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.subnav-pages a { padding: 8px 0; color: var(--muted); font-weight: 500; }
.subnav-pages a:hover { color: var(--text); text-decoration: none; }
.subnav-pages a.active { color: var(--blue); font-weight: 600; }
.subnav-pages .count, .subnav.groups .count { margin-left: 2px; }
/* tabs inside one page (e.g. a schedule's week, rosters and saved times) */
.page-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--surface-2); border-radius: 10px; font-size: 14px; }
.page-tabs a { padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.page-tabs a:hover { color: var(--text); text-decoration: none; }
.page-head .page-tabs { margin: 0; }
.trial-line { margin: -4px 0 12px; display: flex; align-items: center; gap: 6px; }
.page-tabs a { position: relative; z-index: 0; }
.page-tabs a.active { color: var(--text); font-weight: 600; }
/* the white pill behind the active tab: its own element, so it can slide to the next tab (see Transitions) */
.page-tab-mark { position: absolute; inset: 0; z-index: -1; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
@media (max-width: 420px) {
	.subnav.groups { gap: 0; }
	.subnav.groups a { flex: 1 1 auto; padding: 11px 3px; font-size: 13px; text-align: center; }
}
@media (max-width: 350px) {
	.subnav.groups a { padding: 11px 2px; font-size: 12px; }
	.subnav.groups .count { min-width: 16px; padding: 0 3px; margin-left: 0; }
}
.subnav a { flex: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.subnav a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.subnav a.active { background: var(--blue); color: #fff; }
.subnav .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; text-align: center; }
.subnav a.active .count { background: #fff; color: var(--blue); }
.stats.four { grid-template-columns: repeat(4, 1fr); }
a.stat { color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--line-strong); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.request { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.roster .chip.open, .day-panel .chip.open { border-color: var(--amber); background: var(--amber-soft); }
.roster .chip.open.unposted, .day-panel .chip.open.unposted { border-style: dashed; background: transparent; }
.roster .chip .req { color: var(--red); font-weight: 600; }
.roster tr.open-row td:first-child strong { color: var(--amber); }
code.copy { display: block; padding: 8px 10px; background: var(--surface); border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 860px) {
	.grid-2 { grid-template-columns: minmax(0, 1fr); }
	.stats.four { grid-template-columns: 1fr 1fr; }
}

/* ---------- care charts & checkboxes ---------- */
.chart-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.card.flagged { border-left: 4px solid var(--red); }
label.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--blue); }
label.check.inline { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chart-needs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
/* approval rows: put the buttons under the text when space is tight (dashboard columns) */
.grid-2 .request form { flex-basis: 100%; justify-content: flex-end; }

.bell { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.bell:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.bell .badge { top: -2px; right: -4px; }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pager [aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- client support schedule ---------- */
.week-plan { display: grid; gap: 6px; padding: 14px 16px; }
.week-plan .day { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; }
.week-plan .day > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.week-plan .track { position: relative; height: 34px; box-sizing: border-box; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.week-plan .road { display: block; width: 100%; height: 100%; }
.week-plan .road path { stroke: none; }
.week-plan .road a:hover path { opacity: .85; }
.week-plan .road path.active { fill: var(--blue); }
.week-plan .road path.sleepover { fill: var(--green); }
.week-plan .road path.active_night { fill: var(--amber); }
.week-plan .road path.external { fill: url(#road-hatch); }
.week-plan .hours { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 11px; color: var(--muted); }
.week-plan .hours div { display: flex; justify-content: space-between; }
.seg.active, .key.active { background: var(--blue); }
.seg.sleepover, .key.sleepover { background: var(--green); }
.seg.active_night, .key.active_night { background: var(--amber); }
.seg.external, .key.external { background: repeating-linear-gradient(135deg, var(--line-strong) 0 4px, var(--surface-2) 4px 8px); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); padding: 0 16px 14px; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.week-days { display: flex; flex-wrap: wrap; gap: 6px; }
.week-days label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; cursor: pointer; }
.week-days input { width: 16px; height: 16px; accent-color: var(--blue); }

/* day headings in shift lists: Today, Tomorrow, Wednesday 21 October … */
.day-heading { font-size: 15px; margin: 6px 2px 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.client-tabs { margin: 0 0 14px; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto;
	background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); padding: 4px; }
.picker-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 8px 10px;
	border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.picker-list button:hover, .picker-list button.active { background: var(--surface-2); }
.picker-list button span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.picker-list .none { padding: 8px 10px; color: var(--muted); }
.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; }
#notes textarea { min-height: 260px; }

/* clock-out checklist and client documents */
.checklist { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check-item.done > span:first-child { color: var(--green); font-weight: 700; }
.check-item.todo > span:first-child { color: var(--red); font-weight: 700; }
.check-item .pill { font-size: 11px; padding: 1px 6px; }
.doc-list { display: grid; gap: 0; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.doc-row:first-child { border-top: 0; }
@media print {
	.no-print, nav, header, .topbar, .sidebar { display: none !important; }
	.print-incident { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; padding: 12px; margin-bottom: 12px; }
	body { background: #fff !important; color: #000 !important; }
}
.doc-new { display: grid; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* wide tables scroll sideways on a phone instead of being cut off */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll > table { min-width: max-content; }
@media (min-width: 900px) { .table-scroll > table { min-width: 0; } }
/* the Manage tabs scroll too: fade the edge that has more tabs past it */
.subnav.more-right { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.subnav.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 85%, transparent); }
.subnav.more-left:not(.more-right) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }

/* shift page: tabs under the client card */
.shift-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; position: sticky; top: 60px; z-index: 5; overflow-x: auto; scrollbar-width: none; }
.shift-tabs::-webkit-scrollbar { display: none; }
.shift-tabs a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.shift-tabs a:hover { text-decoration: none; color: var(--text); background: var(--surface-2, rgba(0,0,0,.04)); }
.shift-tabs a.active { background: var(--blue); color: #fff; }
.shift-tabs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; }
.shift-tabs a.active .dot { background: #fff; }
/* how far through the shift: a circle that fills as time passes */
.time-ring { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.time-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.time-ring circle { fill: none; stroke-width: 10; }
.time-ring .track { stroke: var(--border); }
.time-ring .bar { stroke: var(--blue); stroke-linecap: round; transition: stroke-dasharray .6s; }
.time-ring.live .bar { stroke: var(--green); }
.time-ring.late .bar, .time-ring.over .bar { stroke: var(--amber); }
.time-ring.done .bar { stroke: var(--green); }
.time-ring .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.time-ring .label strong { font-size: 26px; line-height: 1.1; }
.time-ring .label span { color: var(--muted); font-size: 13px; max-width: 120px; }
/* photos of clients and staff (optional; initials when there is none) */
.client-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--border); }
.client-photo.lg { width: 56px; height: 56px; }
.client-photo.xl { width: 96px; height: 96px; }

/* collapsible settings sections (More): a row you tap to open, like the menu rows above */
.section-label { margin: 6px 4px -6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.folds .fold + .fold { border-top: 1px solid var(--border); }
.fold > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.fold > summary .chev { transition: transform .2s; color: var(--muted); }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold[open] > summary { border-bottom: 1px solid var(--border); }
.fold > .form, .fold > .fold-body { padding: 16px; }
.fold > .fold-body.flush { padding: 0; }
/* the hidden attribute always wins over layout classes (.stack, .card …) */
[hidden] { display: none !important; }
@media (max-width: 440px) {
	.shift-tabs a { padding: 9px 6px; font-size: 13px; flex: 1 1 0; min-width: 0; }
	.shift-tabs a svg { display: none; }
}

/* owner dashboard: new organisations per month */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; margin-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-col .bar { width: 100%; max-width: 46px; min-height: 3px; background: var(--blue); border-radius: 6px 6px 2px 2px; }
.bar-num { font-size: 12px; font-weight: 600; }
.bar-label { font-size: 12px; color: var(--muted); }

/* an overnight shift on each of its days: Day 1, Day 2 */
.day-part { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 6px; background: var(--blue-soft); color: var(--blue-dark); margin-bottom: 3px; }

/* a banner while the server can't be reached (uptime.js): the page under it stays readable */
.server-down {
	position: fixed; left: 8px; right: 8px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 1000;
	max-width: 720px; margin: 0 auto; padding: 10px 14px; border-radius: 12px;
	background: var(--amber-soft); color: var(--text); border: 1px solid var(--amber); font-size: 14px; box-shadow: var(--shadow);
}

/* progress notes: a small card with the shift's date and time; the note opens in place */
.note-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; align-items: start; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.note-card[open] { grid-column: 1 / -1; }
.note-card summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; cursor: pointer; list-style: none; }
.note-card summary::-webkit-details-marker { display: none; }
.note-card summary .icon { flex: none; color: var(--muted); transition: transform .15s; }
.note-card[open] summary .icon { transform: rotate(180deg); }
.note-card .note-when { display: block; }
.note-open { display: grid; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
h2.h3 { font-size: 15px; }
.sep + .sep::before { content: " · "; }

/* phones, and tablets or landscape phones held in the hand: wide tables become stacked rows (main.js labels each
   value), and text and buttons get bigger */
@media (max-width: 600px), (max-width: 959px) and (pointer: coarse) {
	table.stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; width: 100%; }
	.table-scroll > table.stacked { min-width: 0; }
	table.stacked tr { padding: 10px 14px; border-top: 1px solid var(--border); }
	table.stacked tbody tr:first-child { border-top: 0; }
	table.stacked td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; white-space: normal; text-align: right; }
	table.stacked td:first-child { font-weight: 600; text-align: left; }
	table.stacked td:empty { display: none; }
	table.stacked td[data-label]::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; }
	table.stacked td[colspan] { display: block; text-align: center; }
	.small, .note .head, .field label, .subnav a, .subnav-pages a { font-size: 14px; }
	.field .help, .stat .label, .stat .sub { font-size: 13px; }
	.page-head .row { flex-wrap: wrap; }
	.btn { height: 44px; }
	.btn.sm { height: 44px; padding: 0 14px; font-size: 14px; }
	.btn.icon-only { width: 44px; height: 44px; }
	.bell, .avatar { width: 44px; height: 44px; }
	.subnav a { padding-top: 12px; padding-bottom: 12px; }
	.subnav-pages a { padding-top: 12px; padding-bottom: 12px; }
	input[type=checkbox], input[type=radio], label.check input { width: 22px; height: 22px; }
	input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input:not([type]), select { min-height: 44px; font-size: 16px; }
	/* 16px stops phones zooming in on the box being typed in */
	textarea, input[type=time], input[type=tel] { font-size: 16px; }
	input[type=time], input[type=tel] { min-height: 44px; }
	.shift-tabs a { min-height: 44px; }
	a.back { display: inline-flex; align-items: center; min-height: 44px; }
	.picker-list button { min-height: 44px; }
}

/* a phone on its side: the bars scroll away with the page instead of taking half the screen */
@media (max-height: 500px) and (orientation: landscape) {
	.topbar { position: static; }
	.shift-tabs { position: static; }
	nav.tabs { height: 52px; }
	nav.tabs a span:not(.nav-icon) { font-size: 11px; }
}

/* keyboard focus and in-page links never land under the top bar or the bottom tabs */
html { scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
fieldset.field ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
nav.tabs a.active { font-weight: 700; box-shadow: inset 0 3px 0 var(--blue); }
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* quick time buttons under a time field (core/_time_picks.html) */
.field + .time-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.time-picks [aria-pressed="true"] { border-color: var(--blue); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.saved-times { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.saved-times [aria-pressed="true"] { border-color: var(--blue); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.saved-time { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 14px; }
.saved-time button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; }
.saved-time button:hover { background: var(--surface-2); color: var(--red); }

/* ---------- pages appearing ----------
   Every page's content grows out from the centre to fill the screen as it appears (300 ms, ease-out): after a click,
   a refresh or a first visit alike, in every browser. The top bar and the tabs don't move.
   Where the browser has cross-document view transitions (Chrome, Edge, Safari), moving between pages also slides
   the active tab's mark from the old tab to the new one; others skip the rule below and the @supports block, with
   the tab's usual highlight. Names used, each once a page: tab-bar, tab-mark, subnav-mark, page-tab-mark. */
main.page { animation: page-in 300ms cubic-bezier(.2, .8, .2, 1) backwards; transform-origin: 50% 30vh; }
@keyframes page-in { from { opacity: 0; transform: scale(.92); } }
@view-transition { navigation: auto; }
nav.tabs a { position: relative; isolation: isolate; }
.tab-mark { display: none; }
@supports (view-transition-name: none) {
	nav.tabs { view-transition-name: tab-bar; }
	nav.subnav.groups a.active { view-transition-name: subnav-mark; }
	.page-tab-mark { view-transition-name: page-tab-mark; }
	nav.tabs a.active { box-shadow: none; background: none; }
	nav.tabs a.active .tab-mark {
		display: block; position: absolute; z-index: -1; view-transition-name: tab-mark;
		left: 22%; right: 22%; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue);
	}
	@media (min-width: 960px) {
		nav.tabs a.active .tab-mark { inset: 0; height: auto; border-radius: 10px; background: var(--blue-soft); }
	}
	/* the marks slide; the tab bar is the same on both pages, so it doesn't move */
	::view-transition-group(tab-mark), ::view-transition-group(subnav-mark), ::view-transition-group(page-tab-mark) { animation-duration: 260ms; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
	::view-transition-group(tab-bar) { animation: none; }
	/* no cross-fade: the new page swaps in and its content grows in (main.page above), the same as on a refresh */
	::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
	/* still a change of page, but without movement */
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 1ms !important; }
}

/* ---------- feedback on things you can press ----------
   Hover: a gentle lift or colour change. Press: a quick squeeze (0.97). Keyboard focus: a clear outline. One set of
   timings (150 ms) for the whole site. Disabled controls get none of it. */
:where(.btn, button, nav.tabs a, .subnav a, .subnav-pages a, a.list-item, a.card, a.stat, a.chip, a.day-shift, .shift-row,
	input, select, textarea, summary) {
	transition: transform 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out,
		color 150ms ease-out, border-color 150ms ease-out, opacity 150ms ease-out;
}
:where(.btn, button):not(:disabled):hover { transform: translateY(-1px); }
:where(a.card, a.stat, a.chip, a.day-shift, .shift-row):hover { transform: translateY(-1px); box-shadow: var(--shadow); }
:where(a.list-item, .subnav-pages a):hover { background-color: var(--surface-2); }
:where(nav.tabs a):hover { color: var(--blue); }
:where(input, select, textarea):not(:disabled):hover { border-color: var(--line-strong); }
:where(.btn, button, nav.tabs a, .subnav a, a.list-item, a.card, a.stat, a.chip, a.day-shift, .shift-row, summary):not(:disabled):active {
	transform: scale(.97); transition-duration: 100ms;
}
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	/* colour changes stay; no lift or squeeze */
	:where(.btn, button, nav.tabs a, .subnav a, a.list-item, a.card, a.stat, a.chip, a.day-shift, .shift-row, summary):hover,
	:where(.btn, button, nav.tabs a, .subnav a, a.list-item, a.card, a.stat, a.chip, a.day-shift, .shift-row, summary):active { transform: none; }
}
