.shift-today [data-today-list]:has(.today-team) { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(260px,100%),1fr)); column-gap: 24px; margin-top: 12px; }
.today-team { padding: 12px 0; border-bottom: 1px solid var(--line); }
.today-team h3 { margin: 0; font-size: .94rem; }
.today-team h3 small, .today-list li small { font-weight: 500; color: var(--muted); }
.today-team .today-list { margin-top: 6px; }
.att-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.att-bar:empty { display: none; }
.att-bar-side { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.att-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 10px; background: var(--canvas); color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.att-badge.is-due { background: var(--accent); color: var(--on-accent); }
.att-month-start { box-shadow:inset 2px 0 var(--accent); }
.att-unassigned { color:var(--muted); background:var(--canvas); }
.att-panel { overflow: hidden; }
.att-scroll { overflow-anchor:none; overflow: auto; max-height: 66vh; border-top: 1px solid var(--line); }
.att-scroll .att-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-variant-numeric: tabular-nums; }
.att-grid :is(th,td) { padding: 2px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); }
.att-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 6px 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.att-grid th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--surface); border-right: 1px solid var(--line); padding: 4px 16px; min-width: var(--name, 132px); width: var(--name, auto); max-width: var(--name, none); font-weight: 600; }
.att-grid thead th:first-child { z-index: 3; font-size: 12px; color: var(--muted); }
.att-grid th[data-pan-day] { width: var(--day, 80px); min-width: var(--day, 80px); max-width: var(--day, 80px); cursor:grab; user-select:none; -webkit-user-select:none; }
.att-grid th[data-pan-day].att-sat { color: var(--saturday, #2563eb); }
.att-grid th[data-pan-day].att-sun { color: var(--danger); }
.att-grid .att-panning th { cursor:grabbing; }
.att-grid thead th small { display: block; font-size:12px; font-weight: 400; color: inherit; }
.att-grid tbody th small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--muted); }
.att-grid th button { border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; padding: 4px 0; cursor: pointer; }
.att-grid th button:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.att-grid .att-today { background: var(--accent-wash); }
.att-grid thead th[data-pan-day].att-today { color: var(--on-accent); }
.att-grid thead .att-today { background: var(--surface); }
.att-grid thead .att-today::before { content: ""; position: absolute; inset: 4px 3px; z-index: -1; border-radius: 8px; background: var(--accent); }
.att-grid thead th.att-today { isolation: isolate; }
.att-code { width: 100%; min-width: 28px; max-width: 112px; overflow: hidden; text-overflow: ellipsis; height: 24px; padding: 0; border: 0; border-radius: 6px; font: inherit; font-size: 12px; cursor: pointer; background: transparent; }
/* Shared attendance colours for monthly, weekly and today's schedules. */
:root {
  /* Work is the ordinary day, so it stays quiet; days off and leave are the exceptions people look for. */
  --att-work-bg:#f5f5f4; --att-work-fg:#525252;
  --att-off-bg:#f6e7dc; --att-off-fg:#7a4328;
  --att-leave-bg:#efe9f7; --att-leave-fg:#5b3f86;
}
:root[data-theme="dark"] {
  --att-work-bg:#29292e; --att-work-fg:#dfdfe4;
  --att-off-bg:#3d2920; --att-off-fg:#f0bb9f;
  --att-leave-bg:#30243e; --att-leave-fg:#dbc6f2;
}
.att-code.work,.att-swatch.work,.shift-mark.work { background:var(--att-work-bg); color:var(--att-work-fg); }
.att-code.off,.att-swatch.off,.shift-mark.off { background:var(--att-off-bg); color:var(--att-off-fg); }
.att-code.leave,.att-swatch.leave,.shift-mark.leave { background:var(--att-leave-bg); color:var(--att-leave-fg); }
.att-code:not(.blank),.att-swatch,.shift-mark:not(.blank) { font-weight:500; }
.att-code.off,.att-code.leave,.att-swatch.off,.att-swatch.leave { font-weight:600; }
.att-code:not(.blank) { padding:0 2px; }
.att-key { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:12px 16px; min-height:60px; }
.att-swatch { padding:3px 8px; border-radius:6px; font-size:12px; }
.att-count { margin-left: 8px; color: var(--muted); font-size: 13px; }
.att-count b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.att-key .att-range { margin-left: auto; }
.att-key select { width: auto; min-width: 132px; min-height: 32px; margin: 0; padding: 4px 28px 4px 10px; font-size: 13px; }
.att-key .att-range { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.att-key .att-range [data-visible-dates] { min-width: 148px; text-align: center; }
.att-move-status { color:var(--muted); font-size:13px; }
.att-key [data-touch-move] { display:none; }
.att-move-status:not(:empty) { padding:2px 16px 10px; }
.att-code[data-movable] { cursor:grab; user-select:none; -webkit-user-select:none; }
.att-code.att-lift { opacity:.5; cursor:grabbing; }
.att-code.att-drop { outline:2px solid var(--accent-strong); outline-offset:1px; }
.att-ghost { position:fixed; z-index:15; pointer-events:none; border-radius:5px;
  background:var(--ink); color:var(--canvas); padding:4px 9px; font-size:.8rem; font-weight:600; }
@media (any-pointer:coarse) {
  .att-key [data-touch-move] { display:inline-flex; }
  .att-key [aria-pressed=true] { background:var(--accent-wash); border-color:var(--accent-strong); }
  .touch-move [data-movable] { touch-action:none; }
}
.att-code.blank, .att-legend { color: var(--muted); }
.att-code:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--accent); }
.att-legend { padding: 8px 16px; font-size: 12px; border-top: 1px solid var(--line); }
.att-empty { display: grid; justify-items: center; gap: 4px; padding: 80px 20px; }
.att-empty strong { font-size: 15px; }
.att-empty .button { margin-top: 16px; }
/* Requests, history and the weekly view open from the right edge. */
.side-panel { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.side-panel::backdrop { background: rgb(18 23 30 / .24); }
.side-panel[open] { display: flex; flex-direction: column; animation: side-in .3s cubic-bezier(.22,1,.36,1); }
@keyframes side-in { from { transform: translateX(24px); opacity: 0; } }
.side-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.side-panel h2 { margin: 0; font-size: 16px; font-weight: 600; }
.side-panel-body { flex: 1; overflow: auto; padding: 16px 20px 24px; display: grid; align-content: start; gap: 16px; }
.side-panel-body .table-wrap { margin: 0 -20px; }
.side-panel-body .empty { padding: 48px 0; }
.att-dialog { width: min(460px, 94vw); max-height: 87vh; padding: 24px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: auto; box-shadow: var(--float); }
.att-dialog::backdrop { background: rgb(18 23 30 / .36); }
.att-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.att-dialog h2 { margin: 0; font-size: 1.15rem; }
.att-dialog form { display: grid; gap: 13px; }
.att-dialog fieldset { padding: 0; margin: 0; min-width: 0; border: 0; }
.att-dialog legend { margin-bottom: 8px; }
.att-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.att-days label { position: relative; cursor: pointer; }
.att-days input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; }
.att-days span { display: grid; place-items: center; padding: 5px 1px; border-radius: 6px; font-size: .9rem; }
.att-days input:disabled + span { color: var(--muted); cursor: not-allowed; }
.att-days small { font-size:12px; color: var(--muted); }
.att-days [data-day-state] span { background: var(--line-soft); }
.att-days [data-day-state] small { color: var(--ink); }
.att-days input:checked + span { background: var(--accent); color: var(--on-accent); }
.att-days input:checked + span small { color: inherit; }
.att-days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.attendance-request-dialog { margin-top: max(12px, 5dvh); }
@media (max-width: 820px) and (pointer: coarse) {
  .att-dialog.attendance-request-dialog {
    width: min(460px, calc(100% - 12px));
    max-width: none;
    max-height: calc(100dvh - max(12px, 5dvh) - 12px);
    padding: 16px 10px;
    scroll-padding-block: 12px;
  }
  .att-days span { min-height: 44px; align-content: center; }
  .att-key select { min-height: var(--control); font-size: 16px; }
}
.att-requests { margin-top: 16px; }

.wf-teams {display:flex;flex-wrap:wrap;gap:8px;padding:0 20px 18px;}
.wf-times {display:grid;grid-template-columns:1fr 1fr;gap:12px;}

.att-grid tr.roster-band th,.week-table tr.roster-band th,.week-agenda li.roster-band { background:var(--raised);color:var(--ink-2);text-align:left;padding:6px 16px;font-size:12px;font-weight:600; }
.att-grid tr.roster-band.is-site th,.week-table tr.roster-band.is-site th,.week-agenda li.roster-band.is-site {background:var(--canvas);color:var(--muted);padding-left:28px;font-size:12px;font-weight:500;}
.today-team h4,.hr-team h4 {font-size:.78rem;margin:.7rem 0 .25rem;color:var(--muted);}

.wf-assignments {margin:0 20px 16px;padding:12px 16px;background:var(--canvas);border-radius:8px;}
.wf-assignments h3,.wf-assignments p {margin:4px 0;font-size:.85rem;}

.att-week-rules { display:grid; grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); gap:8px; }
.att-preview-days { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); padding:0; list-style:none; gap:4px 10px; font-variant-numeric:tabular-nums; }
.att-grant { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:16px; }
.att-grant label { display:grid; gap:4px; flex:1 1 160px; }
.att-grant [data-feedback] { flex-basis:100%; }
.att-grant-managers { margin:12px 16px 0; color:var(--muted); }

.wf-dialog fieldset {display:grid;gap:8px;border-top:1px solid var(--line);padding-top:8px;}
.wf-dialog legend {padding-right:8px;font-weight:600;}
.wf-dialog .wf-times {grid-template-columns:repeat(2,minmax(0,1fr));}
.wf-dialog .wf-times input,.wf-dialog .wf-times select {min-width:0;width:100%;}
@media (max-width:420px){.wf-dialog .wf-times {grid-template-columns:1fr;}}

.att-range {display:flex;align-items:center;gap:10px;justify-content:center;padding:0 12px 8px;font-variant-numeric:tabular-nums;}
.att-range [data-visible-dates] {min-width:13em;text-align:center;font-weight:600;}
.att-scroll .att-grid {user-select:none;}
.att-scroll.att-panning,.att-scroll.att-panning * {cursor:grabbing;}
.att-grid tr.roster-band th {box-shadow:1px 0 var(--line);z-index:1;}
.att-grid tr.roster-band td {background:var(--raised);}
.att-grid tr.roster-band.is-site td {background:var(--canvas);}
.att-grid tr.roster-band small {display:inline;margin-left:4px;color:var(--muted);font-weight:400;}
.att-grid tr[hidden] {display:none;}

.wf-modes { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:10px; background:var(--canvas); }
.wf-modes button { border:0; border-radius:6px; padding:6px 13px; color:var(--muted); background:transparent; }
.wf-modes button[aria-pressed=true] { background:var(--surface); color:var(--accent-strong); font-weight:600; box-shadow:0 1px 3px #271c151e; }
.wf-chart { padding:6px clamp(12px,3vw,32px) 24px; }
.wf-lead { position:relative; display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.wf-lead:has(+div) { padding-bottom:25px; }
.wf-lead:has(+div)::after { content:""; position:absolute; left:50%; bottom:0; height:25px; border-left:1px solid var(--line); }
.wf-branches { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; gap:14px; border-top:1px solid var(--line); padding-top:16px; }
.wf-branch { min-width:0; overflow:hidden; padding:14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.wf-branch h3 { font-size:.98rem; margin:0 0 12px; }
.wf-members { display:grid; gap:4px; }
.wf-member { display:grid; grid-template-columns:auto 1fr; gap:2px 8px; align-items:baseline; width:100%; text-align:left; padding:8px 10px; border:1px solid transparent; border-radius:8px; background:var(--canvas); color:var(--ink); }
.wf-member:hover { border-color:var(--accent); }
.wf-member span,.wf-member small { color:var(--muted); font-size:.77rem; }
.wf-member small { grid-column:1 / -1; }
.wf-lead .wf-member { width:min(100%,250px); padding:14px 18px; border-color:var(--accent); background:var(--surface); }
.wf-lead strong { font-size:1.18rem; }
.wf-lead span { font-weight:600; color:var(--accent-strong); }
.wf-site + .wf-site { margin-top:12px; }
.wf-site h4 { font-size:.8rem; margin:0 0 5px; color:var(--muted); }

.wf-branches[data-tier="1"] { grid-template-columns:minmax(0,1fr); border-top:0; padding-top:0; }
.wf-branches[data-tier="1"] .wf-members { grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr)); gap:8px; }
.wf-branches[data-tier="1"]:has(+.wf-branches) { position:relative; padding-bottom:22px; }
.wf-branches[data-tier="1"]:has(+.wf-branches)::after { content:""; position:absolute; bottom:0; left:50%; height:22px; border-left:1px solid var(--line); }
.wf-branches>.wf-sites-branch:only-child { grid-column:1 / -1; }
.wf-branches>.wf-sites-branch {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr));gap:8px}
.wf-sites-branch h3 {grid-column:1/-1}
.wf-sites-branch .wf-site {margin:0;padding:8px;border-left:2px solid var(--line)}
.wf-executives { display:flex; justify-content:center; }
.wf-executives>.wf-branch { width:min(100%,520px); }
.wf-executives .wf-members,.wf-housekeeping .wf-branch { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); gap:8px; }
.wf-executives:has(+div),.wf-branches:has(+.wf-housekeeping) { position:relative; padding-bottom:22px; }
.wf-executives:has(+div)::after,.wf-branches:has(+.wf-housekeeping)::after { content:""; position:absolute; bottom:0; left:50%; height:22px; border-left:1px solid var(--line); }
.wf-housekeeping .wf-branch { align-items:start; }
.wf-housekeeping .wf-branch h3 { grid-column:1/-1; margin-bottom:4px; }
.wf-housekeeping .wf-site { padding:8px; border-left:2px solid var(--line); }
.wf-housekeeping .wf-site + .wf-site { margin-top:0; }
@media (max-width:1100px){.wf-branches {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:600px){.wf-branches {grid-template-columns:1fr;}}

.wf-grade-guide { margin:12px 0; border:1px solid var(--line); border-radius:8px; background:var(--surface); }
.wf-grade-guide summary { padding:12px 16px; cursor:pointer; font-weight:600; }
.wf-grade-guide ol { margin:0; padding:0 16px 6px; list-style:none; }
.wf-grade-guide li { display:grid; grid-template-columns:3em minmax(0,1fr); gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.wf-grade-guide h3,.wf-grade-guide p { margin:0; font-size:inherit; }
.wf-grade-guide small { display:block; margin:4px 0 8px; color:var(--muted); }

.wf-promotions details { margin-bottom:10px; border-bottom:1px solid var(--line); padding-bottom:8px; }
.wf-promotions summary { cursor:pointer; font-weight:600; padding:6px 0; }
.wf-promotions ol { padding-left:1.4em; } .wf-promotions li small { display:block; } .wf-promotions p { overflow-wrap:anywhere; }
/* The roster is denser than an ordinary table: 32px people rows, 24px codes and 28px department bands. */
.att-grid tbody :is(td, th) { height: 32px; padding-block: 0; }
.att-grid tr.roster-band :is(th, td) { height: 28px; }
/* Phones: one swipeable row of actions, and only date paging and the department above the roster. */
@media (max-width: 820px) {
  .att-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .att-bar::-webkit-scrollbar { display: none; }
  .att-bar > *, .att-bar-side > * { flex: none; }
  .att-bar-side { flex-wrap: nowrap; margin-left: 0; }
  .att-key { gap: 8px; padding: 10px 12px; min-height: 0; }
  .att-key .att-swatch, .att-key .att-count { display: none; }
  .att-key .att-range { margin-left: 0; padding: 0; }
  .att-key .att-range .button { min-width: var(--control); }
  .att-key { flex-wrap: nowrap; }
  .att-key .att-range [data-visible-dates] { display: none; }
  .att-key [data-touch-move] { flex: none; }
  .att-grid tbody tr:not(.roster-band) :is(td, th) { height: 44px; }
  .att-key select { min-width: 0; flex: 1; }
  .att-grid th:first-child { width: 88px; min-width: 88px; max-width: 88px; padding-inline: 12px; }
  .att-grid tbody tr:not(.roster-band) > th:first-child { white-space: normal; overflow-wrap: anywhere; }
  .att-legend { padding-inline: 12px; }
}
@media (max-width: 820px) { button.att-code { min-height: 44px; min-width: 44px; } }
/* Rows don't light up on the roster: the work codes share the hover tone and would vanish. */
.att-grid tbody tr:hover { background: transparent; }
/* When the whole month is on screen, paging days inside the panel has nothing to do. */
[data-month-fits] .att-range { display: none; }

/* Org chart: the head sits centred and narrow, departments share one row, and a member is one 40px line. */
.wf-branches { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; border-top: 0; padding-top: 0; }
.wf-branches[data-tier="1"] { justify-items: center; }
.wf-branches[data-tier="1"] > .wf-branch { width: min(100%, 320px); }
.wf-branches[data-tier="1"] .wf-members { grid-template-columns: 1fr; }
.wf-branches:has(+ .wf-branches), .wf-executives:has(+ div), .wf-branches:has(+ .wf-housekeeping), .wf-lead:has(+ div) { padding-bottom: 16px; }
.wf-branches:has(+ .wf-branches)::after, .wf-executives:has(+ div)::after, .wf-branches:has(+ .wf-housekeeping)::after, .wf-lead:has(+ div)::after { content: none; }
.wf-branch { padding: 12px; border-radius: 12px; }
.wf-branch h3 { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 600; }
.wf-member { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 40px; padding: 0 10px; gap: 6px; }
.wf-member strong { font-weight: 500; font-size: 13px; }
.wf-member small { grid-column: auto; justify-self: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wf-member span, .wf-member small { font-size: 12px; }
.wf-grade-guide { border-radius: var(--radius); background: var(--surface); }
.wf-grade-guide summary { min-height: 56px; display: flex; align-items: center; padding: 0 20px; font-size: 14px; }
@media (max-width: 1100px) { .wf-branches { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
@media (max-width: 600px) { .wf-branches { grid-template-columns: 1fr; } }
/* Departments are labels you can open, not actions: quiet 28px chips. */
.wf-teams { padding: 16px 20px 20px; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; background: var(--raised); color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease); }
.chip:hover:not(:disabled) { border-color: var(--control-line-hover); color: var(--ink); }
.chip:disabled { cursor: default; opacity: 1; }
.att-requests .panel-head .att-bar { align-items: center; }
.att-requests .panel-head .att-bar select { min-height: 32px; width: auto; margin: 0; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink-2); white-space: nowrap; }
