/* Dalleth Business: cleaning, opening and closing (part 3), plus the department homes */

/* today rows: the whole row takes the traffic-light colour; the tick on the right is one tap */
.tu.cl-row { padding: 0; gap: 0; cursor: default; overflow: hidden; }
.cl-open { flex: 1; min-width: 0; display: block; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 11px 12px; cursor: pointer; min-height: 62px; }
.cl-freq { font-weight: 700; }
.cl-tick { flex: none; align-self: stretch; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 72px; padding: 6px 10px;
  border: 0; border-left: 1px solid var(--rule); background: var(--field); color: var(--brand); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cl-tick .i { width: 24px; height: 24px; }
.cl-tick:active { background: var(--ok-wash); }
.cl-tick[disabled] { opacity: .5; }
.tu.res-red .cl-tick { background: #fff; color: var(--res-red); border-left-color: rgba(255,255,255,.6); }
.tu.res-amber .cl-tick { border-left-color: var(--res-amber-edge); }
.cl-done, .cl-due { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; color: var(--ok); }
.cl-done .i { width: 24px; height: 24px; } .cl-done .i + .i { width: 18px; height: 18px; }
.tu.res-red .cl-open .tu-range { color: #fff; }
.cl-sum { margin-bottom: 8px; }
.cl-starter { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 10px; } .cl-starter .i { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.cl-hidden { margin: 10px 0 0; }
.cl-group { margin-top: 14px; }

/* the task sheet */
.cl-method { font-size: 16px; line-height: 1.45; margin: 4px 0 10px; }
.cl-chem { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; } .cl-chem .i { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: 1px; }
.cl-last { margin: 4px 0 12px; }
.cl-acts { display: grid; gap: 8px; margin: 10px 0 8px; }
.cl-acts .photo-btn { justify-content: center; }
.cl-cant-btn { margin-top: 4px; }
.cl-cant-form { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
.cl-cant-form .btn.danger { background: var(--res-red); color: #fff; border-color: var(--res-red); }
.cl-cant-box { display: grid; gap: 3px; padding: 12px; margin-top: 12px; border-radius: 10px; background: var(--res-red); color: #fff; }
.cl-cant-box span { font-size: 14px; } .cl-cant-box .btn { margin-top: 8px; background: #fff; color: var(--res-red); border-color: #fff; justify-self: start; }
.cl-cant-note { margin: 10px 0 0; padding: 8px 10px; background: var(--field); border-radius: 8px; }
.cl-photo { margin: 4px 0 10px; }

/* set-up and sections */
.tu.cl-set { min-height: 56px; } .tu.cl-set .i { width: 18px; height: 18px; color: var(--brand); flex: none; }
.seg.seg5 { grid-template-columns: repeat(5, 1fr); } .seg5 button { min-height: 46px; font-size: 13px; padding: 4px 2px; }
.cl-sec { margin: 14px 0; padding-left: 8px; border-left: 3px solid var(--cat, var(--rule)); }
.cl-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
button.cl-sec-name { border: 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; } .cl-sec-name .i { width: 14px; height: 14px; }
.cl-sec-move { display: inline-flex; gap: 4px; }
.cl-ord { list-style: none; margin: 0; padding: 0; }
.cl-ord-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.cl-ord-row .grow { flex: 1 1 100%; min-width: 0; font-weight: 600; } .cl-ord-row small { display: block; color: var(--mute); font-size: 12px; font-weight: 400; }
.cl-ord-row .icon-btn { width: 40px; height: 38px; font-size: 17px; border: 1px solid var(--rule); border-radius: 8px; flex: none; }
select.input.cl-move { width: auto; flex: 1 1 auto; min-width: 0; min-height: 38px; font-size: 14px; padding: 4px 8px; }

/* opening and closing */
.seg.oc-seg, .seg.ch-view { grid-template-columns: 1fr 1fr; margin: 4px 0 10px; }
.seg.ch-view { width: 200px; }
.seg > a { display: flex; align-items: center; justify-content: center; min-height: 46px; color: var(--brand); font-weight: 600; text-decoration: none; }
.seg > a + a { border-left: 1px solid var(--brand-rule); }
.seg > a.on { background: var(--brand); color: var(--brand-ink); }
.oc-status { display: grid; gap: 3px; padding: 12px 14px; margin: 6px 0 12px; }
.oc-status b { display: flex; gap: 6px; align-items: center; font-size: 16.5px; } .oc-status b .i { width: 20px; height: 20px; }
.oc-status span { font-size: 14px; }
.oc-status.ok { background: var(--ok-wash); border-color: var(--ok); } .oc-status.ok b { color: var(--ok); }
.oc-status.gaps { background: var(--res-amber-bg); border-color: var(--res-amber-edge); } .oc-status.gaps b { color: var(--res-amber-ink); }
.oc-gap { color: var(--res-amber-ink); font-weight: 600; }
.oc-counter { display: flex; gap: 6px; align-items: center; } .oc-counter .i { width: 16px; height: 16px; }
.tu.oc-item { min-height: 58px; }
.oc-box { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--brand-rule); background: var(--field); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.oc-box .i { width: 20px; height: 20px; }
.tu.res-safe .oc-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.tu.res-red .oc-box { background: #fff; border-color: #fff; color: var(--res-red); }
.oc-sign { padding: 14px; margin-top: 14px; } .oc-sign h3 { margin: 0 0 8px; font-size: 19px; }
.oc-edit { font-size: 15.5px; line-height: 1.5; }
.oc-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.oc-line .slot-chip { text-decoration: none; font-size: 13px; padding: 3px 10px; }

/* history grid */
.ch-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; } .ch-nav .btn { min-height: 40px; padding: 4px 12px; }
.ch-wrap { overflow-x: auto; margin: 8px 0; }
.ch-grid { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.ch-grid th, .ch-grid td { border: 1px solid var(--rule); text-align: center; padding: 4px 2px; min-width: 30px; }
.ch-grid thead th { font-size: 12px; background: var(--field); position: sticky; top: 0; } .ch-grid thead th span { display: block; color: var(--mute); font-weight: 600; }
.ch-grid thead th.today { background: var(--brand); color: var(--brand-ink); } .ch-grid thead th.today span { color: var(--brand-ink); }
.ch-grid th.ch-task { text-align: left; font-weight: 600; min-width: 150px; max-width: 200px; padding: 4px 6px; position: sticky; left: 0; background: var(--card); z-index: 1; font-size: 12.5px; line-height: 1.25; }
.ch-grid th.ch-task small { display: block; color: var(--mute); font-weight: 400; font-size: 11px; }
.ch-grid.month td { min-width: 24px; font-size: 12px; }
.ch-grid tr.ch-sec th { text-align: left; background: var(--bg, #fff); padding: 8px 4px 4px; border-left: 0; border-right: 0; position: sticky; left: 0; }
.ch-grid td.c-ok { background: var(--ok-wash); color: var(--ok); font-weight: 800; }
.ch-grid td.c-red { background: var(--res-red); color: #fff; font-weight: 800; }
.ch-grid td.c-miss { background: var(--res-amber-bg); color: var(--res-amber-ink); font-weight: 800; }
.ch-grid td.c-gap { background: var(--res-amber-bg); color: var(--res-amber-ink); font-weight: 800; }
.ch-grid td.c-cov { background: repeating-linear-gradient(135deg, var(--ok-wash), var(--ok-wash) 3px, transparent 3px, transparent 6px); }
.ch-grid td.c-fut { background: var(--field); }
.ch-key { margin: 4px 0 14px; }
.ch-nd td { vertical-align: top; }

/* department homes and the general Home */
.dept-hero > .i { width: 54px; height: 54px; color: var(--brand); flex: none; }
.dsec-group .section-head h2 { display: flex; align-items: center; gap: 8px; } .dsec-group .section-head h2 .i { width: 22px; height: 22px; color: var(--brand); }
.gh-alerts { padding: 14px; margin-bottom: 16px; }
.gh-clear { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--ok); font-weight: 700; } .gh-clear .i { width: 22px; height: 22px; }
.gh-depts .gh-dept { min-height: 104px; }
.gh-dept small { display: block; font-size: 13px; margin-top: 3px; font-weight: 700; }
.gh-dept small.ok { color: var(--ok); } .gh-dept small.warn { color: var(--res-amber-ink); } .gh-dept small.bad { color: var(--res-red); }
.live-row span.bad { color: var(--res-red); font-weight: 700; }

@media print {
  .cl-tabs, .ch-nav, .ch-view, .ch-key { display: none !important; }
  .ch-wrap { overflow: visible; }
  .ch-grid { font-size: 8.5pt; } .ch-grid th, .ch-grid td { border: 1px solid #777 !important; padding: 1px 2px; min-width: 0; }
  .ch-grid th.ch-task, .ch-grid thead th, .ch-grid tr.ch-sec th { position: static; }
  .ch-grid td.c-ok, .ch-grid td.c-red, .ch-grid td.c-miss, .ch-grid td.c-gap, .ch-grid td.c-cov, .ch-grid td.c-fut { background: #fff !important; color: #000 !important; }
  .ch-grid td.c-red { font-weight: 900; text-decoration: underline; }
  @page { size: landscape; margin: 8mm; }
}

/* general Home boxes with their numbers */
.gh-dept { position: relative; }
.gh-dept small { color: var(--mute); font-weight: 600; }
.gh-badge { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; background: var(--res-red); color: #fff; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.gh-policy { border-style: dashed; }
.gh-admin { margin: 16px 0 6px; }
.dept-as { display: flex; gap: 6px; align-items: center; margin: -4px 0 12px; } .dept-as .i { width: 16px; height: 16px; }

/* activity record */
.ac-day { font-size: 17px; margin: 18px 0 6px; }
.ac-ul { list-style: none; margin: 0; padding: 0; }
.ac-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.ac-row .grow { flex: 1; min-width: 0; } .ac-row small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 1px; }
.ac-time { flex: none; width: 44px; color: var(--mute); font-variant-numeric: tabular-nums; }
.ac-row.ac-red b { color: var(--res-red); } .ac-row.ac-amber b { color: var(--res-amber-ink); } .ac-row.ac-setup b { color: var(--brand); }

/* maintenance requests */
.mj-pos { flex: none; display: inline-flex; flex-direction: column; align-items: center; min-width: 46px; padding: 4px 6px; border-radius: 8px; background: var(--field); border: 1px solid var(--rule); }
.mj-pos b { font-size: 20px; line-height: 1.05; color: var(--brand); } .mj-pos small { font-size: 11.5px; color: var(--mute); }
.tu.res-red .mj-pos { background: #fff; } .tu.res-red .mj-pos b { color: var(--res-red); }
.mj-reply { display: flex; gap: 6px; align-items: flex-start; margin-top: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-2, var(--ink)); }
.mj-reply .i { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--brand); } .mj-reply small { color: var(--mute); font-weight: 400; }
.tu.res-red .mj-reply, .tu.res-red .mj-reply small, .tu.res-red .mj-reply .i { color: #fff; }
.mj-qli { display: flex; gap: 6px; align-items: stretch; } .mj-qli .tu { flex: 1; min-width: 0; }
.mj-move { display: flex; flex-direction: column; gap: 4px; justify-content: center; } .mj-move .icon-btn { width: 40px; height: 36px; border: 1px solid var(--rule); border-radius: 8px; }
.seg.mn-seg { margin: 4px 0 12px; }
.pv-banner .pv-roles { display: block; font-size: 12.5px; color: var(--mute); margin-top: 1px; }

/* ---------- squares: one home pattern for every department ---------- */
.sq-hero { margin-bottom: 12px; } .sq-hero h1 { margin: 0; }
.sq-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.sq-grid > .sq-tile, .sq-grid > .gh-dept { flex: 0 0 calc(50% - 5px); box-sizing: border-box; min-height: 128px; }
/* odd number of squares: the first runs full width so the rest pair up; three or six side by side on wider screens */
.sq-grid.sq-odd > :first-child { flex-basis: 100%; min-height: 0; }
@media (min-width: 560px) { .sq-grid.sq-by3 > .sq-tile, .sq-grid.sq-by3 > .gh-dept { flex-basis: calc(33.333% - 7px); } .sq-grid.sq-by3.sq-odd > :first-child { flex-basis: calc(33.333% - 7px); } }
/* every tile reads the same way: icon, title, line under it from the top; the % sits at the foot */
.sq-tile, .gh-depts .gh-dept { justify-content: flex-start; }
.sq-tile > .sq-pct, .gh-dept > .sq-pct { margin-top: auto; }
.sq-tile small { -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.sq-pct { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: auto; padding-top: 8px; width: 100%; font-size: 12.5px; color: var(--mute); font-weight: 600; text-align: center; }
.sq-pct b { font-size: 15px; font-family: inherit; display: inline; color: inherit; }
.sq-pct .sq-bar { display: block; width: 72%; height: 4px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.sq-pct .sq-bar i { display: block; height: 100%; border-radius: 99px; background: currentColor; }
.sq-pct.t-green { color: var(--ok); } .sq-pct.t-amber { color: var(--res-amber-ink); } .sq-pct.t-red { color: var(--res-red); }
.sq-pct.quiet { font-weight: 500; }
.gh-dept .sq-pct { flex-direction: column; }
.sq-today { display: flex; justify-content: center; margin: 0 0 12px; } .sq-today .sq-pct { max-width: 240px; padding: 0; font-size: 13.5px; }
.sq-tile.t-red { border-color: var(--res-red-edge); } .sq-tile.t-amber { border-color: var(--res-amber-edge); }
.sq-money { margin-top: 8px; }

/* preview: always a way back to your own view */
.pv-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pv-back { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--card); color: var(--brand); font: inherit; font-weight: 700; font-size: 13.5px; padding: 6px 12px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.pv-back .i { width: 16px; height: 16px; }
.pv-banner.mine { background: var(--card); border: 1px solid var(--rule); }
.pv-back-row { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: 0 0 14px; }

/* late entries: the real time kept, the row amber */
.late-note { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; margin: 10px 0; border-radius: 10px; background: var(--res-amber-bg); border: 1px solid var(--res-amber-edge); color: var(--res-amber-ink); font-size: 13.5px; }
.late-note b { display: flex; gap: 6px; align-items: center; } .late-note .i { width: 16px; height: 16px; }
.late-note .field { margin: 6px 0 0; } .late-note .field span { color: var(--res-amber-ink); }
.slot-chip.late { background: var(--res-amber-bg); color: var(--res-amber-ink); border-color: var(--res-amber-edge); }
.chip.late[aria-pressed="true"] { background: var(--res-amber-ink); border-color: var(--res-amber-ink); color: #fff; }
.oc-status.late { background: var(--res-amber-bg); border-color: var(--res-amber-edge); }
.pad-meta small { font-weight: 500; }
.focus-flash > * { animation: flash 1.6s ease 1; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: 0 0 0 0 transparent; } }
.flag-row { align-items: center; } .flag-row .tag { flex: none; }
.bottomnav .ico { position: relative; display: inline-flex; }
.nav-dot { position: absolute; top: -4px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--res-red); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.nav-dot[hidden] { display: none; }
.wb-who { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.wb-who .i { width: 18px; height: 18px; flex: none; }
.wb-who.team { background: var(--brand-wash); color: var(--brand); } .wb-who.lead { background: var(--ok-wash); color: var(--ok); }

/* one segmented row for a page's own views (Cleaning: today, weekly and monthly, weekly grid; Labels: four kinds) */
.seg.cl-tabs { grid-template-columns: 1fr 1.35fr 1.1fr; margin: 4px 0 12px; }
.seg.lbl-seg { grid-template-columns: repeat(4, auto); margin: 4px 0 12px; }
.seg.cl-tabs > a, .seg.lbl-seg > a { font-size: 13.5px; padding: 4px 8px; text-align: center; line-height: 1.2; }
.nat-info { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.nat-info p { margin: 0 0 10px; } .nat-info p:last-child { margin: 0; } .nat-info ul { margin: 0 0 10px; padding-left: 20px; }
.seg.seg7 { grid-template-columns: repeat(7, 1fr); } .seg7 button { min-height: 42px; font-size: 13px; padding: 2px; }
.seg.seg2 { grid-template-columns: 1fr 1fr; }
.cl-when { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 18px; background: var(--brand-wash); color: var(--brand); vertical-align: 1px; }
.cl-when.evening { background: #E8E4F2; color: #4A3F78; }
/* weekly grid: a weekly job is filled on the days it isn't due; its own day is an open box */
.ch-grid td.c-off { background: var(--brand-wash); }
.ch-grid td.c-open { background: #fff; box-shadow: inset 0 0 0 2px var(--brand-rule); }
.ch-grid tr.ch-band th { text-align: left; padding: 14px 4px 2px; font-family: var(--serif); font-size: 17px; color: var(--brand); border: 0; position: sticky; left: 0; background: var(--bg, #fff); }
.ch-k { display: inline-block; width: 14px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.ch-k.c-off { background: var(--brand-wash); } .ch-k.c-open { background: #fff; box-shadow: inset 0 0 0 2px var(--brand-rule); }
@media print { .ch-grid td.c-off { background: #e9edf3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .ch-grid tr.ch-band th { position: static; } }
/* Chemicals (COSHH) */
.chem-f span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.chem-f p { margin: 2px 0 12px; font-size: 15px; line-height: 1.4; }
.chem-f.money p { color: var(--brand); font-weight: 700; }
.chem-sheet .tp-thumb, .chem-in .tp-thumb { max-width: 160px; }
.chem-in .tp-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; margin-right: 10px; }
.chem-in { align-items: center; }
.chem-send { margin: 0 0 14px; }
