/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 680; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 0.9rem; font-weight: 650; }
p { margin: 0 0 0.6em; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.icon { flex: none; display: block; }

/* ============ App frame: slim top bar, optional period tabs, content ============ */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { min-width: 0; width: 100%; padding: 26px var(--gutter) 72px; flex: 1; }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 6px 22px; min-height: 52px; padding: 0 var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 0.98rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand b { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.logo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--ink); color: var(--surface); }

.menu-wrap { position: relative; }
.company-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; max-width: 34vw; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 10px; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink); }
.company-switch:hover { background: var(--surface-2); }
.company-switch .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--tenant); flex: none; }
.company-switch .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch .icon { color: var(--ink-3); }

/* Main sections: plain text tabs, the active one underlined in ink */
.nav { display: flex; align-self: stretch; gap: 2px; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; padding: 0 12px; color: var(--ink-3); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav a:focus-visible { outline-offset: -2px; }

.menu-wrap.user { margin-left: 4px; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px 0 4px; background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink-2); }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.avatar { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--ink); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; }

/* Sections of the open pay period */
.subbar { background: var(--surface-2); border-top: 1px solid var(--line); padding: 0 var(--gutter); }
.subnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 4px 12px; border-radius: 999px; color: var(--ink-3); text-decoration: none; font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.subnav a:hover { color: var(--ink); background: var(--surface-3); }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }

.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 230px; padding: 5px; }
.menu.right { left: auto; right: 0; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; padding: 7px 10px; border-radius: 5px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.menu button:hover, .menu a:hover, .menu [aria-selected="true"], .menu button:focus-visible, .menu a:focus-visible { background: var(--surface-2); outline: none; box-shadow: none; }
.menu .danger-text { color: var(--bad); }
.menu-head { display: grid; padding: 7px 10px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); line-height: 1.3; }
.menu-head .muted { font-size: 0.78rem; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; background: hsl(var(--h) 60% 48%); }
.caret { font-size: 0.7em; opacity: 0.8; margin-left: 2px; }

/* ============ Page header ============ */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head .sub { color: var(--ink-3); margin: 4px 0 0; font-size: 0.92rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.back-btn { margin-right: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; }

/* ============ Cards and KPI tiles ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px 24px; }
.card h2 { margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { min-width: 0; background: var(--surface); padding: 12px 14px 13px; }
.tile .label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value { font-size: clamp(1.05rem, 1.7vw, 1.3rem); font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-top: 3px; line-height: 1.2; white-space: nowrap; }
.tile .hint { font-size: 0.76rem; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.t-bad .value { color: var(--bad); }
.tile.t-warn .value { color: var(--warn); }
.tile.t-dss .value { color: var(--dss); }
.tile[role="button"] { cursor: pointer; }
.tile[role="button"]:hover { background: var(--surface-2); }
.tile[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }

/* ============ Buttons and forms ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--primary); color: var(--primary-ink); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 14px; min-height: 36px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s; }
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn.danger-text, .btn.ghost.danger-text { color: var(--bad); }
.btn.small { padding: 0 10px; min-height: 28px; font-size: 0.82rem; box-shadow: none; }
label.field, .field { display: grid; gap: 5px; align-content: start; font-size: 0.82rem; color: var(--ink-2); font-weight: 600; }
.field[hidden] { display: none; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 11px; min-height: 36px; max-width: 100%; transition: border-color 0.12s, box-shadow 0.12s; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder { color: var(--ink-3); }
textarea { width: 100%; min-height: 70px; padding: 8px 11px; resize: vertical; }
input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
input[type="color"] { padding: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.error-text { color: var(--bad); font-weight: 550; }
.field-msg { min-height: 1.2em; font-size: 0.82rem; font-weight: 500; }
.field-msg .err { color: var(--bad); }
.field input[aria-invalid="true"] { border-color: var(--bad); }

/* ============ Chips ============ */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.dss { background: var(--dss-bg); color: var(--dss); }
.chip.grey { background: var(--surface-2); color: var(--ink-3); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip-x { border: 0; background: none; padding: 0 0 0 2px; margin: 0; font: inherit; line-height: 1; color: inherit; opacity: .6; cursor: pointer; }
.chip-x:hover, .chip-x:focus-visible { opacity: 1; }
button.chip { cursor: pointer; font-family: inherit; }

/* Role label pill: automatic hue (--lh) or a picked colour (--lc) */
.chip.role { --lh: 200; background: hsl(var(--lh) 55% 93%); color: hsl(var(--lh) 55% 28%); }
:root[data-theme="dark"] .chip.role { background: hsl(var(--lh) 28% 20%); color: hsl(var(--lh) 70% 80%); }
.chip.role.custom { background: color-mix(in srgb, var(--lc) 15%, var(--surface)); color: color-mix(in srgb, var(--lc) 72%, var(--ink)); }
button.chip.role.editable:hover, button.chip.role.editable:focus-visible { border-color: hsl(var(--lh) 45% 55%); outline: none; box-shadow: none; }
button.chip.role.custom.editable:hover, button.chip.role.custom.editable:focus-visible { border-color: var(--lc); }
.label-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.label-quick .chip.current { outline: 2px solid hsl(var(--lh) 45% 45%); }
.label-pop { min-width: 250px; }
.label-pop input { width: 100%; }

/* DSS pill beside the label: see-through when off, solid when on */
button.chip.dss-toggle { cursor: pointer; font-family: inherit; }
button.chip.dss-toggle.off { background: transparent; color: var(--ink-3); opacity: 0.45; }
button.chip.dss-toggle.on { opacity: 1; }
button.chip.dss-toggle.off:hover, button.chip.dss-toggle.off:focus-visible { opacity: 1; border-color: var(--dss); color: var(--dss); outline: none; box-shadow: none; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[type="search"] { min-width: 220px; flex: 1; max-width: 320px; }
.toggle-chip, .check-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 0 12px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.toggle-chip:hover, .check-chip:hover { border-color: var(--ink-3); }
.toggle-chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.toggle-chip.attention:not([aria-pressed="true"]) { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); background: var(--bad-bg); }
.check-chip input { margin: 0; }
.filters select { min-height: 30px; font-size: 0.82rem; font-weight: 600; border-radius: 999px; }

/* ============ Tables ============ */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); max-height: 72vh; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; }
table.data th, table.data td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); white-space: nowrap; border-bottom-color: var(--line-strong); }
table.data th.num, table.data td.num { text-align: right; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:hover { color: var(--ink); }
table.data th button:focus-visible { outline: 2px solid var(--accent); }
table.data th[aria-sort] button { color: var(--ink); }
table.data th[aria-sort] button::after { content: attr(data-arrow); color: var(--accent); font-size: 0.8em; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr.is-dss td:first-child { box-shadow: inset 3px 0 0 var(--dss); }
/* DSS staff: red/white diagonal stripes, so a DSS row never reads as one of your own edits (amber) */
table.data tbody tr.is-dss { background-color: var(--surface); background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, #dc2626 12%, transparent) 0 8px, transparent 8px 16px); }
table.data tbody tr.is-dss.is-dss > td { background: transparent; }
table.data tfoot td { font-weight: 650; background: var(--surface-2); position: sticky; bottom: 0; border-top: 1px solid var(--line-strong); border-bottom: 0; }
table.data td .chip { white-space: normal; }
table.data td .chips { max-width: 340px; }
.name-btn { all: unset; cursor: pointer; font-weight: 600; color: var(--ink); }
.name-btn:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.name-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.name-cell { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.name-cell h2 { margin: 0; }
.row-link { color: var(--ink-3); text-decoration: none; font-size: 0.82rem; white-space: nowrap; }
.row-link:hover { color: var(--accent); }

/* Spreadsheet-style sheets */
.sheet-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); max-height: 68vh; }
table.sheet { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.sheet th, table.sheet td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; white-space: nowrap; }
table.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--ink-3); font-size: 0.7rem; font-weight: 600; text-align: center; }
table.sheet th.rownum { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; background: var(--surface-2); color: var(--ink-3); font-size: 0.7rem; font-weight: 600; text-align: center; }
table.sheet th.corner { left: 0; z-index: 3; }
table.sheet tr.labels td { font-weight: 650; background: var(--surface-2); }
table.sheet td.num { text-align: right; }
table.sheet td.link { cursor: pointer; color: var(--accent); font-weight: 550; }
table.sheet td.link:hover { text-decoration: underline; }
table.sheet tbody tr:hover td { background: var(--surface-2); }
table.sheet tr.bad-row td { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
table.sheet td.bad-cell { background: color-mix(in srgb, var(--bad) 20%, var(--surface)); font-weight: 650; }
.sheet-filters { margin-bottom: 10px; }
.sheet-tabs { display: flex; gap: 0; overflow-x: auto; padding: 0 6px; background: var(--surface-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.sheet-tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; padding: 8px 14px; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); border-top: 2px solid transparent; white-space: nowrap; }
.sheet-tab:hover { color: var(--ink); background: var(--surface); }
.sheet-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); border-top-color: var(--ink); }
.sheet-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet-tab .count { margin-left: 7px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 0.68rem; font-weight: 650; color: var(--ink-3); }
.sheet-tab.tinted::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--lc, hsl(var(--lh) 55% 52%)); }
.sheet-tab.tinted[aria-selected="true"] { border-top-color: var(--lc, hsl(var(--lh) 55% 52%)); }
.sheet-tabs .tab-actions { margin-left: auto; display: flex; }
.sheet-tab.action { color: var(--accent); }

/* Period page: compact summary so the sheet sits high; tabs pinned to the window bottom */
.period-page .sheet-wrap { max-height: calc(100vh - 170px); min-height: 320px; }
.period-page .table-wrap { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.period-page .sheet-tabs { position: sticky; bottom: 0; z-index: 5; }

/* ============ Drawer, dialogs, popovers ============ */
.scrim { position: fixed; inset: 0; background: rgb(15 23 42 / 45%); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--bg); z-index: 41; overflow: auto; box-shadow: var(--shadow-lg); border-left: 1px solid var(--line); }
.drawer-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.drawer-body { padding: 18px 22px 40px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.dialog { position: fixed; z-index: 42; inset: 0; display: grid; place-items: center; padding: var(--gutter); pointer-events: none; }
.dialog > div { pointer-events: auto; background: var(--surface); border-radius: 12px; padding: 22px; width: min(500px, 100%); max-height: calc(100vh - 2 * var(--gutter)); overflow: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: grid; gap: 14px; }
.dialog form { display: grid; gap: 14px; }
.pop-wrap { position: relative; display: inline-block; }
.popover { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; display: grid; gap: 10px; padding: 12px; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.popover label { cursor: pointer; font-weight: 600; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.manage-row input { flex: 1; }
.manage-row input[type="color"] { flex: none; width: 34px; height: 28px; min-height: 28px; border-radius: 7px; cursor: pointer; }
.manage-row .grow { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Payment editing */
.method-btn { background: none; border: 1px dashed transparent; border-radius: 999px; padding: 1px 2px; cursor: pointer; font: inherit; }
.method-btn:hover, .method-btn:focus-visible { border-color: var(--line-strong); }
.method-btn.none { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.method-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.method-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600; cursor: pointer; background: var(--surface); }
.method-opt:has(input:checked) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Toasts */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--surface); border-radius: var(--radius); padding: 10px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); animation: pop 0.18s ease-out; font-weight: 500; }
.toast.error { background: var(--bad); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* States and banners */
.state { text-align: center; padding: 44px 16px; color: var(--ink-3); }
.state h2 { color: var(--ink); margin-bottom: 6px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent); background: var(--info-bg); color: var(--info); font-weight: 550; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.banner.good { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }

/* ============ Import wizard ============ */
.steps { display: flex; gap: 0; margin: 0 0 22px; padding: 0; list-style: none; counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 9px; color: var(--ink-3); font-weight: 600; font-size: 0.88rem; padding-right: 14px; margin-right: 14px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); font-size: 0.75rem; }
.steps li:not(:last-child)::after { content: ""; width: 28px; height: 1px; background: var(--line-strong); margin-left: 5px; }
.steps li.done { color: var(--good); }
.steps li.done::before { content: "✓"; background: var(--good-bg); border-color: var(--good); color: var(--good); }
.steps li.current { color: var(--ink); }
.steps li.current::before { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.drop { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 52px 24px; text-align: center; background: var(--surface); display: grid; gap: 8px; justify-items: center; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { font-size: 1.2rem; }
.drop .icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 6px; }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop .btn { pointer-events: none; margin-top: 8px; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 20px; }
.how > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.how b { display: block; margin-bottom: 3px; }
.how span { color: var(--ink-3); }

/* ============ Detail blocks ============ */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.split > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; }
.split .label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.split .value { font-weight: 680; font-variant-numeric: tabular-nums; }
.explain-text { background: var(--surface-2); border-left: 3px solid var(--warn); border-radius: var(--radius-sm); padding: 12px 14px; }
.explain-text ul { margin: 6px 0 0; padding-left: 20px; }
.note { border-left: 3px solid var(--line-strong); padding: 4px 10px; margin-bottom: 8px; }
.note .meta { font-size: 0.76rem; color: var(--ink-3); }
.finding { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.report-item { padding: 16px 18px; break-inside: avoid; }
.report-item + .report-item { border-top: 1px solid var(--line); }

/* Login */
.login { max-width: 400px; margin: 14vh auto 0; padding: 0 var(--gutter); }
.login .card { padding: 28px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.login-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.login-brand b { font-weight: 600; color: var(--ink-3); }
.login h1 { font-size: 1.3rem; }
.login .btn { min-height: 40px; }

/* ============ Location check ============ */
.flag-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; min-width: 200px; }
.flag-line { font-size: 0.82rem; color: var(--ink-3); }
.flag-line.warn { color: var(--warn); }
.flag-line.error { color: var(--bad); font-weight: 600; }
.mp { margin: 0; display: grid; gap: 8px; }
.mp-svg { width: 100%; max-width: 520px; height: auto; display: block; }
.mp-bg { fill: var(--surface-2); }
.mp-t { fill: var(--ink); font-size: 12px; font-family: var(--font); paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px; stroke-linejoin: round; }
.mp-tiny { font-size: 10px; fill: var(--ink-3); }
.mp-ref { fill: none; stroke: var(--line-strong); stroke-dasharray: 2 4; }
.mp-ring { stroke-width: 2; }
.mp-ring.near { fill: color-mix(in srgb, var(--warn) 10%, transparent); stroke: var(--warn); }
.mp-ring.far { fill: color-mix(in srgb, var(--bad) 6%, transparent); stroke: var(--bad); stroke-dasharray: 6 4; }
.mp-ringlabel.near { fill: var(--warn); }
.mp-ringlabel.far { fill: var(--bad); }
.mp-axis { stroke: var(--ink-3); stroke-width: 1; }
.mp-site { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.mp-site-dot { fill: var(--surface); }
.mp-link { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 3; }
.mp-in { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.mp-out { fill: var(--dss); stroke: var(--surface); stroke-width: 2; }
.mp-north { fill: var(--ink-2); }
.mp-scale { fill: none; stroke: var(--ink); stroke-width: 2; }
.mp-trip { stroke: var(--bad); stroke-width: 2; }
.mp-bold { font-weight: 700; }
.mp-bad { fill: var(--bad); font-weight: 700; }
.mp figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.82rem; }
.mp-key { display: inline-flex; align-items: center; gap: 6px; }
.mp-key i { width: 12px; height: 12px; display: inline-block; border: 2px solid; }
.k-site { background: var(--ink); border-color: var(--ink); border-radius: 50%; }
.k-in { background: var(--accent); border-color: var(--accent); border-radius: 50%; }
.k-out { background: var(--dss); border-color: var(--dss); }
.k-near { border-color: var(--warn); border-radius: 50%; }
.k-far { border-color: var(--bad); border-radius: 50%; border-style: dashed; }
.loc-plan-row > td { background: var(--surface-2); padding: 16px 20px; }
.loc-row { cursor: pointer; }
.loc-tabs { display: flex; gap: 8px; margin: 16px 0 12px; }
.loc-site { padding: 16px 18px; display: grid; gap: 10px; }
.loc-site + .loc-site { margin-top: 10px; }
.loc-drop { padding: 28px 24px; }
.loc-drop h2 { font-size: 1.05rem; }
.conflict { border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); border-radius: var(--radius-sm); padding: 8px 12px; margin-top: 6px; }
.conflicts { display: grid; gap: 6px; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cmp-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }

/* ============ Small screens: the sidebar becomes a top bar with a menu ============ */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; padding-top: 8px; }
  .nav { order: 5; width: 100%; margin-left: 0; min-height: 40px; }
  .user-name { display: none; }
  .company-switch { max-width: 46vw; }
}
@media (max-width: 720px) {
  :root { --gutter: 14px; }
  h1 { font-size: 1.25rem; }
  .main { padding: 16px var(--gutter) 56px; }
  .page-head { margin-bottom: 16px; }
  .card-pad { padding: 16px; }
  .btn, input, select { min-height: 40px; }
  .btn.small { min-height: 32px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: 6px; margin-bottom: 16px; }
  .steps li { padding: 0; margin: 0; }
  .steps li:not(.current) { display: none; }
  .steps li::after { display: none; }
  .drop { padding: 32px 16px; }
  .actions .btn, .actions button, .actions .menu-wrap { flex: 1 1 auto; }
  .actions .menu-wrap .btn { width: 100%; }
  .drawer { width: 100vw; }
  .drawer-head { padding: 12px 14px; }
  .drawer-body { padding: 14px 14px 40px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  table.data { min-width: 640px; }
  table.data th, table.data td { padding: 9px 12px; white-space: nowrap; }
  table.data td .chips { max-width: none; flex-wrap: nowrap; }
  table.data td .chip { white-space: nowrap; }
  table.data th:first-child, table.data td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  table.data thead th:first-child { z-index: 3; background: var(--surface-2); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Polish */
.method-btn .chip, table.data td .method-btn .chip { white-space: nowrap; }
.steps li::before { display: none; }
.steps li.done::before { display: grid; }
.steps li.current { box-shadow: inset 0 -2px 0 var(--ink); padding-bottom: 4px; }
.steps li:not(:last-child)::after { margin-left: 14px; }

/* Staff directory: edit-in-place grid */
.edit-grid td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.edit-grid .staff-name { font-weight: 600; }
.edit-grid input { min-height: 30px; padding: 0 8px; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.edit-grid input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.edit-grid input.saved { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.cell-field { display: grid; gap: 2px; }
.cell-msg { font-size: 0.74rem; line-height: 1.3; max-width: 220px; }
.cell-msg:empty { display: none; }
.cell-msg .err { color: var(--bad); }
.linkish { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; }
.m-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.m-group.none { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-bg); }
.m-toggle { border: 0; border-right: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3); font: inherit; font-size: 0.8rem; font-weight: 650; padding: 0 9px; min-height: 30px; cursor: pointer; }
.m-toggle:last-child { border-right: 0; }
.m-toggle:hover { color: var(--ink); background: var(--surface-2); }
.m-toggle[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.edit-grid tr.row-fix td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.edit-grid tr.row-check td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.status-cell .chips { max-width: 260px; }
.staff-wrap { max-height: calc(100vh - 290px); }
.ready-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.edit-grid td:first-child { min-width: 250px; }
.edit-grid .name-cell { flex-wrap: nowrap; white-space: nowrap; }

/* Staff status: plain lines with a coloured dot (no pill blobs when the text wraps) */
.edit-grid td.status-cell { min-width: 230px; }
.status-list { list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 3px; font-size: 0.82rem; font-weight: 600; line-height: 1.35; }
.status-list li { display: flex; gap: 7px; align-items: baseline; }
.status-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; transform: translateY(-1px); background: currentColor; }
.status-list li.bad { color: var(--bad); }
.status-list li.warn { color: var(--warn); }
.status-list li.good { color: var(--good); }

.edit-grid th, .edit-grid td { padding-left: 10px; padding-right: 10px; }
.edit-grid td:first-child { min-width: 0; }
.edit-grid td.status-cell { min-width: 190px; }

/* Staff notes */
.notes-btn { all: unset; cursor: pointer; white-space: nowrap; font-size: 0.82rem; font-weight: 600; color: var(--ink-3); padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--line-strong); }
.notes-btn:hover, .notes-btn:focus-visible { color: var(--ink); border-color: var(--ink-3); }
.notes-btn.has { border-style: solid; color: var(--ink); background: var(--surface-2); }
.note-list { display: grid; gap: 10px; }
.note-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.note-card.imported { background: var(--surface-2); }
.note-meta { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; margin-bottom: 4px; }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Latest note shown in the staff row */
.edit-grid td:last-child { min-width: 220px; max-width: 300px; }
.note-peek { all: unset; cursor: pointer; display: grid; gap: 2px; width: 100%; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); color: var(--ink-3); font-size: 0.82rem; font-weight: 600; box-sizing: border-box; }
.note-peek:hover, .note-peek:focus-visible { border-color: var(--ink-3); color: var(--ink); }
.note-peek.has { border: 1px solid var(--line); background: #fffbea; color: var(--ink); font-weight: 500; }
:root[data-theme="dark"] .note-peek.has { background: #2a2614; }
.note-peek .peek-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; white-space: normal; }
.note-peek .peek-meta { font-size: 0.72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Staff grid: keep it within a laptop screen */
.edit-grid td:first-child { max-width: 270px; }
.edit-grid .name-cell { flex-wrap: wrap; white-space: normal; gap: 4px 8px; }
.edit-grid .staff-name { white-space: nowrap; }
.edit-grid td.status-cell { min-width: 170px; }
.edit-grid td:last-child { min-width: 190px; max-width: 240px; }
.note-peek .peek-text { -webkit-line-clamp: 1; }

.edit-grid td.status-cell { min-width: 150px; }
.edit-grid td:last-child { min-width: 250px; max-width: 300px; }
.note-peek .peek-text { -webkit-line-clamp: 2; }

/* name | label | DSS always on one line */
.edit-grid td:first-child { max-width: none; }
.edit-grid .name-cell { flex-wrap: nowrap; white-space: nowrap; }
.edit-grid th, .edit-grid td { padding-left: 8px; padding-right: 8px; }
.edit-grid td.status-cell { min-width: 140px; }
.edit-grid td:last-child { min-width: 200px; max-width: 260px; }

.edit-grid th, .edit-grid td { padding-left: 6px; padding-right: 6px; }
.edit-grid th:first-child, .edit-grid td:first-child { padding-left: 14px; }
.m-toggle { padding: 0 7px; }
.edit-grid td.status-cell { min-width: 130px; }
.edit-grid td:last-child { min-width: 170px; max-width: 240px; }

/* ============ TimeSheet brand: live clock, plays by itself every few seconds (and on hover) ============ */
.brand.tm { --ease: cubic-bezier(0.22, 1, 0.36, 1); gap: 10px; padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 10px; transition: background 0.3s; }
.brand.tm:hover, .brand.tm:focus-visible { background: var(--surface-2); outline: none; box-shadow: none; }
.tm-clock { flex: none; overflow: visible; transition: transform 0.6s var(--ease); }
.tm-tile { fill: var(--ink); transition: fill 0.4s; }
.tm-dial { fill: none; stroke: var(--surface); stroke-width: 1.8; stroke-dasharray: 100 100; }
.tm-tick { stroke: var(--surface); stroke-width: 1.2; stroke-linecap: round; opacity: 0; }
.tm-hour, .tm-minute { stroke: var(--surface); stroke-linecap: round; transform-origin: 16px 16px; transform-box: view-box; }
.tm-hour { stroke-width: 2.2; transform: rotate(60deg); transition: transform 1.1s var(--ease); }
.tm-minute { stroke-width: 1.6; transform: rotate(0deg); }
.tm-pin { fill: var(--surface); }
.tm-time { display: inline-flex; }
.tm-word { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; overflow: hidden; padding: 2px 0; }
.tm-ch { display: inline-block; }

.brand.tm:hover .tm-clock, .brand.tm:focus-visible .tm-clock, .brand.tm.play .tm-clock { transform: scale(1.06) rotate(-4deg); }
.brand.tm:hover .tm-tile, .brand.tm:focus-visible .tm-tile, .brand.tm.play .tm-tile { fill: var(--dss); }
.brand.tm:hover .tm-dial, .brand.tm:focus-visible .tm-dial, .brand.tm.play .tm-dial { animation: tm-dial 0.9s var(--ease) both; }
.brand.tm:hover .tm-tick, .brand.tm:focus-visible .tm-tick, .brand.tm.play .tm-tick { animation: tm-tick 1.2s ease-out both; animation-delay: calc(var(--i) * 70ms); }
.brand.tm:hover .tm-minute, .brand.tm:focus-visible .tm-minute, .brand.tm.play .tm-minute { animation: tm-sweep 1.2s var(--ease) both; }
.brand.tm:hover .tm-hour, .brand.tm:focus-visible .tm-hour, .brand.tm.play .tm-hour { transform: rotate(90deg); }
.brand.tm:hover .tm-ch, .brand.tm:focus-visible .tm-ch, .brand.tm.play .tm-ch { animation: tm-wave 0.7s var(--ease) both; animation-delay: calc(var(--i) * 35ms); }

@keyframes tm-dial { from { stroke-dasharray: 0 100; transform: rotate(-90deg); transform-origin: 16px 16px; } to { stroke-dasharray: 100 0; transform: rotate(-90deg); transform-origin: 16px 16px; } }
@keyframes tm-tick { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0.35; } }
@keyframes tm-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes tm-wave { 0% { transform: translateY(0); } 35% { transform: translateY(-38%); } 70% { transform: translateY(6%); } 100% { transform: translateY(0); } }

.login-brand .brand.tm { font-size: 1.15rem; color: var(--ink); text-decoration: none; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .brand.tm:hover .tm-clock { transform: none; }
}

/* ============ Search button + ⌘K palette ============ */
.search-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-3); font: inherit; font-size: 0.86rem; cursor: pointer; min-width: 190px; }
.search-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.search-btn .search-label { flex: 1; text-align: left; }
kbd { font: 600 0.7rem/1 var(--font); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-3); box-shadow: 0 1px 0 var(--line-strong); }
.pal-scrim { background: rgb(22 24 29 / 35%); backdrop-filter: blur(2px); }
.pal { position: fixed; z-index: 45; top: 12vh; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 28px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pal-in 0.16s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pal-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.98); } }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.pal-input { flex: 1; border: 0; box-shadow: none !important; min-height: 54px; font-size: 1.05rem; padding: 0; background: transparent; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow: auto; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pal-item.active { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--dss); }
.pal-avatar, .pal-kindicon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); font-size: 0.7rem; font-weight: 700; color: var(--ink-2); }
.pal-kindicon { border-radius: 7px; }
.pal-main { flex: 1; display: grid; min-width: 0; }
.pal-text { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-sub { font-size: 0.78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-kind { font-size: 0.72rem; color: var(--ink-3); white-space: nowrap; }
.pal-empty { padding: 22px; text-align: center; color: var(--ink-3); }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 0.76rem; color: var(--ink-3); }
.pal-foot kbd { margin-right: 2px; }

/* ============ Pay run tracker ============ */
.run { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; margin-bottom: 12px; }
.run-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 0.86rem; }
.run-bar { flex: 1; max-width: 240px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-left: auto; }
.run-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #6fd4b5)); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.run-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; counter-reset: run; }
.run-step { position: relative; display: grid; gap: 6px; align-content: start; padding-right: 10px; }
.run-step:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: 32px; right: 6px; height: 2px; background: var(--line-strong); border-radius: 2px; }
.run-step.done:not(:last-child)::after { background: var(--accent); }
.run-link { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: inherit; position: relative; z-index: 1; }
a.run-link:hover .run-title { text-decoration: underline; text-underline-offset: 3px; }
.run-dot { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
.run-step.done .run-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.run-step.current .run-dot { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 10%, transparent); animation: run-pulse 2s ease-in-out infinite; }
@keyframes run-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ink) 4%, transparent); } }
.run-text { display: grid; padding-top: 4px; background: var(--surface); padding-right: 6px; }
.run-title { font-weight: 650; font-size: 0.86rem; white-space: nowrap; }
.run-detail { font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; }
.run-step.current .run-detail { color: var(--bad); font-weight: 600; }
.run-step.done .run-detail { color: var(--accent); }
.run-mark { justify-self: start; margin-left: 38px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 1px 9px; font: inherit; font-size: 0.72rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.run-mark:hover { border-color: var(--accent); color: var(--accent); }

/* ============ Dashboard ============ */
.dash { display: grid; gap: 14px; }
.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 26px 30px; align-items: center; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%), var(--surface); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-value { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 750; letter-spacing: -0.035em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero-sub { color: var(--ink-3); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 18px; }
.hero-facts > div { display: grid; }
.hero-facts b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.hero-facts span { font-size: 0.78rem; color: var(--ink-3); }
.delta { font-size: 0.74rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; white-space: nowrap; justify-self: start; }
.delta.good { color: var(--good); background: var(--good-bg); }
.delta.bad { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-3); background: var(--surface-2); }
.hero-ring { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ring-wrap { position: relative; width: 168px; height: 168px; }
.ring { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 11; }
.ring-value { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dasharray 1.2s cubic-bezier(0.22, 1, 0.36, 1); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-num { font-size: 2.3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-of { font-size: 0.8rem; color: var(--ink-3); }
.ring-caption { display: grid; font-size: 0.86rem; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dash-wide { grid-column: 1 / -1; }
.dash-grid h2 { margin-bottom: 12px; }
.attn-list { display: grid; gap: 6px; }
.attn { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.attn:hover { border-color: var(--ink-3); background: var(--surface-2); transform: translateX(2px); }
.attn-value { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.attn.bad .attn-value { color: var(--bad); }
.attn.warn .attn-value { color: var(--warn); }
.attn-label { font-weight: 550; }
.attn-go { color: var(--ink-3); }
.all-clear { color: var(--good); font-weight: 600; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.split-bar span { width: 0; transition: width 1s cubic-bezier(0.22, 1, 0.36, 1); animation: grow 1s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes grow { to { width: var(--w); } }
.split-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.split-legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 10px; align-items: center; }
.split-legend i { width: 12px; height: 12px; border-radius: 3px; }
.split-legend b { font-variant-numeric: tabular-nums; }
.split-legend .muted { text-align: right; font-size: 0.82rem; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 8px; }
.trend-col { flex: 1; min-width: 0; height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; text-decoration: none; color: var(--ink-3); }
.trend-bar { align-self: end; width: min(56px, 100%); height: 0; border-radius: 6px 6px 2px 2px; background: var(--surface-3); animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes rise { to { height: var(--h); } }
.trend-col:hover .trend-bar { background: var(--line-strong); }
.trend-col.current .trend-bar { background: var(--ink); }
.trend-col.current { color: var(--ink); font-weight: 650; }
.trend-val { font-size: 0.74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend-label { font-size: 0.74rem; }

@media (max-width: 900px) {
  .run-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .run-step:nth-child(3)::after { display: none; }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .search-btn { min-width: 0; }
  .search-btn .search-label, .search-btn kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .split-bar span { width: var(--w); }
  .trend-bar { height: var(--h); }
}

/* Tracker: dot on top, words underneath, so the connector never crosses text */
.run-link { flex-direction: column; gap: 6px; align-items: flex-start; }
.run-text { padding-top: 0; background: none; }
.run-step:not(:last-child)::after { top: 13px; left: 36px; right: 8px; }
.run-mark { margin-left: 0; }
/* Hero facts: label under the number, delta beside the label */
.hero-facts { gap: 36px; }
.hero-facts > div { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; justify-content: start; }
.hero-facts b { grid-column: 1 / -1; }
.hero-facts .delta { grid-row: 2; grid-column: 2; }

/* Shift rows: core hours bold, signed in/out faint underneath; adjustment column */
.shift-day { display: grid; white-space: nowrap; }
.shift-cell { display: grid; gap: 1px; }
.shift-core { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-len { margin-left: 8px; font-weight: 500; color: var(--ink-3); font-size: 0.85em; }
.shift-signed { font-size: 0.78rem; color: var(--ink-3); opacity: 0.75; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-signed.none { color: var(--bad); opacity: 0.6; }
.adj-cell { display: grid; gap: 4px; min-width: 132px; }
.adj-input { width: 96px; min-height: 30px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.adj-input.pos { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line-strong)); }
.adj-input.neg { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-strong)); }
.adj-input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.adj-reason { min-height: 26px; font-size: 0.78rem; padding: 0 8px; }
.adj-reason:placeholder-shown { border-style: dashed; }
.adj-hint { font-size: 0.72rem; color: var(--ink-3); min-height: 1em; }
.adj-view { display: grid; text-align: right; }
.adj-view .pos, .adj-tag.pos { color: var(--good); }
.adj-view .neg, .adj-tag.neg { color: var(--bad); }
.adj-tag { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.drawer { width: min(980px, 100vw); }
.drawer .table-wrap { max-height: none; }
.adj-input:placeholder-shown { border-style: dashed; }

.label-cell { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.small-note { font-size: 0.78rem; font-weight: 500; }

/* Company name with its description underneath */
.co-text { display: grid; line-height: 1.15; text-align: left; min-width: 0; }
.co-text .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-desc { font-size: 0.7rem; font-weight: 500; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch { min-height: 38px; padding-top: 3px; padding-bottom: 3px; }

.newco { display: grid; gap: 6px; margin-top: 6px; min-width: 220px; }
.newco input { min-height: 32px; }
.sub-co::before { content: "↳ "; color: var(--ink-3); }

/* ============ Second-row section menu (pay period, settings) ============ */
.subbar { background: var(--surface); border-top: 1px solid var(--line); padding: 0 var(--gutter); }
.subbar-inner { display: flex; align-items: stretch; gap: 18px; min-height: 44px; }
.subbar-title { display: flex; align-items: center; padding-right: 18px; border-right: 1px solid var(--line); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); white-space: nowrap; }
.subnav { display: flex; align-items: stretch; gap: 4px; padding: 0; overflow-x: auto; scrollbar-width: none; }
.subnav a { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 0; color: var(--ink-3); text-decoration: none; font-size: 0.88rem; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; box-shadow: none; transition: color 0.15s, border-color 0.15s; }
.subnav a .icon { opacity: 0.7; }
.subnav a:hover { color: var(--ink); background: none; }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--dss); background: none; box-shadow: none; }
.subnav a[aria-current="page"] .icon { opacity: 1; color: var(--dss); }
@media (max-width: 720px) { .subbar-title { display: none; } }
.settings-card { max-width: 880px; }
.theme-choice { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--ink); }
.theme-choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-swatch { width: 44px; height: 30px; border-radius: 6px; border: 1px solid var(--line-strong); }
.theme-swatch.light { background: linear-gradient(135deg, #f7f6f3 50%, #ffffff 50%); }
.theme-swatch.dark { background: linear-gradient(135deg, #111214 50%, #191b1e 50%); }

/* ============ Hours sheet ============ */
.hours-wrap { max-height: calc(100vh - 120px); } /* scrolled down to it, the sheet reaches the bottom of the window (the top menus stay above it) */
.hours-grid td { vertical-align: middle; padding-top: 7px; padding-bottom: 7px; }
.hours-grid tr.grp td { background: var(--surface-2); border-top: 1px solid var(--line-strong); padding-top: 9px; padding-bottom: 9px; position: sticky; top: 33px; z-index: 1; }
.hours-grid tr.grp .grp-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.hours-grid tr.grp .grp-name:hover { text-decoration: underline; }
.hours-grid .grp-count { font-size: 0.78rem; }
.hours-grid .day-cell { display: grid; white-space: nowrap; }
.hours-grid .day-cell .muted { font-size: 0.78rem; }
.hours-grid .site-cell { max-width: 240px; }
.hours-grid .new-total .pos { color: var(--good); }
.hours-grid .new-total .neg { color: var(--bad); }
.xl-td { text-align: right; }
.xl-wrap { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.xl-cell { width: 92px; min-height: 30px; padding: 0 8px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.xl-cell:hover { border-color: var(--line-strong); }
.xl-cell:focus { border-color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 15%, transparent); background: #fffdf3; }
:root[data-theme="dark"] .xl-cell:focus { background: var(--surface-2); }
.xl-cell.pos { color: var(--good); }
.xl-cell.neg { color: var(--bad); }
.xl-cell.saving { opacity: 0.6; }
.xl-cell.saved { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.xl-cell[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }
.adj-money { min-width: 64px; font-size: 0.78rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* Shifts opened under a person on the pay-period table */
.caret-btn { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--ink-2); font-size: 1rem; transition: transform 0.15s, background 0.15s; }
.caret-btn:hover { background: var(--surface-3); color: var(--ink); }
.caret-btn.open { transform: rotate(90deg); color: var(--ink); }
.caret-btn.placeholder { cursor: default; }
.caret-btn:focus-visible { outline: 2px solid var(--accent); }
table.data tr.is-open > td { background: var(--surface-2); border-bottom-color: transparent; }
table.data tr.after-row > td { padding: 0 14px 14px 46px; background: var(--surface-2); }
table.data tr.after-row:hover { background: none; }
.inline-shifts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; }
.hours-grid.inline th { position: static; }
.inline-hint { margin: 0; padding: 8px 12px; font-size: 0.78rem; border-top: 1px solid var(--line); }
.day-cell { display: grid; white-space: nowrap; }
.day-cell .muted { font-size: 0.78rem; }

/* Editable Rate and Adjustment cells: right-aligned under their headings, the effect in small text underneath */
.xl-td { text-align: right; vertical-align: top; }
.xl-stack { display: inline-grid; justify-items: end; gap: 2px; }
.xl-money { position: relative; display: inline-flex; align-items: center; }
.xl-prefix { position: absolute; left: 8px; color: var(--ink-3); font-size: 0.85rem; pointer-events: none; }
.xl-cell.rate { width: 92px; padding-left: 20px; }
.xl-cell.rate.changed { color: var(--dss); border-color: color-mix(in srgb, var(--dss) 45%, var(--line-strong)); }
.cell-sub { font-size: 0.74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 1em; text-align: right; }
.cell-sub:empty { display: none; }
.hours-grid td.num, .hours-grid th.num { padding-right: 16px; }

/* Adjustment stepper:  [−] [+] [H] h [MM] m [+] */
.adj-ctrl { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); transition: border-color 0.15s, box-shadow 0.2s; }
.adj-ctrl:focus-within { border-color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.adj-ctrl.pos { border-color: color-mix(in srgb, var(--good) 55%, var(--line-strong)); }
.adj-ctrl.neg { border-color: color-mix(in srgb, var(--bad) 55%, var(--line-strong)); }
.adj-ctrl.saving { opacity: 0.75; }
.adj-ctrl.saved { box-shadow: 0 0 0 3px var(--good-bg); }
.adj-step { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; font-size: 1.05rem; font-weight: 700; color: var(--ink-2); background: var(--surface-2); user-select: none; }
.adj-step:hover { background: var(--surface-3); color: var(--ink); }
.adj-step:active { transform: scale(0.94); }
.adj-step:focus-visible { outline: 2px solid var(--accent); }
.adj-sign { all: unset; cursor: pointer; width: 16px; text-align: center; font-weight: 800; color: var(--ink-3); }
.adj-ctrl.pos .adj-sign { color: var(--good); }
.adj-ctrl.neg .adj-sign { color: var(--bad); }
.adj-num { width: 30px; min-height: 26px; padding: 0 4px; border: 0; background: transparent; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; box-shadow: none !important; }
.adj-num:focus { background: #fffdf3; border-radius: 4px; }
:root[data-theme="dark"] .adj-num:focus { background: var(--surface-2); }
.adj-ctrl.pos .adj-num { color: var(--good); }
.adj-ctrl.neg .adj-num { color: var(--bad); }
.adj-unit { font-size: 0.78rem; color: var(--ink-3); margin-right: 3px; }

/* Staff select mode */
.edit-grid .pick-cell { width: 34px; text-align: center; }
.edit-grid .pick-cell input { width: 17px; height: 17px; cursor: pointer; }
.select-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px; background: var(--ink); color: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.select-bar .muted { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.select-bar .btn { background: var(--surface); color: var(--ink); }
.select-bar .btn.ghost { background: transparent; color: var(--surface); border-color: color-mix(in srgb, var(--surface) 40%, transparent); }
.select-bar .btn.ghost.danger-text { color: #ffb3ab; }
.select-bar .btn:disabled { opacity: 0.4; }
.select-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

/* Merge dialog */
.dialog.merge-dialog > div { width: min(920px, 100%); }
.merge-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.merge-person { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font-weight: 500; }
.merge-person.keep { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.merge-person.off { opacity: 0.55; }
.merge-facts { font-size: 0.8rem; }
.merge-explain ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }
.merge-fields th[scope="row"] { width: 110px; color: var(--ink-2); font-size: 0.82rem; }
.merge-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.merge-opt { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.84rem; cursor: pointer; }
.merge-opt.on { border-color: var(--ink); background: var(--surface-2); }
.merge-fields td input[type="text"] { width: 100%; min-width: 160px; }

/* Bin */
.bin-what { display: grid; gap: 1px; }
.bin-what .muted { font-size: 0.8rem; }
.bin-soon { color: var(--bad); font-weight: 650; }
.row-pick { width: 16px; height: 16px; }

/* Resizable table columns */
table.data th.resizable { position: sticky; }
table.data th.resizable { overflow: visible; }
.col-grip { position: absolute; top: 0; right: -7px; width: 14px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.col-grip::after { content: ""; position: absolute; top: 20%; bottom: 20%; left: 6px; width: 2px; border-radius: 1px; background: var(--ink-3); opacity: 0.55; transition: background 0.15s, opacity 0.15s, top 0.15s, bottom 0.15s; }
.col-grip::before { content: ""; position: absolute; top: 50%; left: 3px; width: 8px; height: 14px; transform: translateY(-50%); border-radius: 3px; background: var(--surface, #fff); border: 1px solid var(--ink-3); opacity: 0.8; background-image: linear-gradient(90deg, transparent 2px, var(--ink-3) 2px, var(--ink-3) 3px, transparent 3px, transparent 4px, var(--ink-3) 4px, var(--ink-3) 5px, transparent 5px); }
th.resizable:hover .col-grip::after { opacity: 1; }
.col-grip:hover::after, .col-resizing .col-grip::after { top: 0; bottom: 0; background: var(--accent); width: 2px; opacity: 1; }
.col-grip:hover::before, .col-resizing .col-grip::before { border-color: var(--accent); opacity: 1; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
table.data[style*="fixed"] td { overflow: hidden; text-overflow: ellipsis; }
table.data[style*="fixed"] tr.after-row > td { overflow: visible; }

/* Who pays: "MFS" (company) or "MFS/D". Always visible, solid red when DSS is on. */
.chip.payer { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); opacity: 1; letter-spacing: 0.01em; }
.chip.payer.dss { background: var(--dss-bg); color: var(--dss); border-color: color-mix(in srgb, var(--dss) 35%, transparent); }
button.chip.payer.dss-toggle.off { background: var(--surface-2); color: var(--ink-2); opacity: 1; border: 1px solid var(--line-strong); }
button.chip.payer.dss-toggle:hover, button.chip.payer.dss-toggle:focus-visible { border-color: var(--dss); color: var(--dss); outline: none; box-shadow: none; }
button.chip.payer:disabled { cursor: default; }
button.chip.payer:disabled:hover { border-color: var(--line-strong); color: var(--ink-2); }

/* Editable cells sit right-aligned under their right-aligned headings (beats the generic table.data td rule) */
table.data td.xl-td { text-align: right; padding-right: 16px; }
table.data td.xl-td .xl-stack { margin-left: auto; }

/* The sign is the only button now: a clear +/− pill to switch adding / taking away */
.adj-ctrl { padding: 2px 6px 2px 2px; }
.adj-sign { all: unset; cursor: pointer; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; font-size: 1.1rem; font-weight: 800; background: var(--surface-2); color: var(--ink-2); user-select: none; }
.adj-sign:hover { background: var(--surface-3); color: var(--ink); }
.adj-sign:focus-visible { outline: 2px solid var(--accent); }
.adj-ctrl.pos .adj-sign { background: var(--good-bg); color: var(--good); }
.adj-ctrl.neg .adj-sign { background: var(--bad-bg); color: var(--bad); }
.adj-sign.neg { background: var(--bad-bg); color: var(--bad); }

/* Pay period totals row */
table.data tfoot td { white-space: nowrap; }
.foot-methods { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 600; }
.foot-method b { font-weight: 800; color: var(--ink-3); }
.foot-staff .muted { font-weight: 500; }
table.data[style*="fixed"] tfoot td { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }

/* "All shifts" master row */
.hours-grid tr.master-row td { position: static; background: var(--surface-2); }
.xl-cell.rate.master::placeholder { color: var(--ink-3); font-weight: 500; }
.paid-cell { display: grid; justify-items: end; line-height: 1.25; }
.paid-dss { font-size: 0.74rem; font-weight: 650; color: var(--dss); white-space: nowrap; }
.paid-sheet { font-size: 0.74rem; font-weight: 650; color: var(--bad); white-space: nowrap; cursor: help; }

a.subbar-title { text-decoration: none; gap: 6px; transition: color 0.15s; }
a.subbar-title:hover { color: var(--ink); }
a.subbar-title .up { font-size: 1.1rem; line-height: 1; transition: transform 0.15s; }
a.subbar-title:hover .up { transform: translateX(-2px); }
.paid-fixed { font-size: 0.74rem; font-weight: 600; color: var(--info); white-space: nowrap; }
table.data td .note-peek { min-width: 150px; max-width: 220px; }


/* Total cell: tap to pay a shift on core time or on the signed in/out time */
.basis-btn { all: unset; cursor: pointer; display: inline-grid; justify-items: end; gap: 1px; padding: 3px 8px; margin: -3px -8px; border-radius: 6px; border: 1px dashed transparent; text-align: right; }
.basis-btn:hover, .basis-btn:focus-visible { border-color: var(--line-strong); background: var(--surface); outline: none; }
.basis-btn.signed { background: var(--info-bg); }
.basis-btn.saving { opacity: 0.6; }
.basis-view { display: grid; justify-items: end; }
.basis-amt { font-variant-numeric: tabular-nums; }
.basis-tag { font-size: 0.7rem; color: var(--ink-3); white-space: nowrap; }
.basis-tag.signed { color: var(--info); font-weight: 650; }

/* Bin: Restore all / Delete all and their warnings */
.bin-all { gap: 8px; }
.bin-counts { margin: 10px 0 0; padding-left: 18px; }
.bin-counts li { margin: 2px 0; }
.bin-warn { border-left: 3px solid var(--bad); padding: 4px 0 4px 12px; margin: 8px 0 4px; }
.bin-warn ul { margin: 6px 0; padding-left: 18px; }
.bin-warn li { margin: 4px 0; }
.bin-failed { margin: 8px 0 0; padding-left: 18px; max-height: 260px; overflow: auto; }
.bin-failed li { margin: 4px 0; }

/* Import: Tag Milestone choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.choice input { margin-top: 3px; }

/* The payer chip is a DSS switch: a faint hint says so ("MFS · D?" / "MFS/D ✕") */
.chip.payer .payer-hint { font-weight: 500; opacity: 0.55; }
button.chip.payer.dss-toggle:hover .payer-hint, button.chip.payer.dss-toggle:focus-visible .payer-hint { opacity: 1; }
.foot-method { display: inline-flex; flex-wrap: wrap; gap: 0 4px; } /* a narrow Pay by column: the amount goes under its letter instead of being cut off */
.foot-methods { position: relative; z-index: 2; } /* amounts may run into the next (right-aligned) column instead of being cut */

/* Staff page: the person's own pay rate */
.rate-btn { display: grid; gap: 1px; text-align: left; background: none; border: 1px dashed transparent; border-radius: var(--radius-sm); padding: 3px 6px; font: inherit; color: inherit; cursor: pointer; min-width: 104px; }
.rate-btn:hover:not(:disabled), .rate-btn:focus-visible { border-color: var(--line-strong); outline: none; }
.rate-btn:disabled { cursor: default; }
.rate-btn .rate-main { font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-btn .rate-sub { font-size: 0.74rem; color: var(--ink-3); white-space: nowrap; }
.rate-btn .rate-sub.add { color: var(--ink-2); font-weight: 600; }
.rate-btn .rate-sub.strong { color: var(--warn); font-weight: 700; }
.rate-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.rate-days[hidden] { display: none; }
.rate-days .field { font-size: 0.78rem; }
.rate-input { width: 100%; font-variant-numeric: tabular-nums; }
.override-box { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.override-box input { margin-top: 3px; }
@media (max-width: 560px) { .rate-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rate-days .rate-input { padding-left: 6px; padding-right: 4px; }

/* "$ [ 35.00 ] per hour" money boxes (text, not number: no arrows that nudge the value by a cent) */
.money-input { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.money-input:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-2) 18%, transparent); }
.money-input .money-sign { padding: 0 2px 0 9px; color: var(--ink-3); font-weight: 600; }
.money-input .money-field { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent; padding-left: 3px; font-variant-numeric: tabular-nums; outline: none; }
.money-input .money-suffix { padding: 0 10px 0 4px; color: var(--ink-3); font-size: 0.82rem; white-space: nowrap; }
.rate-days .money-input .money-sign { padding-left: 6px; }
.rate-days .money-input .money-field { padding-right: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; justify-self: start; }
.seg-btn { border: 0; background: var(--surface); color: var(--ink-2); padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.on { background: var(--ink); color: var(--surface); }
.stack[hidden] { display: none; }
.rate-days .field { min-width: 0; }
.rate-days .money-input { min-width: 0; }
.rate-days .money-input .money-field { width: 100%; min-width: 0; padding-left: 1px; }
.rate-days .money-input .money-sign { padding: 0 0 0 5px; font-size: 0.8rem; }

/* Ask AI */
.ai-btn { white-space: nowrap; font-weight: 700; }
.ai-question { width: 100%; resize: vertical; min-height: 70px; font: inherit; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-example { cursor: pointer; white-space: normal; text-align: left; font-weight: 500; }
.ai-answer { white-space: pre-wrap; line-height: 1.5; }
.ai-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ai-actions li { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ai-actions li.bad { opacity: 0.75; }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.small-note { font-size: 0.8rem; }
.reset-filters { white-space: nowrap; color: var(--bad); }

/* Staff page: tap a name to edit it */
.name-edit { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.name-edit .name-pencil { opacity: 0; color: var(--ink-3); transition: opacity .12s; }
.name-edit:hover .name-pencil, .name-edit:focus-visible .name-pencil { opacity: 1; }
.name-edit:hover, .name-edit:focus-visible { text-decoration: underline dotted; outline: none; }
.dialog.form-dialog > div { width: min(640px, 100%); }

/* Pay period table: "Details ›" with "1 warning" under it (both open the details page) */
.details-link { display: inline-grid; gap: 1px; justify-items: start; white-space: nowrap; }
.details-link .details-count { font-size: 0.74rem; font-weight: 700; }
.details-link .details-count.warn { color: var(--warn); }
.details-link .details-count.bad { color: var(--bad); }

/* Pay period table: Short / Over / No sign-in under the Clocked time */
.clocked-cell { display: inline-grid; gap: 2px; justify-items: end; }
.clocked-cell .chip { font-size: 0.7rem; }

/* Pay period: total cost with the sub-companies */
.group-cost { margin-bottom: 12px; }
.group-cost .group-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.group-cost .group-part { white-space: nowrap; }
.group-cost a.group-part { text-decoration: none; border-bottom: 1px dotted currentColor; color: inherit; }
.group-cost .group-total { font-size: 1.25rem; }
.group-info { margin: 8px 0 0; }
.info-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--ink-3); font: italic 700 11px/1 Georgia, serif; cursor: pointer; padding: 0; display: inline-grid; place-items: center; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--ink-2); }

/* Pay period: the "Paid by MFS" tile with subbies (whole amount, parts under it) */
.tile.t-group { grid-column: span 2; }
.tile.t-group .group-parts, .tile.t-group .group-info { white-space: normal; overflow: visible; }
.tile.t-group .group-parts a { color: inherit; border-bottom: 1px dotted currentColor; text-decoration: none; }
.tile .label .info-btn { vertical-align: middle; margin-left: 4px; text-transform: none; }
@media (max-width: 700px) { .tile.t-group { grid-column: auto; } }

/* x on a message */
.banner-x { border: 0; background: none; color: inherit; font-size: 1.35rem; line-height: 1; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; opacity: 0.7; }
.banner-x:hover, .banner-x:focus-visible { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); outline: none; }
.paid-cleared { display: block; font-size: 0.74rem; font-weight: 700; color: var(--good); }

/* Notes: "Clear payment issues" switch on a note */
.clear-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 4px 12px 4px 6px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.clear-toggle .clear-switch { width: 28px; height: 16px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.clear-toggle .clear-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.clear-toggle.on { border-color: var(--good); color: var(--good); }
.clear-toggle.on .clear-switch { background: var(--good); }
.clear-toggle.on .clear-switch::after { left: 14px; }
.clear-opt { display: grid; justify-items: start; text-align: left; gap: 2px; width: 100%; white-space: normal; }

/* Hours: full screen spreadsheet */
.sheet-box .focus-bar { display: none; }
.sheet-box .filters .grow { flex: 1; }
.sheet-box.sheet-full { position: fixed; inset: 0; z-index: 35; background: var(--bg, var(--surface)); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.sheet-box.sheet-full .focus-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-box.sheet-full .focus-totals { color: var(--ink-2); font-size: 0.9rem; }
.sheet-box.sheet-full .hours-wrap { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.sheet-box:fullscreen { background: var(--bg, var(--surface)); }
body.sheet-full-open { overflow: hidden; }
/* Pay period overview in full screen: the table area takes the rest of the screen and scrolls */
.period-box.sheet-full > div:not(.focus-bar):not(.filters):not(.sheet-tabs) { flex: 1; min-height: 0; overflow: auto; }
.period-box.sheet-full > div[hidden] { display: none; }
.period-box.sheet-full .table-wrap, .period-box.sheet-full .staff-wrap { max-height: none; }
.period-box.sheet-full .sheet-tabs { flex: none; }
.clear-hint { margin-bottom: 10px; display: block; }
/* bottom row: "91 staff · T $62,207.00 · C $27,018.76 · X $90.00" on one line in the Staff column */
table.data tfoot .foot-staff { white-space: nowrap; }
table.data tfoot .foot-staff .foot-method { display: inline; white-space: nowrap; }

/* Hours: Week board (days across, a card per shift) */
.board-wrap[hidden] { display: none; }
.week-board { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.wb-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.wb-nav .grow { flex: 1; }
.wb-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; color: var(--ink-3); flex-wrap: wrap; }
.wb-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.wb-dot.good { background: var(--good); } .wb-dot.warn { background: var(--warn); } .wb-dot.bad { background: var(--bad); } .wb-dot.info { background: var(--info); }
.wb-scroll { overflow: auto; max-height: calc(100vh - 170px); } /* the top menus and the week bar stay above it; the board reaches the bottom of the window */
.wb-row { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; }
.wb-head { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.wb-day { display: grid; justify-items: center; padding: 8px 4px; font-size: 0.8rem; border-left: 1px solid var(--line); }
.wb-day:first-child { border-left: 0; }
.wb-day span { color: var(--ink-3); font-size: 0.74rem; }
.wb-day.out, .wb-cell.out { opacity: 0.45; }
.wb-foot { position: sticky; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.wb-group { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 1050px; text-align: left; border: 0; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 8px 12px; font: inherit; cursor: pointer; }
.wb-group .grow { flex: 1; }
.wb-group .wb-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.wb-caret { width: 14px; color: var(--ink-3); }
.wb-cell { display: grid; align-content: start; gap: 8px; padding: 8px; border-left: 1px solid var(--line); min-height: 40px; }
.wb-cell:first-child { border-left: 0; }
.wb-card { display: grid; gap: 2px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); border-left: 4px solid; font-size: 0.8rem; line-height: 1.35; transition: transform .1s, box-shadow .1s; }
.wb-card:hover, .wb-card:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.12)); outline: none; }
.wb-card.good { background: var(--good-bg); border-color: var(--good); }
.wb-card.warn { background: var(--warn-bg); border-color: var(--warn); }
.wb-card.bad { background: var(--bad-bg); border-color: var(--bad); }
.wb-card.info { background: var(--info-bg); border-color: var(--info); }
.wb-title { font-weight: 700; font-size: 0.86rem; }
.wb-site { color: var(--ink-2); }
.wb-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.wb-len { font-weight: 400; color: var(--ink-3); }
.wb-signed { color: var(--ink-3); font-size: 0.74rem; }
.wb-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.wb-flag { font-size: 0.68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); }
.wb-flag.adj { color: var(--info); }
.sheet-box.sheet-full .board-wrap { flex: 1; min-height: 0; display: flex; }
.sheet-box.sheet-full .board-wrap[hidden] { display: none; }
.sheet-box.sheet-full .week-board { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sheet-box.sheet-full .wb-scroll { flex: 1; max-height: none; }
.view-seg .seg-btn { padding: 5px 12px; }

/* a tile that filters the table, while its filter is on */
.tile[role="button"] { cursor: pointer; }
.tile.tile-on { box-shadow: inset 0 0 0 2px var(--dss); background: var(--dss-bg); }
.tile.tile-on .label::before { content: "✓ "; color: var(--dss); font-weight: 800; }
.tile.tile-on:not(.t-dss) { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface, transparent)); }
.tile.tile-on:not(.t-dss) .label::before { color: var(--accent); }
/* Hours: how the shifts total becomes what the company pays */
.pay-bridge[hidden] { display: none; }
.pay-bridge { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; }
.pay-bridge .pb-step { display: inline-flex; align-items: baseline; gap: 5px; cursor: default; white-space: nowrap; }
.pay-bridge .pb-op { color: var(--muted); font-weight: 700; }
.pay-bridge .pb-label { color: var(--muted); }
.pay-bridge .pb-sum strong { font-size: 14px; }
.pay-bridge .pb-sum .pb-label { color: var(--ink); font-weight: 600; }
.pay-bridge .pb-note { flex-basis: 100%; font-size: 12px; }
/* Issues: quick fix on each row */
.qf-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.qf { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.qf-col { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.qf-input { width: 150px; padding: 5px 8px; font-size: 13px; }
.qf-reason { width: 280px; min-height: 52px; font-size: 13px; padding: 6px 8px; }
/* Import: how to get the timesheet file (first time) */
.howto { margin-top: 16px; }
.howto summary { cursor: pointer; list-style-position: inside; }
.howto-body { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; margin-top: 14px; }
.howto-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.howto-shot { display: grid; gap: 6px; text-decoration: none; color: inherit; }
.howto-shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
@media (max-width: 800px) { .howto-body { grid-template-columns: 1fr; } }
/* Import: file notices, folded */
.notice-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.notice-group.warn { border-color: color-mix(in srgb, var(--warn, #b7791f) 40%, var(--line)); }
.notice-group summary { cursor: pointer; }
.notice-list { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.notice-names { margin: 10px 0 2px; line-height: 1.6; max-height: 240px; overflow: auto; }

/* "Pay this period" in a person's panel */
.pay-amount-row{gap:8px;flex-wrap:wrap;align-items:center}
.pay-amount-field{display:inline-flex;align-items:center;gap:4px;font-weight:600}
.pay-amount-input{width:120px;text-align:right}
.pay-amount-reason{flex:1 1 220px;min-width:0}

/* DSS hours: shown on the payer chip and asked for in the DSS dialog */
.payer-hours{font-weight:700}
.dss-hours-input{width:90px;text-align:right}
.dss-preview{margin:8px 0 0;min-height:1.4em}

/* Pay periods: "Weeks 2–3 of November" under the dates; periods not imported yet */
.period-cell{display:flex;flex-direction:column;gap:2px}
.period-weeks{font-size:12px;color:var(--ink-3)}
tr.period-missing td{color:var(--bad);background:color-mix(in srgb, var(--bad) 7%, transparent)}
tr.period-missing td .period-weeks{color:var(--bad);opacity:.8}
tr.period-upcoming td{color:var(--ink-3);opacity:.55}
a.chip{text-decoration:none}

/* Pay periods calendar */
.calendar{gap:12px}
.cal-head{align-items:center;gap:8px}
.cal-title{margin:0;min-width:10ch;text-align:center}
.cal-grid{display:flex;flex-direction:column;gap:4px}
.cal-week{display:grid;grid-template-columns:56px repeat(7,minmax(0,1fr));gap:4px;align-items:stretch}
.cal-dow{font-size:12px;font-weight:600;color:var(--ink-3);text-align:center}
.cal-wk{font-size:12px;color:var(--ink-3);display:flex;align-items:center}
.cal-day{display:flex;flex-direction:column;gap:2px;min-height:64px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);text-decoration:none;min-width:0}
a.cal-day:hover{border-color:var(--ink-3)}
.cal-num{font-weight:600;font-size:13px}
.cal-label{font-size:11px;line-height:1.25;overflow-wrap:anywhere}
.cal-out{opacity:.45}
.cal-open{background:color-mix(in srgb,var(--info) 11%,var(--surface));border-color:color-mix(in srgb,var(--info) 40%,transparent);color:var(--info)}
.cal-final{background:var(--good-bg);border-color:color-mix(in srgb,var(--good) 35%,transparent);color:var(--good)}
.cal-missing{background:var(--bad-bg);border-color:color-mix(in srgb,var(--bad) 45%,transparent);color:var(--bad)}
.cal-upcoming{background:var(--surface-2);color:var(--ink-3);opacity:.6}
.cal-today{box-shadow:0 0 0 2px var(--ink)}
.cal-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;color:var(--ink-3)}
.cal-key{display:inline-flex;align-items:center;gap:6px}
.cal-swatch{display:inline-block;width:14px;height:14px;border-radius:4px;border:1px solid var(--line)}
.cal-swatch.cal-today{background:var(--surface)}
@media (max-width:700px){.cal-week{grid-template-columns:36px repeat(7,minmax(0,1fr));gap:2px}.cal-day{min-height:44px;padding:4px}.cal-label{display:none}.cal-wk{font-size:10px}}
.cal-swatch.cal-open,.cal-swatch.cal-final,.cal-swatch.cal-missing,.cal-swatch.cal-upcoming{opacity:1;border-width:2px}

/* Payment status of a person in a pay period: PAID = red, Paid & Confirmed = green */
.pay-status { font: inherit; font-size: 0.8rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line, #ccc); background: var(--surface-2); color: var(--ink-3); max-width: 100%; }
span.pay-status { display: inline-block; border-color: transparent; }
select.pay-status { cursor: pointer; }
.pay-status.paid { background: var(--good-bg); color: var(--good); border-color: var(--good); }
.pay-status.confirmed { background: #fff3b0; color: #7a5b00; border-color: #e6b800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pay-status.confirmed { background: #4a3d00; color: #ffd84d; border-color: #b8960a; } }
:root[data-theme="dark"] .pay-status.confirmed { background: #4a3d00; color: #ffd84d; border-color: #b8960a; }
/* the whole Payment cell takes the colour, edge to edge */
select.pay-status { width: 100%; }
table.data tbody tr > td:has(.pay-status.paid) { background: var(--good-bg); }
table.data tbody tr > td:has(.pay-status.confirmed) { background: #fff3b0; }
:root[data-theme="dark"] table.data tbody tr > td:has(.pay-status.confirmed) { background: #4a3d00; }

/* Staff listing review: one tick box per proposed change */
.dialog.listing-dialog > div { width: min(860px, 100%); }
.listing-list { display: grid; gap: 8px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.listing-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.listing-card.off { opacity: 0.72; }
.listing-info { font-size: 0.82rem; }
.listing-change { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; cursor: pointer; }
.listing-label { min-width: 112px; font-weight: 600; color: var(--ink-2); }
.listing-from { text-decoration: line-through; color: var(--ink-3); }
.listing-field.w-bad { background: var(--bad-bg); border-radius: 8px; padding: 6px 8px; }
.listing-field.w-caution { background: var(--warn-bg); border-radius: 8px; padding: 6px 8px; }
.listing-warn { margin: 4px 0 0 26px; font-size: 0.82rem; font-weight: 600; }
.listing-warn.bad { color: var(--bad); }
.listing-warn.caution { color: var(--warn); }

/* Inactive staff: no issues shown, name and details lighter */
tr.row-inactive .staff-name, tr.row-inactive .name-edit { color: var(--ink-3); font-weight: 500; }
tr.row-inactive td { color: var(--ink-3); }
tr.row-inactive input, tr.row-inactive .m-toggle, tr.row-inactive .rate-btn { opacity: 0.7; }

/* Sheet Total row: stays in view at the bottom, also in full screen */
table.sheet tr.total-row td, table.sheet tr.total-row th { position: sticky; bottom: 0; background: var(--surface-2, #f1efe9); font-weight: 700; border-top: 2px solid var(--ink-3); z-index: 2; }

/* Pay period page: scrolling down locks the sheet to the screen (filters on top, tabs at the bottom, rows scroll inside) */
.period-page .period-box:not(.sheet-full) { position: sticky; top: var(--topbar-h, 86px); scroll-margin-top: var(--topbar-h, 86px); z-index: 6; height: calc(100vh - var(--topbar-h, 86px)); margin-bottom: calc(-1 * var(--below-h, 0px)); display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0; background: var(--bg, var(--surface)); }
.period-page .period-box:not(.sheet-full) > div:not(.focus-bar):not(.filters):not(.sheet-tabs) { flex: 1; min-height: 0; overflow: auto; }
.period-page .period-box:not(.sheet-full) > div[hidden] { display: none; }
.period-page .period-box:not(.sheet-full) .table-wrap, .period-page .period-box:not(.sheet-full) .staff-wrap, .period-page .period-box:not(.sheet-full) .sheet-wrap { max-height: none; }
.period-page .period-box:not(.sheet-full) .sheet-tabs { flex: none; position: static; }
/* locked sheet: the box around the table does the scrolling, so the column titles can stick to its top */
.period-page .period-box:not(.sheet-full) .table-wrap, .period-page .period-box:not(.sheet-full) .staff-wrap, .period-page .period-box:not(.sheet-full) .sheet-wrap { overflow: visible; }
.select-bar .menu-wrap { position: relative; }
.select-bar .menu { top: auto; bottom: calc(100% + 6px); }
table.sheet td.pick-cell, table.sheet th.colname:nth-child(2) { width: 34px; text-align: center; padding: 6px 8px; }

/* Hours page: same locked, full-height sheet as the pay period Overview */
.lock-box:not(.sheet-full) { position: sticky; top: var(--topbar-h, 86px); scroll-margin-top: var(--topbar-h, 86px); z-index: 6; height: calc(100vh - var(--topbar-h, 86px)); margin-bottom: calc(-1 * var(--below-h, 0px)); display: flex; flex-direction: column; gap: 8px; padding: 8px 0 0; background: var(--bg, var(--surface)); }
.lock-box:not(.sheet-full) > div:not(.focus-bar):not(.filters):not(.sheet-tabs) { flex: 1; min-height: 0; overflow: auto; max-height: none; }
.lock-box:not(.sheet-full) > div[hidden] { display: none; }
.grp-toggle { border: 0; background: none; cursor: pointer; font-size: 0.95rem; width: 22px; height: 22px; padding: 0; color: var(--ink-2); border-radius: 4px; }
.grp-toggle:hover { background: var(--surface-3); color: var(--ink); }

/* Expand / collapse arrows: a clear boxed button everywhere (pay period rows, Hours, Week board, Location) */
.caret-btn, .grp-toggle { all: unset; box-sizing: border-box; cursor: pointer; display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 6px; border: 1.5px solid var(--ink-3); background: var(--surface); color: var(--ink); font-size: 1.05rem; font-weight: 800; line-height: 1; transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s; }
.caret-btn:hover, .grp-toggle:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.caret-btn:focus-visible, .grp-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.caret-btn.placeholder { border-color: transparent; background: none; cursor: default; }
.caret-btn.open { background: var(--surface-3); }
.wb-caret { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid var(--ink-3); border-radius: 5px; color: var(--ink); font-weight: 800; background: var(--surface); }
.name-btn { font-weight: 700; }
.grp-hours { display: inline-flex; align-items: baseline; gap: 6px; margin-left: 14px; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 0.85rem; white-space: nowrap; }
.grp-hours .lbl { color: var(--ink-3); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.grp-hours.work { border-color: var(--accent); }

/* Chain: Adjustment of a person's row. Chained = all shifts; unchained = the person's total only */
.chain-row { display: flex; align-items: center; gap: 6px; }
.chain-btn { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--accent); background: var(--surface); font-size: 0.95rem; flex: none; }
.chain-btn:hover { background: var(--surface-3); }
.chain-btn.broken { border-color: var(--warn, #b45309); opacity: 0.9; }
.chain-btn.broken::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: var(--bad, #c0392b); transform: rotate(-45deg); }
.tot-adj { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 1.5px dashed var(--warn, #b45309); border-radius: 8px; }
.tot-adj[hidden] { display: none; }
.mode-btn { all: unset; cursor: pointer; font-size: 0.74rem; font-weight: 700; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap; }
.mode-btn:hover { background: var(--surface-3); }
.tot-adj.set-mode .adj-sign { display: none; }
.adj-ctrl[hidden] { display: none; }

/* Create timesheet dialog */
.ts-box { width: min(860px, 96vw); }
.ts-rows { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.ts-row { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.ts-fields { display: grid; grid-template-columns: 150px minmax(180px, 1fr) 110px 12px 110px 70px auto; gap: 8px; align-items: center; }
.ts-fields input { width: 100%; min-width: 0; }
.ts-dash { text-align: center; color: var(--ink-3); }
.ts-len { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }
.ts-hint { display: block; margin-top: 4px; font-size: 0.78rem; }
@media (max-width: 720px) { .ts-fields { grid-template-columns: 1fr 1fr; } }
.ts-weeks { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.ts-week { display: grid; grid-template-columns: minmax(240px, auto) 90px auto minmax(150px, 1fr); gap: 8px; align-items: center; }
.ts-week .ts-hint { grid-column: 1 / -1; margin: 0; }
.ts-week-label { font-weight: 650; font-size: 0.86rem; }
@media (max-width: 720px) { .ts-week { grid-template-columns: 1fr 1fr; } }

.ts-big { font-size: 1.6rem; font-weight: 700; padding: 8px 12px; max-width: 220px; font-variant-numeric: tabular-nums; }
.ts-preview { display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow: auto; }
.ts-pv-row { display: grid; grid-template-columns: 1fr 110px 120px; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.ts-pv-row strong, .ts-pv-row .muted { text-align: right; }
.ts-pv-sum { border-top: 2px solid var(--ink-3); border-bottom: 0; font-weight: 700; }

/* A shift changed from the imported timesheet (time adjusted, rate changed, other pay basis): lightly highlighted.
   Only that shift's own row. A person's row is lit only when a total adjustment was put on the person. */
.hours-grid tr.shift-row.edited td { background: color-mix(in srgb, var(--warn, #d97706) 13%, var(--surface)); }
.hours-grid tr.grp.edited td { background: color-mix(in srgb, var(--warn, #d97706) 13%, var(--surface-2)); }
/* Overview: a person whose hours or rate were changed from the imported timesheet */
table.data tbody tr.row-edited > td { background: color-mix(in srgb, var(--warn, #d97706) 13%, var(--surface)); }

/* Week board inside the locked Overview sheet */
.period-page .period-box:not(.sheet-full) .board-wrap { display: flex; flex-direction: column; }
.period-page .period-box:not(.sheet-full) .board-wrap[hidden] { display: none; }
.period-page .period-box:not(.sheet-full) .week-board { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.period-page .period-box:not(.sheet-full) .wb-scroll { flex: 1; max-height: none; }

/* Import review: a person's shifts under their row */
.roster-box { padding: 6px 8px 10px 34px; }
.roster-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content max-content max-content; gap: 4px 16px; align-items: baseline; font-size: 0.9rem; }
.roster-day { font-weight: 600; white-space: nowrap; }
.roster-site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.roster-time, .roster-hrs { font-variant-numeric: tabular-nums; white-space: nowrap; }
.roster-hrs { font-weight: 600; text-align: right; }
.roster-clock { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.roster-total { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); }

/* Chain ON: the person's block is linked and colour coded. The master box drives every shift below it. */
.chain-btn { transition: background 0.15s, color 0.15s, border-color 0.15s; }
.hours-grid.chained .chain-btn { background: var(--chain); border-color: var(--chain); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--chain) 25%, transparent); }
.hours-grid.chained tr.master-row > td { background: var(--chain-bg); border-top: 2px solid var(--chain); }
.hours-grid.chained tr.master-row > td:first-child { box-shadow: inset 5px 0 0 var(--chain); }
.hours-grid.chained tr.master-row .chain-row { padding: 2px 6px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--chain); }
.hours-grid.chained tr:not(.master-row) > td:first-child { box-shadow: inset 5px 0 0 var(--chain); }
.hours-grid.chained tr:not(.master-row) > td.adj-td { background: var(--chain-bg); position: relative; }
/* the line that runs down the Adjustment column from the master box, with a dot at every shift */
.hours-grid.chained tr:not(.master-row) > td.adj-td::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--chain); }
.hours-grid.chained tr:not(.master-row) > td.adj-td::after { content: ""; position: absolute; left: -4px; top: 50%; width: 11px; height: 11px; margin-top: -5px; border-radius: 50%; background: var(--surface); border: 3px solid var(--chain); box-sizing: border-box; }
.hours-grid.chained tbody tr:last-child > td { border-bottom: 2px solid var(--chain); }
.hours-grid.chained tr:not(.master-row) > td.adj-td .xl-stack { padding-left: 8px; }

/* New total after DSS: the full amount crossed out, what the company pays under it in green */
.hours-grid .new-total .new-was { display: block; color: var(--ink-3); font-weight: 500; text-decoration-thickness: 2px; }
.hours-grid .new-total .new-now { display: block; color: var(--good); }

/* Bonus: dollars paid on top of the pay, no hours behind it. A button under the New total; tap to type. */
.bonus-ctl { margin-top: 4px; display: flex; justify-content: flex-end; }
.bonus-btn { all: unset; box-sizing: border-box; cursor: pointer; font-size: 0.78rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; border: 1.5px dashed var(--line-strong, var(--line)); color: var(--ink-2); white-space: nowrap; }
.bonus-btn:hover, .bonus-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.bonus-btn.has { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.bonus-btn.ro { cursor: default; }
.bonus-edit { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1.5px solid var(--accent); border-radius: 999px; background: var(--surface); box-shadow: var(--focus); }
.bonus-lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700; }
.bonus-dollar { font-weight: 700; color: var(--ink-2); }
.bonus-input { width: 76px; border: 0; background: transparent; font: inherit; font-weight: 700; text-align: left; font-variant-numeric: tabular-nums; padding: 2px 0; color: var(--ink); }
.bonus-input:focus { outline: none; box-shadow: none; }
.bonus-input.saving { opacity: 0.5; }
.bonus-input[aria-invalid="true"] { color: var(--bad); }

.bonus-edit { flex-direction: column; align-items: stretch; gap: 4px; border-radius: 12px; }
.bonus-row { display: inline-flex; align-items: center; gap: 6px; }
.bonus-note-input { width: 190px; border: 0; border-top: 1px solid var(--line); background: transparent; font: inherit; font-size: 0.8rem; padding: 4px 0 2px; color: var(--ink); }
.bonus-note-input:focus { outline: none; box-shadow: none; }
.bonus-note { max-width: 190px; margin-left: auto; font-size: 0.74rem; color: var(--ink-3); font-style: italic; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bonus-ctl { flex-direction: column; align-items: flex-end; }

/* Active staff who are not in the pay period */
.missing-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; margin: 6px 0; border: 1px dashed var(--line-strong, var(--line)); border-radius: 8px; color: var(--ink-2); font-size: 0.9rem; }
.missing-card { margin: 8px 0; }
.missing-list { display: flex; flex-direction: column; max-height: 22vh; overflow: auto; border-top: 1px solid var(--line); }
.missing-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); }

/* Filters: one button, a menu by category, and the filters that are on shown beside it */
.filter-wrap { position: relative; display: inline-block; }
.filter-btn.on { border-color: var(--accent); color: var(--accent); }
.filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 0.72rem; font-weight: 700; }
.filter-menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(440px, 92vw); padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line-strong, var(--line)); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
.fm-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.fm-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fm-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.filter-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.filter-tag-x { all: unset; cursor: pointer; width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 0.7rem; }
.filter-tag-x:hover, .filter-tag-x:focus-visible { background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* the notice about staff missing from the period is a small bar, not a stretching sheet area */
.sheet-box > .missing-host, .period-box > .missing-host, .lock-box > .missing-host { flex: none !important; min-height: 0 !important; overflow: visible !important; }
.missing-host:empty { display: none; }

/* Create timesheet: the pay rate of each person */
.ts-rates { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ts-rate-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1.2fr); gap: 10px; align-items: center; }
.ts-rate-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-dollar { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.ts-rate-in { width: 100%; max-width: 100px; font-variant-numeric: tabular-nums; text-align: right; }
.ts-rate-hint { font-size: 0.8rem; }
.ts-rate-hint.warn { color: var(--warn, #b45309); font-weight: 600; }

/* A search found someone who is active but not in this pay period */
.missing-found { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; padding: 10px 14px; border: 2px solid var(--warn, #b45309); border-radius: 10px; background: color-mix(in srgb, var(--warn, #b45309) 10%, var(--surface)); }
.missing-found > strong { color: var(--warn, #b45309); }

/* New staff: a person who did not exist before the import that brought them into this pay period */
.chip.new-chip { background: #fff3c4; color: #7a5b00; border: 1px solid #e6c34a; font-weight: 700; }
:root[data-theme="dark"] .chip.new-chip { background: #4a3d10; color: #ffd966; border-color: #8a7220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.new-chip { background: #4a3d10; color: #ffd966; border-color: #8a7220; } }
table.data tr.row-new > td { background: color-mix(in srgb, #ffd54a 16%, var(--surface)); }
table.data tr.row-new > td:first-child { box-shadow: inset 4px 0 0 #e6a700; }

/* Add shift: the form row under "All shifts" */
.add-shift-btn { margin-left: 10px; }
.add-shift-row > td { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.add-shift-row input[type="date"], .add-shift-row input[type="text"] { max-width: 100%; }
.add-shift-row td:nth-child(2) input { width: 100%; }
.add-day { display: block; font-size: 0.8rem; margin-top: 2px; }
.add-pair { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.add-pair input { width: 104px; }
.add-lbl { width: 86px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 700; }
.add-adj { width: 86px; text-align: right; font-variant-numeric: tabular-nums; }
.add-total, .add-newtotal { text-align: right; }
.cell-sub.warn { color: var(--warn, #b45309); font-weight: 600; }
.add-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }

/* A-Z strip down the right edge: jump to a name */
.letter-rail { position: fixed; z-index: 30; left: 2px; top: 0; display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,0.08); backdrop-filter: blur(4px); }
.letter-rail[hidden] { display: none; }
.lr-btn { all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto; width: 22px; height: var(--lr-h, 18px); display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; color: var(--ink-2); border-radius: 6px; }
.lr-btn:hover, .lr-btn:focus-visible { background: var(--accent); color: var(--accent-ink); }
.lr-btn.off { opacity: 0.28; cursor: default; pointer-events: none; }
table.data tbody tr { scroll-margin-top: 56px; }
tr.lr-hit > td { background: color-mix(in srgb, var(--accent) 18%, var(--surface)) !important; transition: background 0.4s; }
@media (max-width: 700px) { .lr-btn { width: 18px; } }
.has-rail { padding-left: 28px; }

/* Total hours: Adjust (add or take away) or Set (pay exactly this many, ignoring the shifts) */
.mode-seg { display: inline-flex; border: 1px solid var(--line-strong, var(--line)); border-radius: 999px; overflow: hidden; background: var(--surface); }
.mode-opt { all: unset; cursor: pointer; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; white-space: nowrap; color: var(--ink-2); }
.mode-opt:hover { background: var(--surface-3); }
.mode-opt.on { background: var(--warn, #b45309); color: #fff; }
.tot-adj.set-mode { border-style: solid; }

/* Make DSS: which site do the DSS hours come from */
.dss-site-field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dss-site-list { display: flex; flex-direction: column; gap: 4px; max-height: 32vh; overflow: auto; }
.dss-site-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.dss-site-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.dss-site-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Row colour: a small square beside the select box tints the row at low opacity */
.pick-cell { display: flex; align-items: center; gap: 6px; }
.rc-btn { width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 1.5px solid var(--ink-3, #888); cursor: pointer; flex: none; }
.rc-btn:not(.has) { background: transparent; }
tr[style*="--row-tint"] > td { background-image: linear-gradient(color-mix(in srgb, var(--row-tint) 16%, transparent), color-mix(in srgb, var(--row-tint) 16%, transparent)); }
.rc-pop { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); width: 168px; }
.rc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rc-sw { height: 30px; width: 30px; justify-self: center; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.rc-sw.on { border-color: var(--ink); }
.rc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 6px; }
.rc-pick { display: flex; align-items: center; gap: 6px; font-size: .8rem; cursor: pointer; }
.rc-custom { width: 26px; height: 22px; padding: 0; border: 0; background: none; }

/* an edited / new row keeps its own tint; the chosen colour then shows as a border around the row */
tr.row-edited[style*="--row-tint"] > td, tr.row-new[style*="--row-tint"] > td { background-image: none; box-shadow: inset 0 2px 0 var(--row-tint), inset 0 -2px 0 var(--row-tint); }
tr.row-edited[style*="--row-tint"] > td:first-child, tr.row-new[style*="--row-tint"] > td:first-child { box-shadow: inset 0 2px 0 var(--row-tint), inset 0 -2px 0 var(--row-tint), inset 2px 0 0 var(--row-tint); }
tr.row-edited[style*="--row-tint"] > td:last-child, tr.row-new[style*="--row-tint"] > td:last-child { box-shadow: inset 0 2px 0 var(--row-tint), inset 0 -2px 0 var(--row-tint), inset -2px 0 0 var(--row-tint); }

/* A subbie's person on the parent company's sheet: striped in the sub-company's colour, read-only */
table.data tbody tr.is-subbie { background-color: var(--surface); background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--sb) 24%, transparent) 0 8px, transparent 8px 16px); }
table.data tbody tr.is-subbie > td { background: transparent; }
table.data tbody tr.is-subbie > td:first-child { box-shadow: inset 3px 0 0 var(--sb); }
.sub-name { cursor: default; }
.sub-name:hover { color: var(--ink); text-decoration: none; }
.sub-chip { background: color-mix(in srgb, var(--sb) 18%, var(--surface)); color: var(--ink); border: 1px solid var(--sb); font-weight: 700; }

/* Total Pay is $0.00 but the sheet has an amount: no rate was set. Red cell, and a button that opens the shifts to set one */
.pay-issue-btn { display: block; margin-top: 3px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--bad); background: var(--surface); color: var(--bad); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.pay-issue-btn:hover { background: var(--bad-bg); }
table.data tbody tr > td:has(.pay-issue-btn) { background: var(--bad-bg); }
table.data tbody tr > td:has(.pay-issue-btn) .paid-cell > strong { color: var(--bad); }
.otp-input { font-size: 1.4rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.otp-qr { display: flex; justify-content: center; }
.otp-qr svg { border: 1px solid var(--line, #ddd); border-radius: 8px; max-width: 100%; height: auto; }
.otp-manual { font-size: 0.85rem; margin: 0; }
.otp-secret { display: block; margin-top: 4px; font-size: 0.95rem; letter-spacing: 0.05em; word-break: break-all; user-select: all; }

/* the platform admin looking at a company that shared its page: clearly read-only, on every page */
.view-only-bar { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 8px var(--gutter); background: #fff4d6; color: #5c4400; border-top: 1px solid #f0d58a; border-bottom: 1px solid #f0d58a; font-size: 0.9rem; }
.view-only-bar strong { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; background: #5c4400; color: #fff4d6; padding: 2px 8px; border-radius: 999px; }
:root[data-theme="dark"] .view-only-bar { background: #3a2f0a; color: #f5df9a; border-color: #6b5513; }
:root[data-theme="dark"] .view-only-bar strong { background: #f5df9a; color: #3a2f0a; }
