/* Page-specific bits: roster grid, KPI score boxes, settings stack. */

.stack { display: flex; flex-direction: column; gap: 14px; }
.btn-group.wrap { flex-wrap: wrap; gap: 14px; }
.score-input { width: 76px; height: 32px; }

/* Roster grid: compact cells, station letters, OFF quiet, nights distinct. */
table.roster th, table.roster td { padding: 0 2px; height: 40px; }
table.roster th.pin, table.roster td.pin { padding: 0 14px; min-width: 170px; }
table.roster td.num, table.roster th.num { padding: 0 12px; }
table.roster th.rday { text-align: center; min-width: 34px; line-height: 1.1; }
table.roster th.rday span { display: block; color: var(--text); font-family: var(--font-num); font-size: 12px; }
table.roster th.rday small { font-size: 10px; color: var(--faint); }
table.roster th.rday.is-weekend small { color: var(--muted); }
table.roster th.rday.is-today span { color: var(--accent); font-weight: 700; }
[data-theme='light'] table.roster th.rday.is-today span { text-decoration: underline; }
table.roster td.rtd { text-align: center; }

.rcell { width: 30px; height: 28px; border-radius: 5px; border: 1px solid transparent; background: var(--selected); font-family: var(--font-num); font-size: 11.5px; font-weight: 500; cursor: pointer; padding: 0; color: var(--text); display: inline-grid; place-items: center; }
.rcell:hover:not(:disabled) { border-color: var(--border-strong); }
.rcell:disabled { cursor: default; }
.rcell:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus); }
.rcell.is-blank { background: transparent; border: 1px dashed var(--border-strong); }
.rcell.st-OFF { background: transparent; color: var(--faint); }
.rcell.st-N { background: var(--text); color: var(--bg); }
.rcell.st-M { background: var(--selected); }
.rcell.st-E { background: var(--border-strong); }
.rcell.is-ot { box-shadow: inset 0 -2px 0 var(--warn); }
.rkey { display: inline-block; width: 26px; font-family: var(--font-num); font-weight: 600; }
.rlegend { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 12.5px; }
.rlegend .rcell { width: 24px; height: 22px; cursor: default; }
/* A cell that is short of people in an Auto-Arrange preview, and the preview banner. */
th.rday.is-gap span { color: var(--danger); font-weight: 700; }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.preview-bar .grow { flex: 1; }
.warn-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; columns: 2; column-gap: 28px; }
@media (max-width: 640px) { .warn-list { columns: 1; } }
table.calm.compact td { height: 44px; }

/* Roster, days down: the header row and the day column stay put while the month scrolls. */
.table-scroll.roster-down { overflow: auto; max-height: calc(100vh - 230px); }
table.roster.is-down th.rperson { text-align: center; min-width: 58px; padding: 6px 4px; line-height: 1.15; }
table.roster.is-down th.rperson span { display: block; color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
table.roster.is-down th.rperson small { display: block; font-size: 10.5px; color: var(--faint); white-space: nowrap; max-width: 70px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
table.roster.is-down th.rperson.is-danger span { color: var(--danger); }
table.roster.is-down th.pin, table.roster.is-down td.pin { min-width: 76px; padding: 0 14px; }
table.roster.is-down td.rdate span { font-family: var(--font-num); font-size: 13px; color: var(--text); margin-right: 6px; }
table.roster.is-down td.rdate small { font-size: 11px; color: var(--faint); }
table.roster.is-down tr.is-weekend td.rdate small { color: var(--muted); }
table.roster.is-down tr.is-today td.rdate span { color: var(--accent); font-weight: 700; }
table.roster.is-down tr.is-gap td.rdate span { color: var(--danger); font-weight: 700; }
table.roster.is-down tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface); font-family: var(--font-num); font-size: 12px; height: 34px; box-shadow: 0 -1px 0 var(--border); }
table.roster.is-down tfoot td.pin { z-index: 3; color: var(--muted); font-family: inherit; }
table.roster.is-down tfoot tr + tr td { bottom: 0; }
table.roster.is-down tfoot tr:first-child td { bottom: 34px; }

/* Roster, by desk: names on stations, one colour per person. */
table.roster.is-desk thead tr:nth-child(2) th { top: 40px; }
table.roster.is-desk th.desk-group { text-align: center; color: var(--text); font-weight: 600; font-size: 12.5px; box-shadow: inset 1px 0 0 var(--border); }
table.roster.is-desk th.desk-st { text-align: center; font-size: 11.5px; white-space: nowrap; padding: 0 8px; box-shadow: inset 1px 0 0 var(--border); }
table.roster.is-desk td.desk-td { text-align: center; padding: 0 3px; }
table.roster.is-desk td.desk-first { box-shadow: inset 1px 0 0 var(--border); }
table.roster.is-desk td.desk-off { box-shadow: inset 1px 0 0 var(--border); padding: 4px 10px; min-width: 200px; }
.desk-off-list { display: flex; flex-wrap: wrap; gap: 4px; }
.desk-chip { min-width: 66px; height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid transparent; font-size: 12px; font-weight: 600; color: #17181a; cursor: pointer; white-space: nowrap; }
.desk-chip:disabled { cursor: default; }
.desk-chip:hover:not(:disabled) { border-color: var(--text); }
.desk-chip:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus); }
.desk-chip.is-ot { box-shadow: inset 0 -3px 0 var(--warn); }
.desk-chip.is-off { min-width: 0; height: 24px; padding: 0 8px; font-weight: 500; font-size: 11.5px; background: transparent; color: var(--muted); border-color: var(--border); }
.desk-chip.is-unset { min-width: 0; height: 24px; padding: 0 8px; font-weight: 500; font-size: 11.5px; background: transparent; color: var(--warn); border: 1px dashed var(--warn); }
.desk-chip.is-sample { display: inline-grid; place-items: center; cursor: default; vertical-align: middle; }
.desk-empty { width: 66px; height: 28px; border-radius: 6px; border: 1px dashed var(--border-strong); background: transparent; cursor: pointer; }
.desk-empty:disabled { cursor: default; }
.desk-empty.is-required { border-color: var(--danger); background: var(--danger-soft); }
.desk-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 2px 0; font-size: 12.5px; }
.desk-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
/* Ten person colours, soft enough for both themes, always with dark text. */
.pc-0 { background: #8fd3e8; } .pc-1 { background: #f2b36b; } .pc-2 { background: #a9d39a; } .pc-3 { background: #f0e27a; }
.pc-4 { background: #b9a4f0; } .pc-5 { background: #f3a6c8; } .pc-6 { background: #a7b9f2; } .pc-7 { background: #8fd9c1; }
.pc-8 { background: #e8a58f; } .pc-9 { background: #d6c3a0; }
/* Who sits where: one row per person, desk choice on the right. */
.office-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; align-items: end; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 760px) { .office-row { grid-template-columns: minmax(0, 1fr); align-items: stretch; } }
.desk-assign { display: flex; flex-direction: column; }
.desk-assign-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.desk-assign-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .desk-assign-row { grid-template-columns: minmax(0, 1fr) auto; } .desk-assign-row .faint { display: none; } }
[data-theme='dark'] .desk-chip:not(.is-off):not(.is-unset), [data-theme='dark'] .desk-dot { filter: saturate(0.85) brightness(0.92); }
