/* Discovery HR. Brand: Discovery Grey #212121, Discovery Yellow #F4C056, White, Light Grey #F1F1F1. */
:root {
  --grey: #212121;
  --grey-2: #3a3a3a;
  --grey-3: #6b6b6b;
  --grey-4: #c9c9c9;
  --line: #e2e2e2;
  --light: #f1f1f1;
  --white: #ffffff;
  --yellow: #f4c056;
  --yellow-soft: #fdf2d8;
  --green: #2e7d4f;
  --green-soft: #e3f2e8;
  --red: #b3261e;
  --red-soft: #fbe4e2;
  --amber: #b26a00;
  --amber-soft: #fdebd0;
  --purple: #6b3fa0;
  --purple-soft: #eee6f7;
  --radius: 8px;
  --font: "Brandon Grotesque", Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Museo Sans", Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--grey); background: var(--light); line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8rem; }
a { color: var(--grey); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { background: var(--yellow-soft); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--yellow); padding: .5rem 1rem; z-index: 10; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--grey) 240px, var(--light) 240px); }
input[type=checkbox], input[type=radio] { accent-color: var(--grey); width: 1.05rem; height: 1.05rem; }
.grid > * { min-width: 0; }
.btn-row select, .btn-row input[type=text], .btn-row input[type=date], .btn-row input[type=time], .btn-row input[type=number] { width: auto; }
.side { background: var(--grey); color: var(--white); padding: 1.25rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 0 1.25rem 1.25rem; border-bottom: 1px solid #3a3a3a; margin-bottom: .75rem; }
.brand .word { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; }
.brand .word span { color: var(--yellow); }
.brand .tag { font-size: .78rem; color: #bdbdbd; }
.brand img { max-width: 170px; height: auto; display: block; }
.side nav a { display: flex; justify-content: space-between; align-items: center; color: #e8e8e8; text-decoration: none; padding: .55rem 1.25rem; border-left: 4px solid transparent; }
.side nav a:hover { background: #2d2d2d; color: var(--white); }
.side nav a.active { border-left-color: var(--yellow); background: #2d2d2d; color: var(--white); font-weight: 600; }
.side nav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #9e9e9e; padding: 1rem 1.25rem .3rem; }
.badge { background: var(--yellow); color: var(--grey); border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 .5rem; min-width: 1.4rem; text-align: center; }
.main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; background: var(--white); border-bottom: 1px solid var(--line); padding: .7rem 2rem; gap: 1rem; }
.top .who { font-size: .92rem; color: var(--grey-3); }
.top .actions { display: flex; gap: .75rem; align-items: center; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { color: var(--grey-3); margin: 0; }
footer.foot { color: var(--grey-3); font-size: .8rem; padding: 0 2rem 2rem; }

/* cards and grids */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stat .label { font-size: .82rem; color: var(--grey-3); }
.stat .value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .sub { font-size: .82rem; color: var(--grey-3); }
.stat.accent { border-top: 4px solid var(--yellow); }
.muted { color: var(--grey-3); }
.small { font-size: .86rem; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-3); font-weight: 600; background: var(--light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* definition lists */
dl.facts { display: grid; grid-template-columns: 200px 1fr; gap: .45rem 1rem; margin: 0; }
dl.facts dt { color: var(--grey-3); font-size: .9rem; }
dl.facts dd { margin: 0; }

/* forms */
form.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: .3rem; }
.field label, .label-text { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--grey-3); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=time], input[type=datetime-local], input[type=url], input[type=tel], input[type=file], select, textarea {
  font: inherit; color: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--grey-4); border-radius: 6px; background: var(--white);
}
input:focus, select:focus, textarea:focus { border-color: var(--grey); outline: 3px solid var(--yellow); outline-offset: 0; }
textarea { min-height: 6rem; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; }
.check { display: flex; align-items: center; gap: .4rem; font-weight: normal; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .4rem; }
.btn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; border: 2px solid var(--grey); background: var(--grey); color: var(--white); padding: .5rem 1.05rem; border-radius: 6px; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--grey-2); color: var(--white); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--grey); }
.btn.primary:hover { background: #e9b23f; color: var(--grey); }
.btn.ghost { background: transparent; color: var(--grey); }
.btn.ghost:hover { background: var(--light); }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: .25rem .65rem; font-size: .85rem; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
button.link { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }

/* messages */
.flash, .alert { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; border-left: 5px solid var(--grey); background: var(--white); }
.flash.success, .alert.success { border-left-color: var(--green); background: var(--green-soft); }
.flash.error, .alert.error { border-left-color: var(--red); background: var(--red-soft); }
.flash.warning, .alert.warning { border-left-color: var(--amber); background: var(--amber-soft); }
.alert.info { border-left-color: var(--yellow); background: var(--yellow-soft); }

/* pills */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; background: var(--light); color: var(--grey); white-space: nowrap; }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.approved { background: var(--green-soft); color: var(--green); }
.pill.declined, .pill.cancelled { background: var(--light); color: var(--grey-3); }
.pill.admin { background: var(--grey); color: var(--yellow); }
.pill.warn { background: var(--red-soft); color: var(--red); }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: middle; margin-right: .35rem; }
.c-yellow { background: var(--yellow); }
.c-grey { background: #9e9e9e; }
.c-green { background: #5fae7d; }
.c-amber { background: #e39a2d; }
.c-red { background: #d9645c; }
.c-purple { background: #9b78c7; }

/* profile */
.profile-head { display: flex; gap: 1.25rem; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--grey); color: var(--yellow); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; flex: none; }
.section-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 1.25rem; }
.section-nav a { padding: .3rem .8rem; border-radius: 999px; background: var(--white); border: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.section-nav a:hover { border-color: var(--yellow); background: var(--white); }

/* balance bar */
.bar { height: 10px; background: var(--light); border-radius: 999px; overflow: hidden; display: flex; margin: .5rem 0; }
.bar span { display: block; height: 100%; }
.bar .taken { background: var(--grey); }
.bar .booked { background: var(--yellow); }
.bar .pending { background: #f8d996; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--grey-3); }
.w0 { width: 0; }
/* widths in steps of 2.5% for the balance bar (no inline styles under the CSP) */
.bar span[data-w] { width: 0; }

/* calendar */
.cal-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table.cal { border-collapse: separate; border-spacing: 0; font-size: .8rem; min-width: 900px; }
table.cal th, table.cal td { border-bottom: 1px solid var(--line); border-right: 1px solid #f3f3f3; padding: 0; text-align: center; background: var(--white); }
table.cal th { font-size: .7rem; padding: .35rem 0; text-transform: none; letter-spacing: 0; }
table.cal th.name, table.cal td.name { text-align: left; padding: .4rem .7rem; min-width: 170px; position: sticky; left: 0; z-index: 1; background: var(--white); font-size: .86rem; }
table.cal td.day { width: 28px; height: 30px; }
table.cal .wkend { background: #f7f7f7; }
table.cal .today { box-shadow: inset 0 0 0 2px var(--yellow); }
table.cal td.off { background: #f4f4f4; }
table.cal td.holiday { background: repeating-linear-gradient(45deg, #ececec, #ececec 4px, #f7f7f7 4px, #f7f7f7 8px); }
table.cal td.leave.c-yellow { background: var(--yellow); }
table.cal td.leave.c-grey { background: #b5b5b5; }
table.cal td.leave.c-green { background: #8fcaa5; }
table.cal td.leave.c-amber { background: #f0bf74; }
table.cal td.leave.c-red { background: #e8958f; }
table.cal td.leave.c-purple { background: #c2abe0; }
table.cal td.leave.pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55), rgba(255,255,255,.55) 3px, transparent 3px, transparent 6px); }
table.cal td.leave.half { background-image: linear-gradient(135deg, transparent 50%, var(--white) 50%); }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--grey); }
.auth-card { background: var(--white); border-radius: 12px; padding: 2rem; width: 100%; max-width: 440px; border-top: 6px solid var(--yellow); }
.auth-card.wide { max-width: 560px; }
.auth-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; margin-bottom: .2rem; }
.auth-brand span { color: var(--grey-3); font-weight: 400; }
.auth-tag { color: var(--grey-3); font-size: .85rem; margin-bottom: 1.5rem; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 6px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--light); padding: .5rem .75rem; border-radius: 6px; letter-spacing: .05em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--light); padding: 1rem; border-radius: 6px; margin: 1rem 0; }
.code-input { font-size: 1.4rem !important; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace !important; }
.linkbox { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--light); padding: .75rem; border-radius: 6px; word-break: break-all; }

.empty { color: var(--grey-3); font-style: italic; }
.mt { margin-top: 1rem; }
.mb0 { margin-bottom: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--light); }
  .side { position: static; height: auto; }
  .side nav { display: flex; flex-wrap: wrap; }
  .side nav .group { display: none; }
  .side nav a { border-left: none; border-bottom: 3px solid transparent; padding: .5rem .8rem; }
  .side nav a.active { border-bottom-color: var(--yellow); }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .content { padding: 1.25rem 1rem 2rem; }
  .top { padding: .6rem 1rem; }
  dl.facts { grid-template-columns: 1fr; }
}
@media print {
  .side, .top, .btn, form.noprint { display: none !important; }
  .shell { display: block; }
  body { background: var(--white); }
}

/* ---- version 2: navigation, icons, header ------------------------------------------------ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side .brand { display: block; padding: .25rem 1.25rem 1rem; border-bottom: 1px solid #333; margin-bottom: .5rem; text-decoration: none; }
.side .brand:hover { background: transparent; }
.side .brand img { width: 180px; height: auto; }
.side .brand-sub { display: block; color: #a8a8a8; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .35rem; }
.side nav a { justify-content: flex-start; gap: .7rem; padding: .48rem 1.25rem; font-size: .93rem; }
.side nav a span:first-of-type { flex: 1; }
.side nav a .ico { color: #9e9e9e; }
.side nav a.active .ico, .side nav a:hover .ico { color: var(--yellow); }
.side nav .group { padding-top: 1.1rem; }
.top { position: sticky; top: 0; z-index: 5; }
.top-search { flex: 1; max-width: 420px; }
.top-search input { background: var(--light); border-color: transparent; padding: .45rem .8rem; }
.top-search input:focus { background: var(--white); }
.icon-link { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: none; border: none; color: var(--grey); cursor: pointer; text-decoration: none; }
.icon-link:hover { background: var(--light); }
.icon-link .ico { width: 20px; height: 20px; }
.icon-link .dot { position: absolute; top: 2px; right: 0; background: var(--yellow); color: var(--grey); font-size: .68rem; font-weight: 700; border-radius: 999px; padding: 0 .35rem; line-height: 1.35; }
.who { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; padding: .2rem .5rem .2rem .2rem; border-radius: 999px; }
.who:hover { background: var(--light); }
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }
.menu-btn { display: none; }
.page-head h1 { margin-bottom: .15rem; }
.kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-3); margin-bottom: .2rem; }
.card h2 { font-size: 1.08rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile { display: flex; gap: .85rem; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; }
.tile:hover { border-color: var(--yellow); background: var(--white); }
.tile .ico { width: 26px; height: 26px; color: var(--grey); background: var(--yellow-soft); border-radius: 8px; padding: 4px; box-sizing: content-box; }
.tile strong { display: block; font-family: var(--font-head); }
.tile span { color: var(--grey-3); font-size: .86rem; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.list-plain li:last-child { border-bottom: none; }
.progress { height: 8px; background: var(--light); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--yellow); }
.notice { border-left: 4px solid var(--yellow); padding: .2rem 0 .2rem 1rem; margin-bottom: 1rem; }
.notice h3 { margin-bottom: .2rem; }
.notice .meta { font-size: .8rem; color: var(--grey-3); }
.pre { white-space: pre-wrap; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: .8rem; overflow-x: auto; }
.kanban .col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; min-height: 120px; }
.kanban .col h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--grey-3); display: flex; justify-content: space-between; }
.kanban .cand { border: 1px solid var(--line); border-radius: 6px; padding: .6rem; margin-bottom: .6rem; background: var(--light); }
.kanban details summary { cursor: pointer; font-weight: 600; }
.org ul { list-style: none; padding-left: 1.4rem; border-left: 2px solid var(--line); margin: .2rem 0 .2rem .9rem; }
.org > ul { border-left: none; padding-left: 0; margin-left: 0; }
.org li { margin: .35rem 0; }
.org .node { display: inline-flex; gap: .6rem; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .7rem; text-decoration: none; }
.org .node:hover { border-color: var(--yellow); }
.org .node small { color: var(--grey-3); display: block; }
.clock { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.clock .big { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; }
.rota td.cellday { min-width: 120px; vertical-align: top; }
.shift { background: var(--yellow-soft); border-left: 3px solid var(--yellow); border-radius: 4px; padding: .25rem .4rem; margin-bottom: .3rem; font-size: .82rem; }
.shift.draft { background: var(--light); border-left-color: var(--grey-4); }
.signature { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.8rem; }
.cert { max-width: 760px; }
.choice-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice-row label { border: 1px solid var(--grey-4); border-radius: 6px; padding: .35rem .7rem; cursor: pointer; }
.choice-row input { margin-right: .3rem; }
.bars .row-bar { display: grid; grid-template-columns: 180px 1fr 50px; gap: .6rem; align-items: center; margin-bottom: .35rem; font-size: .9rem; }
.auth-card .auth-logo { width: 210px; height: auto; margin-bottom: .2rem; }
.auth-card { border-top-color: var(--yellow); }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; font: inherit; font-weight: 600; border: 1px solid var(--grey-4); background: var(--white); border-radius: 6px; padding: .35rem .7rem; }
  .side { display: none; }
  .side.open { display: block; }
  .side nav { display: block; }
  .side nav .group { display: block; }
  .side nav a { border-bottom: none; border-left: 4px solid transparent; }
  .who-name, .top-search { display: none; }
  .kanban { grid-template-columns: repeat(6, 220px); }
}
.error-text { color: #b3261e; }
.field.w-short, input.w-short { max-width: 110px; }
fieldset.plain { border: 0; padding: 0; } fieldset.plain fieldset { margin-bottom: 1rem; } .inline-details { display: inline-block; margin-right: .5rem; } .inline-details summary { cursor: pointer; list-style: none; } .inline-details[open] form { margin-top: .4rem; min-width: 200px; }
table.compact th, table.compact td { padding: .35rem .5rem; font-size: .82rem; white-space: nowrap; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-3); margin: 1.5rem 0 .6rem; }

/* ---- 2.0.3: even form fields on every page ---------------------------------------------- */
:root { --field-h: 2.75rem; --field-h-sm: 2.25rem; }
.row { align-items: start; }
.field { align-content: start; }
.field > label, .field > .label-text { min-height: 1.35rem; line-height: 1.35rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search],
input[type=time], input[type=datetime-local], input[type=url], input[type=tel], select {
  height: var(--field-h); padding: 0 .75rem; line-height: normal;
}
input[type=file] { height: var(--field-h); padding: .45rem .6rem; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23212121' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px 8px; }
textarea { padding: .6rem .75rem; }
.field .hint { line-height: 1.35; }
/* Labels that wrap a field (label text, then the input) line up the same way. */
.field > label > input, .field > label > select { margin-top: .3rem; font-weight: 400; }
.btn { min-height: var(--field-h); justify-content: center; }
.btn.small { min-height: var(--field-h-sm); }
.btn-row input[type=text], .btn-row input[type=date], .btn-row input[type=time], .btn-row input[type=number],
.btn-row input[type=email], .btn-row select { height: var(--field-h-sm); font-size: .92rem; }
.btn-row .field input, .btn-row .field select { height: var(--field-h); font-size: 1rem; }
.btn-row:has(> .field) { align-items: flex-end; }
.top-search input { height: 2.5rem; }
fieldset .row + .row, fieldset .row + .field, fieldset .field + .row { margin-top: 1rem; }

/* ---- 2.0.3: collapsible side menu ---------------------------------------------------------- */
.collapse-btn { display: flex; align-items: center; gap: .7rem; width: 100%; background: none; border: none; color: #9e9e9e;
  font: inherit; font-size: .85rem; padding: .6rem 1.25rem; cursor: pointer; border-left: 4px solid transparent; margin-top: .75rem; }
.collapse-btn:hover { color: var(--white); background: #2d2d2d; }
.collapse-btn .ico { transition: transform .15s; }
.side .brand img.brand-mark { display: none; }
.shell { transition: grid-template-columns .15s; }
.shell.nav-collapsed { grid-template-columns: 76px 1fr; background: linear-gradient(to right, var(--grey) 76px, var(--light) 76px); }
.nav-collapsed .side .brand { padding: .25rem 0 1rem; text-align: center; }
.nav-collapsed .side .brand img.brand-full, .nav-collapsed .side .brand-sub { display: none; }
.nav-collapsed .side .brand img.brand-mark { display: inline-block !important; width: 26px; height: auto; }
.nav-collapsed .side nav a { justify-content: center; padding: .6rem 0; position: relative; }
.nav-collapsed .side nav a > span:not(.badge), .nav-collapsed .collapse-btn span { display: none; }
.nav-collapsed .side nav a .badge { position: absolute; top: .2rem; right: .55rem; font-size: .65rem; min-width: 1.1rem; padding: 0 .3rem; }
.nav-collapsed .side nav .group { font-size: 0; padding: .5rem 0 0; margin: .5rem 1rem 0; border-top: 1px solid #3a3a3a; }
.nav-collapsed .collapse-btn { justify-content: center; padding: .6rem 0; }
.nav-collapsed .collapse-btn .ico { transform: rotate(180deg); }
.nav-collapsed .content { max-width: 1400px; }
@media (max-width: 900px) {
  .collapse-btn { display: none; }
  .shell.nav-collapsed { grid-template-columns: 1fr; background: var(--light); }
  .nav-collapsed .side nav a > span:not(.badge) { display: inline; }
  .nav-collapsed .side nav a { justify-content: flex-start; padding: .48rem 1.25rem; }
  .nav-collapsed .side .brand img.brand-full, .nav-collapsed .side .brand-sub { display: block; }
  .nav-collapsed .side .brand img.brand-mark { display: none !important; }
}

/* ---- 2.0.6: charts (plain SVG) and clickable stat tiles ------------------------------------- */
.chart { width: 100%; height: auto; display: block; margin-top: .5rem; }
.chart .axis { font-size: 11px; fill: var(--grey-3); }
.chart .val { font-size: 11px; font-weight: 600; fill: var(--grey); }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart rect:hover { opacity: .85; }
.chart-legend { display: flex; gap: 1rem; justify-content: center; margin-top: .4rem; font-size: .82rem; }
.swatch.s-submitted { background: #BDBDBD; } .swatch.s-approved { background: #F4C056; } .swatch.s-paid { background: #212121; }
.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link:hover { border-color: var(--yellow); }
.filters { padding-bottom: 1rem; }

/* ---- 2.0.6: people list ---------------------------------------------------------------------- */
.filter-groups { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 1rem; }
.filter-groups legend { padding: 0; margin-bottom: .35rem; }
a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
a.sort.on, a.sort:hover { color: var(--grey); text-decoration: underline; text-decoration-color: var(--yellow); }
.people-table td { vertical-align: middle; }
.col-avatar { width: 64px; white-space: nowrap; }
.col-select { width: 36px; text-align: center; }
.wfh { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: .3rem; vertical-align: middle; }
.wfh .ico { width: 18px; height: 18px; }
.badges { white-space: nowrap; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .4rem; border-radius: 4px; margin-right: .2rem; line-height: 1.5; }
.tag-current { background: var(--grey); color: var(--white); }
.tag-pending { background: var(--yellow-soft); color: var(--grey); border: 1px solid var(--yellow); }
.tag-leaving { background: var(--yellow); color: var(--grey); }
.tag-left { background: var(--light); color: var(--grey-3); border: 1px solid var(--grey-4); }
.tag-role { background: var(--light); color: var(--grey); border: 1px solid var(--grey-4); }
.tag-type { background: var(--white); color: var(--grey); border: 1px solid var(--grey); }
.tag-none { background: var(--white); color: var(--grey-3); border: 1px dashed var(--grey-4); font-weight: 600; }
.danger-zone { border-color: #e9b3ae; } .danger-zone h2 { color: #b3261e; }

/* ---- 2.0.6: dashboard -------------------------------------------------------------------------- */
.highlights { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; }
.hl { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .8rem .5rem; background: var(--light);
  border: 1px solid transparent; border-radius: var(--radius); text-decoration: none; color: var(--grey); text-align: center; }
.hl:hover { border-color: var(--yellow); background: var(--white); }
.hl .ico { width: 22px; height: 22px; color: var(--grey-3); }
.hl strong { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.1; }
.hl span { font-size: .8rem; color: var(--grey-3); line-height: 1.25; }
.grid.two-one { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .9rem; cursor: pointer; font-weight: 600;
  font-size: .92rem; color: var(--grey-3); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs > label .ico { width: 18px; height: 18px; }
.tabs > label .count { background: var(--light); color: var(--grey); border-radius: 999px; font-size: .75rem; padding: 0 .45rem; }
.tabs > input:focus-visible + label { outline: 3px solid var(--yellow); }
.tabs > input:checked + label { color: var(--grey); border-bottom-color: var(--yellow); }
.tabs > input:checked + label .count { background: var(--yellow); }
.tab-panel { display: none; width: 100%; order: 10; padding-top: .5rem; }
#tab-data:checked ~ .panel-data, #tab-leave:checked ~ .panel-leave, #tab-exp:checked ~ .panel-exp { display: block; }
.list-plain li.sub-item { padding-left: 1rem; font-size: .92rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: .6rem; padding: .5rem 0 .5rem .7rem; border-left: 3px solid var(--line); margin-bottom: .2rem; }
.timeline .when { font-size: .82rem; font-weight: 600; color: var(--grey-3); }
.timeline .ev-birthday, .timeline .ev-work-birthday { border-left-color: var(--yellow); }
.timeline .ev-holiday, .timeline .ev-leave { border-left-color: var(--grey-4); }
.timeline .ev-starter, .timeline .ev-leaver, .timeline .ev-probation { border-left-color: var(--grey); }
.quiet { display: flex; gap: 1rem; align-items: center; padding: 1.5rem .5rem; color: var(--grey-3); }
.quiet .ico { width: 42px; height: 42px; color: var(--yellow); }
.quiet p { margin: 0; }
.mycards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.mycard { display: flex; flex-direction: column; gap: .35rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; background: var(--white); }
.mc-head { display: flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-3); }
.mc-head .ico { width: 16px; height: 16px; }
.mc-value { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.mc-sub { font-size: .8rem; color: var(--grey-3); flex: 1; }
.mycard .btn { width: 100%; margin-top: .3rem; }
.mycard form.stack { gap: .5rem; }
.mycard select { height: var(--field-h-sm); font-size: .9rem; }
.col-avatar { width: 84px; }
.col-avatar > * { vertical-align: middle; }
.chart .axis, .chart .val { font-size: 13px; }
@media (max-width: 1100px) { .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid.two-one { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.col-avatar .avatar { display: inline-grid; }
.spacer { flex: 1; }

/* ---- 2.1.0: expenses --------------------------------------------------------------------------- */
.grow { flex: 1; min-width: 220px; }
.scan-card h2 { display: flex; align-items: center; gap: .5rem; }
.scan-card h2 .ico { width: 22px; height: 22px; color: var(--yellow); }
.scan-review { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.scan-image img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); display: block; margin-bottom: .4rem; }
table.lines input, table.lines select { height: var(--field-h-sm); font-size: .9rem; }
.w-num { max-width: 110px; text-align: right; }
.items-table td { vertical-align: top; }
.row-rejected td { background: #fbefee; }
.receipt-peek summary { cursor: pointer; list-style: none; }
.receipt-peek img { max-width: 260px; height: auto; border: 1px solid var(--line); border-radius: 6px; margin: .4rem 0; display: block; }
.bulk-bar input[type=text] { width: 220px; }
tfoot td { border-top: 2px solid var(--line); }
@media (max-width: 800px) { .scan-review { grid-template-columns: 1fr; } }
a.strong { font-weight: 700; }
div.stack { display: grid; gap: 1rem; }

/* ---- 2.2.0: full-width pages and labels that line up even when they wrap ------------------- */
/* Pages use the whole window; no fixed width leaving empty space on wide screens. */
.content, .nav-collapsed .content { max-width: none; }
@media (min-width: 1700px) { .content { padding-left: 2.75rem; padding-right: 2.75rem; } }
/* Each field in a row shares the row's label, control and hint lines (CSS subgrid), so a long
   label that wraps pushes every box in that row down together rather than out of line. */
.row > .field:has(> label + :is(input, select, textarea)):not(:has(> :nth-child(4))) {
  grid-row: span 3; grid-template-rows: subgrid; row-gap: .3rem; }
.row > .field:has(> label + :is(input, select, textarea)):not(:has(> :nth-child(4))) > label {
  min-height: 0; line-height: 1.3; align-self: end; }
.row { row-gap: 1rem; }
/* Short labels stay on one line wherever there is room. */
.field > label { overflow-wrap: anywhere; }
/* Nothing may push the page wider than the screen: wide tables scroll inside their card,
   and long option text in a filter list is cut to fit. */
.table-wrap { position: relative; max-width: 100%; }
select { max-width: 100%; text-overflow: ellipsis; }
.btn-row > select, .btn-row > input { min-width: 0; }
@media (max-width: 900px) {
  .card { overflow-x: auto; }
  .btn-row > select, .btn-row > input[type=search], .btn-row > input[type=text] { flex: 1 1 100%; }
}
.page-head > * { min-width: 0; max-width: 100%; }
.page-head .btn-row { flex-wrap: wrap; }
/* A row holding just one field keeps a sensible width instead of stretching across the page. */
.row:not(:has(> .field ~ .field)) > .field { max-width: 36rem; }

/* ---- 2.3.0: working patterns -------------------------------------------------------------- */
.pattern-table { width: auto; border-collapse: collapse; }
.pattern-table th, .pattern-table td { padding: .35rem 1.25rem .35rem 0; text-align: left; border: 0; background: none; }
.pattern-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-3); }
.pattern-table tbody th { font-weight: 600; min-width: 8rem; }
.pattern-table input { width: 6rem; }
.pattern-table select { width: 6.5rem; }
.pattern-table tfoot th, .pattern-table tfoot td { padding-top: .8rem; border-top: 1px solid var(--line); font-weight: 700; }
td:has(> .btn-row), td:has(> .btn), td:has(> form.inline) { vertical-align: middle; }
.btn-row.end { justify-content: flex-end; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.field.grow { flex: 1 1 18rem; }

/* ---- 2.3.0: a label is always above its box, with a gap, wherever it appears -------------- */
label:not(.check):not(.sr-only):has(> input:not([type=checkbox]):not([type=radio]):not([type=hidden]), > select, > textarea) {
  display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; align-content: start; }
label:not(.check):has(> input:not([type=checkbox]):not([type=radio]), > select, > textarea) > :is(input, select, textarea) {
  margin-top: 0; font-weight: 400; font-size: 1rem; width: 100%; }
/* Forms laid out in a line (filters, quick-add rows): fields sit side by side with room between
   them, boxes lined up along the bottom, and buttons level with the boxes. */
.btn-row { column-gap: 1rem; row-gap: .9rem; }
.btn-row:has(> label > :is(input, select, textarea), > .field) { align-items: flex-end; }
.btn-row > label:not(.check):has(> :is(input, select, textarea)) { min-width: 11rem; }
.btn-row > label.check { min-height: var(--field-h); display: inline-flex; align-items: center; }
.people-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem 1rem; }
.row-highlight td { background: #fff8e6; }
section.stack, .card.stack { display: grid; gap: 1rem; }
.page-head > div:first-child { flex: 1 1 30rem; }
.pattern-table tbody th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--grey); vertical-align: middle; background: none; }
.pattern-table td { vertical-align: middle; }
.page-head .btn-row > form { min-width: 0; max-width: 100%; } .page-head .btn-row > form select { width: 100%; }

/* ---- 2.4.0: HR records, equipment, flexible working, kudos ------------------------------- */
details.case { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; }
details.case > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
details.case[open] > summary { margin-bottom: .75rem; }
.case-body { padding-top: .25rem; }
.pre { white-space: pre-wrap; display: block; margin: .2rem 0 0; }
details > summary.btn { display: inline-flex; list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
tr.sub-row td { border-top: 0; padding-top: 0; color: var(--grey-3); }
.kudos-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.kudo { border: 1px solid var(--line); border-left: 5px solid var(--yellow); border-radius: 8px; padding: .9rem 1rem; background: var(--white); display: grid; gap: .35rem; }
.kudo .kudo-badge { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-3); font-weight: 700; }
.vote-btn { min-width: 4.5rem; }
select.w-auto { width: auto; min-width: 8rem; }
form.stack, .card.stack, section.stack, div.stack { align-content: start; }
code { font-size: .88em; background: var(--light); padding: .1rem .35rem; border-radius: 4px; overflow-wrap: anywhere; }
ol.steps { margin: 0; padding-left: 1.25rem; display: grid; gap: .5rem; }

/* Discovery Outreach additions */
.grid { margin-bottom: 1.25rem; }
.card .grid, .grid .grid { margin-bottom: 0; }
.grid > .card { margin-bottom: 0; }
.btn-row input.grow { flex: 1 1 12rem; min-width: 0; width: auto; }
.card.key-card .card-head h2 { font-size: 1rem; }
.stopbar { background: var(--grey); color: var(--white); padding: .7rem 1.5rem; }
.stopbar a { color: var(--yellow); }

/* ---- 2.0: the top bar fits a 390px phone (it was 37px too wide for an admin) --------------- */
.stop-short { display: none; }
@media (max-width: 600px) {
  .top { gap: .5rem; }
  .top .actions { gap: .25rem; min-width: 0; }
  .top .pill.admin { display: none; }
  .top .who { padding: .2rem; }
  .top .stop-long { display: none; }
  .top .stop-short { display: inline; }
  .top .icon-link { width: 34px; height: 34px; }
}
