/* Staffgrove application, wide screens first. The phone app layout is in mobile.css. */
.app-body { --bar: 40px; }
.app-body .demo-bar { position: sticky; top: 0; z-index: 15; height: var(--bar); flex-wrap: nowrap; white-space: nowrap; }
h1, h2, h3 { text-wrap: balance; }

/* Header: who you are on the first line, places to go on the second */
.top { position: sticky; top: var(--bar); z-index: 12; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; max-width: 1320px; margin: 0 auto; padding: 10px 28px 6px; }
.top-company { padding-left: 16px; border-left: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-user > span:not(.avatar) { display: grid; line-height: 1.25; white-space: nowrap; }
.top-user small { color: var(--ink-2); font-size: 13px; }
.topnav { max-width: 1320px; margin: 0 auto; padding: 0 22px; }
.tabs-nav { display: flex; flex-wrap: wrap; column-gap: 6px; }
.tabs-nav a { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 9px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs-nav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.tabs-nav a.is-active { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 700; }
.tabs-nav .icon { width: 16px; height: 16px; }
@media (max-width: 1180px) { .tabs-nav a { padding: 0 6px; font-size: 14.5px; } .tabs-nav .icon { display: none; } .topnav { padding: 0 18px; } .top-row { padding-inline: 24px; } }
@media (max-width: 900px) { .top-company { display: none; } }

.avatar { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 99px; background: var(--accent-tint); color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.avatar-big { width: 60px; height: 60px; font-size: 20px; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.pill-accent { background: var(--accent); color: #fff; }
.icon-btn { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }

.content { max-width: 1320px; margin: 0 auto; padding: 24px 28px 64px; }
.content > * + * { margin-top: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1, .record-head h1, .locked h1, .profile h1, .article h1 { font: 600 28px/1.2 var(--head); }
.page-head p, .record-head p, .profile p { margin-top: 2px; color: var(--ink-2); }
.page-actions, .actionbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions:empty, .actionbar:empty { display: none; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 700; text-decoration: none; font-size: 14.5px; }
.back + * { margin-top: 6px; }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }

.card { min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.card-head a:not(.btn) { font-size: 14px; font-weight: 700; }
.card h2, .runbanner h2 { font: 600 18px/1.3 var(--head); }
.card h2 + p { margin-top: 4px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.columns-wide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.column { display: grid; gap: 18px; min-width: 0; }
.muted { color: var(--ink-2); }
.hint { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.late { color: var(--danger); font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 13px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.tone-ok { background: var(--ok-tint); color: var(--ok); }
.tone-neutral { background: var(--soft); color: #4a4044; }
.tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-danger { background: var(--danger-tint); color: var(--danger); }
.tone-info { background: var(--info-tint); color: var(--info); }
.tone-wait { background: var(--wait-tint); color: var(--wait); }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); background: var(--info-tint); }
.callout-warn { background: var(--warn-tint); }
.callout .icon { margin-top: 3px; }
.empty { padding: 20px 14px; text-align: center; }
.empty h3 { font: 600 16px/1.3 var(--head); }
.empty p { margin-top: 3px; color: var(--ink-2); }
.empty .btn { margin-top: 12px; }
.list-empty { padding: 8px; }
.meter { display: block; height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* Summary figures */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { display: flex; flex-direction: column; padding: 13px 20px; color: var(--ink); text-decoration: none; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat:hover { background: #fcf5f6; }
.stat-name { color: var(--ink-2); font-size: 14px; }
.stat-value { font: 600 28px/1.35 var(--head); font-variant-numeric: lining-nums tabular-nums; }
.stat-sub { color: var(--ink-2); font-size: 13.5px; }

/* Filters, tabs, segmented */
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.filter-selects { display: flex; flex-wrap: wrap; gap: 10px; }
.filter { display: grid; gap: 2px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.filter select { min-height: 40px; max-width: 100%; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 500; }
.searchfield { display: flex; align-items: center; gap: 9px; flex: 1 1 240px; max-width: 360px; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.searchfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.searchfield input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; color: var(--ink); outline: none; }
.list-count { color: var(--ink-2); font-size: 14px; }
.content > .list-count + * { margin-top: 8px; }
.tabs { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-2); font-weight: 700; cursor: pointer; }
.tab.is-active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.segmented { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; gap: 4px; padding: 4px; border-radius: 10px; background: #ede8e9; }
.segmented button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-weight: 700; cursor: pointer; white-space: nowrap; }
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(60, 30, 40, .18); }

/* Tables */
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th { padding: 10px; background: #fbf9f9; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr[data-href] { cursor: pointer; }
tbody tr[data-href]:hover { background: #fcf6f7; }
tfoot th, tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; background: #fbf9f9; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.num { text-align: right; }
.grow { width: 30%; white-space: normal; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--accent-dark); text-decoration: underline; }
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 32px; height: 32px; font-size: 12px; }
.cell-main { display: block; line-height: 1.3; font-weight: 700; }
.cell-main small { display: block; color: var(--ink-2); font-size: 13px; font-weight: 400; }
.notes { display: flex; flex-wrap: wrap; gap: 4px; min-width: 120px; white-space: normal; }
.notes em { padding: 0 7px; border-radius: 5px; background: var(--wait-tint); color: var(--wait); font-size: 12.5px; font-style: normal; font-weight: 700; line-height: 1.7; white-space: nowrap; }
@media (max-width: 1180px) { .hide-md { display: none; } th, td { padding-inline: 8px; } }

/* Lists on cards */
.queue > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 11px 0; }
.queue > li + li, .today li + li, .away li + li, .newslist li + li, .log li + li, .tasks li + li, .holidays li + li, .coverdays li + li, .blockers li + li { border-top: 1px solid var(--line); }
.queue > li:first-child { padding-top: 0; }
.queue > li:last-child { padding-bottom: 0; }
.queue-main { display: flex; flex: 1 1 260px; align-items: center; gap: 12px; min-width: 0; color: var(--ink); text-decoration: none; }
.queue-main > span:not(.avatar) { display: grid; min-width: 0; line-height: 1.4; }
.queue-main > span > span { color: var(--ink-2); font-size: 14.5px; }
a.queue-main:hover strong { color: var(--accent-dark); }
.queue-actions { display: flex; gap: 6px; }
.clashnote { display: flex; align-items: flex-start; gap: 5px; color: var(--danger) !important; font-weight: 700; font-size: 13.5px !important; }
.clashnote .icon { width: 14px; height: 14px; margin-top: 3px; }
.today li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.today a { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font-weight: 700; text-decoration: none; }
.today .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.away li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; padding: 8px 0; font-size: 14.5px; }
.newslist a { display: grid; padding: 9px 0; color: var(--ink); text-decoration: none; line-height: 1.4; }
.newslist a:hover strong { color: var(--accent-dark); }
.newslist small { color: var(--ink-2); }
.newslist em { padding: 0 6px; border-radius: 99px; background: var(--wait-tint); color: var(--wait); font-size: 12px; font-style: normal; }
.bigline { display: grid; font: 600 20px/1.35 var(--head); }
.bigline small { color: var(--ink-2); font: 400 14.5px/1.5 var(--font); }

/* Pay run stages */
.stages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stages li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 4px 2px; border-top: 4px solid var(--line); color: var(--ink-2); }
.stages i { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid var(--line-2); border-radius: 99px; font-size: 13px; font-style: normal; font-weight: 700; }
.stages i .icon { width: 14px; height: 14px; }
.stages span { display: grid; line-height: 1.3; }
.stages b { font-size: 15px; }
.stages small { font-size: 13px; }
.stages li.is-done { border-top-color: var(--accent); }
.stages li.is-done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.stages li.is-now { border-top-color: var(--accent); color: var(--ink); }
.stages li.is-now i { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }
.runbanner-top, .stagepanel-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.stagepanel-top > div:first-child { flex: 1 1 360px; }
.runbanner p, .stagepanel p { color: var(--ink-2); }
.runbanner .stages { margin-top: 16px; }
.runnums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.runnums dt, .totals dt { color: var(--ink-2); font-size: 13.5px; }
.runnums dd { font: 600 22px/1.35 var(--head); font-variant-numeric: lining-nums tabular-nums; }
.stagepanel { border-left: 4px solid var(--accent); }
.stagepanel.stage-locked { border-left-color: var(--ok); }
.blockers { margin-top: 14px; border-top: 1px solid var(--line); }
.blockers li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.blockers li:last-child { padding-bottom: 0; }
.blockers a { display: flex; flex-wrap: wrap; gap: 2px 12px; min-width: 0; color: var(--ink); text-decoration: none; }
.blockers a span { color: var(--ink-2); }
.totals { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.totals dl { display: grid; grid-template-columns: 1fr 1fr 1fr 1.25fr; }
.totals dl > div { padding: 12px 20px; }
.totals dl > div + div { border-left: 1px solid var(--line); }
.totals dd { font: 600 23px/1.4 var(--head); font-variant-numeric: lining-nums tabular-nums; }
.totals .is-net { background: var(--accent-tint); }
.totals .is-net dt { color: var(--accent-dark); font-weight: 700; }
.reconcile { display: flex; align-items: flex-start; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ok); font-weight: 700; }
.reconcile .icon { margin-top: 3px; }
.reconcile.is-bad { color: var(--danger); }
.costline { padding: 0 20px 12px 46px; color: var(--ink-2); font-size: 14.5px; }
.adj-amount { display: grid; justify-items: end; line-height: 1.35; }
.adj-amount small { color: var(--ink-2); font-size: 13px; }
.log li { display: grid; padding: 8px 0; }
.log span { color: var(--ink-2); font-size: 14px; }

/* Payslip */
.slip { max-width: 760px; padding: 26px 30px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); }
.slip header > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding-bottom: 12px; border-bottom: 3px solid var(--accent); }
.slip header b { font: 600 20px/1.3 var(--head); }
.slip header span { color: var(--ink-2); }
.slip header dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 14px 0 6px; }
.slip header dt { color: var(--ink-2); font-size: 13px; }
.slip header dd { font-weight: 700; }
.slip-table { margin-top: 14px; }
.slip-table th, .slip-table td { padding: 7px 0 !important; background: none; white-space: normal; }
.slip-table td small { display: block; color: var(--ink-2); font-size: 13px; }
.slip-table .num { white-space: nowrap; padding-left: 12px !important; vertical-align: top; }
.slip-table tfoot th, .slip-table tfoot td { background: none; }
.slip-net { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-dark); font-weight: 700; }
.slip-net b { font: 600 26px/1.3 var(--head); font-variant-numeric: lining-nums tabular-nums; }
.slip-note { margin-top: 12px; color: var(--ink-2); font-size: 13.5px; }

/* People */
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.profile > div:nth-child(2) { flex: 1 1 240px; }
.profile p { margin-bottom: 4px; }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 8px 0; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { flex: none; color: var(--ink-2); }
.facts dd { min-width: 0; margin-left: auto; text-align: right; overflow-wrap: anywhere; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a, .chips span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; text-decoration: none; font-weight: 700; font-size: 14px; }

/* Onboarding */
.hires { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.hires a { display: flex; gap: 16px; align-items: flex-start; color: var(--ink); text-decoration: none; }
.hires a:hover { border-color: var(--accent); }
.hires a > span:not(.avatar) { display: grid; flex: 1; gap: 4px; min-width: 0; }
.hires strong { font: 600 18px/1.3 var(--head); }
.hires small, .hires a > span > span:not(.meter) { color: var(--ink-2); }
.tasks { margin-top: 10px; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.tasks li > span:not(.task-tools) { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.tasks small { color: var(--ink-2); font-size: 13.5px; }
.tasks .is-done b { color: var(--ink-2); font-weight: 500; text-decoration: line-through; }
.tick { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 2px solid var(--line-2); border-radius: 7px; background: var(--surface); cursor: pointer; }
.tick[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tick:disabled { cursor: not-allowed; background: var(--soft); border-style: dashed; }
.tick[aria-checked="true"]:disabled { background: #b78e97; border: 2px solid #b78e97; }
.task-tools { display: flex; gap: 6px; flex: none; }

/* Leave balances */
.balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.balance { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.balance > span:first-child { font-weight: 700; }
.balance b { grid-row: span 2; grid-column: 2; font: 600 36px/1 var(--head); color: var(--accent-dark); font-variant-numeric: lining-nums; }
.balbar { display: flex; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.balbar i { background: var(--accent); }
.balbar em { background: repeating-linear-gradient(135deg, var(--accent) 0 3px, var(--accent-tint) 3px 6px); }
.balance small { grid-column: 1 / -1; color: var(--ink-2); font-size: 13.5px; }
.clockcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.clockcard p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px !important; }

/* Team calendar */
.cal-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-nav strong { min-width: 150px; text-align: center; font: 600 17px/1.3 var(--head); }
.cal { table-layout: fixed; min-width: 700px; font-size: 13.5px; }
.cal th, .cal td { height: 34px; padding: 0 !important; border-bottom: 1px solid var(--line); background: none; }
.cal .cal-name { width: 172px; padding: 0 8px 0 16px !important; overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--ink); }
.cal-name a { color: inherit; text-decoration: none; }
.cal-name a:hover { color: var(--accent-dark); text-decoration: underline; }
.cal thead th { height: 46px; text-align: center; }
.cal thead .cal-name { font: 600 15px/1.3 var(--head); }
.cal-day span { display: block; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.cal-day b { display: block; color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.cal .is-monday { border-left: 1px solid var(--line-2); }
.cal .is-weekend, .cal .is-holiday { background: #f3efef; }
.cal .is-out { background: repeating-linear-gradient(135deg, transparent 0 5px, #ece7e8 5px 6px); }
.cal thead .is-today b { width: 24px; margin: 0 auto; border-radius: 99px; background: var(--ink); color: #fff; }
.cal tbody td.is-today { box-shadow: inset 0 0 0 100px rgba(156, 74, 90, .07); }
.cal-team > * { background: #fbf7f8 !important; border-top: 1px solid var(--line-2); }
.cal-team .cal-name { font-weight: 700 !important; font-family: var(--head); }
.cal-team .is-weekend, .cal-team .is-holiday { background: #efe9ea !important; }
.cal-count { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal-count.is-over { background: var(--danger) !important; color: #fff; }
.cal-count.is-risk { background: var(--wait-tint) !important; color: var(--wait); box-shadow: inset 0 0 0 1.5px #c99a1e; }
.bar { display: flex; align-items: center; justify-content: center; height: 24px; margin: 0 2px; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.bar.joins-left { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.joins-right { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar-vacation { --bar-c: var(--accent); background: var(--accent); }
.bar-sick { --bar-c: var(--sick); background: var(--sick); }
.bar-unpaid { --bar-c: var(--unpaid); background: var(--unpaid); }
.bar-away { background: #8d8084; }
.bar-pending { background: repeating-linear-gradient(135deg, #fff 0 4px, var(--accent-tint) 4px 8px); color: var(--ink); box-shadow: inset 0 2px 0 var(--bar-c, var(--accent)), inset 0 -2px 0 var(--bar-c, var(--accent)); }
a.bar:hover { filter: brightness(1.12); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px 4px; font-size: 13.5px; }
.cal-legend li { display: flex; align-items: center; gap: 7px; }
.cal-legend i { width: 22px; height: 12px; margin: 0; border-radius: 4px; }
.cal-legend .key-holiday { background: #ebe5e6; border: 1px solid var(--line-2); }
.cal-legend .key-over { background: var(--danger); }
.cal-foot { padding: 4px 16px 14px; color: var(--ink-2); font-size: 13.5px; }
.coverdays li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 9px 0; }
.coverdays b { min-width: 104px; }
.coverdays span:not(.badge) { flex: 1 1 180px; color: var(--ink-2); font-size: 14.5px; }
.leavepreview { padding: 10px 12px; border-radius: var(--radius); background: var(--soft); font-size: 14.5px; }

/* Timesheets and attendance */
.days li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 96px; align-items: center; gap: 12px; min-height: 50px; border-bottom: 1px solid var(--line); }
.days label { display: grid; line-height: 1.3; }
.days label span, .day-note { color: var(--ink-2); font-size: 14px; }
.days input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); text-align: right; font-weight: 700; }
.days input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.days strong { text-align: right; }
.days .is-weekend label b { color: var(--ink-2); }
#sheetform .form-error { margin-top: 10px; }
.formbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.formbar > span { margin-right: auto; color: var(--ink-2); font-size: 14px; }
.formbar > span:empty { display: none; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; }
.tally li { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.tally b { font: 600 17px/1.2 var(--head); font-variant-numeric: lining-nums; }

/* Holidays and news */
.holidays li { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.holidays li > span:nth-child(2) { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.holidays small { color: var(--ink-2); }
.holidays .is-past { opacity: .72; }
.datebox { display: grid; justify-items: center; flex: none; width: 48px; padding: 4px 0; border-radius: var(--radius); background: var(--accent-tint); color: var(--accent-dark); font-size: 12px; font-weight: 700; line-height: 1.2; }
.datebox b { font: 600 19px/1.2 var(--head); font-variant-numeric: lining-nums; }
.posts { display: grid; gap: 12px; max-width: 860px; }
.posts a { display: grid; gap: 4px; color: var(--ink); text-decoration: none; }
.posts a:hover { border-color: var(--accent); }
.posts strong { font: 600 18px/1.35 var(--head); }
.posts a > span:last-child { color: var(--ink-2); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-meta small { color: var(--ink-2); font-size: 13.5px; }
.article { max-width: 760px; }
.article > * + * { margin-top: 12px; }
.article h2 { font-size: 22px; }
.article-body { font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-line; }

.locked { max-width: 520px; margin: 48px auto !important; text-align: center; }
.locked > .icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--accent); }
.locked p { margin: 8px 0 18px; color: var(--ink-2); }
.noscript { padding: 40px; text-align: center; }

/* Role choice */
.signin { max-width: 960px; margin: 0 auto; padding: 44px 20px 64px; text-align: center; }
.signin h1 { margin-top: 30px; font: 600 clamp(27px, 3.6vw, 36px)/1.2 var(--head); }
.signin-sub { max-width: 54ch; margin: 8px auto 0; color: var(--ink-2); }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; text-align: left; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; height: 100%; padding: 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); cursor: pointer; text-align: left; transition: border-color .14s, transform .14s; }
.role:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-dark); }
.role-icon .icon { width: 24px; height: 24px; }
.role-title { margin-top: 10px; font: 600 20px/1.25 var(--head); }
.role-name { color: var(--accent-dark); font-weight: 700; }
.role-short { display: none; }
.role-points { display: grid; gap: 7px; margin-top: 12px; color: var(--ink-2); font-size: 14.5px; }
.role-points > span { display: flex; gap: 8px; }
.role-points .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
.switchlist { display: grid; gap: 8px; }
.switchlist button { display: grid; width: 100%; min-height: 56px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); text-align: left; cursor: pointer; }
.switchlist button:hover, .switchlist [aria-current] { border-color: var(--accent); background: var(--accent-tint); }
.switchlist small { color: var(--ink-2); font-size: 14px; }

/* Popups: the title and buttons stay in view while the fields scroll */
dialog { width: min(600px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); overflow: hidden; box-shadow: 0 30px 70px -20px rgba(40, 20, 28, .55); }
dialog::backdrop { background: rgba(42, 30, 34, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.modal-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 600 19px/1.3 var(--head); }
.modal-body { min-height: 0; padding: 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > * + * { margin-top: 12px; }
.modal-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.wide { grid-column: 1 / -1; }
.modal-note { color: var(--ink-2); }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { color: var(--ink-2); font-size: 13.5px; font-weight: 700; }
.field em { font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.error { display: block; color: var(--danger); font-size: 13.5px; font-weight: 700; }
.error:empty { display: none; }
.form-error { padding: 9px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.toasts { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: 0 12px 28px -12px rgba(40, 20, 28, .6); }
.toast .icon { margin-top: 3px; color: #a9dcb4; }
.toast-warn .icon { color: #ffc766; }

/* Charts take the page accent */
.xc { --xc-bar: var(--accent); --xc-bar-hi: var(--accent-dark); --xc-b2: #4d7ea0; --xc-b2-hi: #3d6a8c; --xc-hover: rgba(156, 74, 90, .08); --xc-ink: var(--ink); --xc-ink2: var(--ink-2); }

@media (max-width: 1120px) {
  .columns, .columns-wide { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal .cal-name { width: 140px; }
}
@media (max-width: 900px) {
  .roles { grid-template-columns: minmax(0, 1fr); }
  .totals dl { grid-template-columns: 1fr 1fr; }
  .totals dl > div:nth-child(3) { border-left: 0; }
  .totals dl > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stages small { display: none; }
}

@media print {
  .demo-bar, .top, .back, .page-head, .preview, .toasts, .m-bar, .m-tabs, .m-content > .btn { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .slip { max-width: none; border: 0; padding: 0; }
}
/* Loading placeholder shown while a screen opens */
.page-skel { display: grid; grid-column: 1 / -1; align-content: start; gap: 14px; width: 100%; min-width: 0; padding: 2px; }
.page-skel i { display: block; height: 96px; border-radius: var(--radius-lg, 8px); background: linear-gradient(90deg, rgba(100, 112, 128, .13) 25%, rgba(100, 112, 128, .05) 50%, rgba(100, 112, 128, .13) 75%); background-size: 200% 100%; animation: skel-shimmer 1s linear infinite; }
.page-skel .sk-title { width: min(280px, 70%); height: 30px; }
.page-skel .sk-line { width: min(420px, 90%); height: 14px; }
.page-skel > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.page-skel .sk-block { height: 280px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .page-skel > div { grid-template-columns: minmax(0, 1fr); } .page-skel > div i { height: 68px; } }
.page-in > * { animation: page-in .3s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
.page-skel.is-flush { box-sizing: border-box; padding: 22px 24px; }
