*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #e6e9ef; color: #1a1a1a; min-height: 100vh; -webkit-tap-highlight-color: transparent; }

/* 15 October: "why is the blue bit so big at the top" - 50px above the bar since the first build, for an
   iPhone notch. The status bar style is 'black', so the page already starts below it: 12px, as the
   bottom, plus whatever safe area a device reports. */
.brand-bar { background: #0f172a; padding: max(12px, env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
/* 16 September: "make the screen locked so it doesn't swipe across to the sides". The top bar was
   about 60px wider than a phone - logo, place name, clock, build, undo, codes, calendar, who is
   online, sync - and one thing wider than the screen lets the whole page slide sideways. On a
   phone the place name and build number go; and the page itself can never scroll sideways, while
   the rota, the PPM year, the tables and the bottom bar still scroll inside themselves. */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
@media (max-width: 520px) {
  .brand-bar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .brand-bar .brand-div, .brand-bar .brand-place, .brand-bar .brand-build { display: none; }
}
.brand-bar .brand-name { color: white; font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.brand-bar .brand-div { width: 1px; height: 18px; background: rgba(255,255,255,0.22); }
.brand-bar .brand-sub { color: #5b6b80; font-size: 12px; }
.hdr { background: #1e293b; color: white; padding: 18px 20px 20px; }
.hdr-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hdr h1 { font-size: 22px; font-weight: 600; margin-top: 2px; }
.hdr-date { color: #5b6b80; font-size: 13px; }
.btn-switch { color: #5b6b80; font-size: 13px; background: none; border: none; cursor: pointer; padding: 4px 0; }
.stats { display: flex; gap: 8px; margin-top: 14px; }
.stat { background: rgba(255,255,255,0.1); border-radius: 10px; padding: 10px 14px; text-align: center; flex: 1; }
.stat-num { font-size: 19px; font-weight: 600; }
.stat-lbl { font-size: 11px; color: #5b6b80; margin-top: 1px; }
.prog-bar { background: rgba(255,255,255,0.15); border-radius: 4px; height: 4px; margin-top: 14px; overflow: hidden; }
.prog-fill { height: 4px; background: #34d399; border-radius: 4px; transition: width 0.4s; }
.content { padding: 12px 12px 80px; }

.room-card { background: white; border-radius: 14px; border: 1.5px solid #e5e7eb; margin-bottom: 10px; overflow: hidden; }
.room-card.s-dirty    { border-color: #fca5a5; }
.room-card.s-cleaning { border-color: #fbbf24; }
.room-card.s-clean    { border-color: #6ee7b7; }
.room-card.s-inspected{ border-color: #93c5fd; }
.room-card.s-issue    { border-color: #f9a8d4; }
.room-body { padding: 14px; }
.room-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.room-left { display: flex; align-items: center; gap: 12px; }
.room-num { width: 48px; height: 48px; background: #e8edf3; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #1e293b; flex-shrink: 0; }
.room-name { font-weight: 600; font-size: 15px; color: #1e293b; }
.room-sub { font-size: 12px; color: #475569; margin-top: 2px; }
.room-assignee { font-size: 11px; color: #5b6b80; margin-top: 2px; }
/* A counting grid answers the arrow keys by MOVING, not by stepping the number - see the
   keydown handler on .pl-cell. The spinner is hidden to match: an up-arrow drawn on the box
   is an invitation to press it, and pressing it is never what counting a delivery wants. */
input.pl-cell::-webkit-outer-spin-button,
input.pl-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.pl-cell[type=number] { -moz-appearance: textfield; }
.twin-badge { display: inline-block; background: #f3e8ff; color: #7c3aed; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 5px; margin-left: 4px; vertical-align: middle; }
.status-badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.sb-dirty     { background: #fee2e2; color: #b91c1c; }
.sb-cleaning  { background: #fef3c7; color: #92400e; }
.sb-clean     { background: #d1fae5; color: #065f46; }
.sb-inspected { background: #dbeafe; color: #1e40af; }
.sb-issue     { background: #fce7f3; color: #9d174d; }

.room-notes { margin-top: 10px; background: #f1f4f8; border-radius: 8px; padding: 8px 12px; font-size: 12px; color: #334155; }
.room-actions { display: flex; gap: 8px; margin-top: 12px; }
.time-row { display: flex; gap: 8px; margin-top: 10px; }
.time-chip { background: #e8edf3; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #334155; }
.time-chip span { font-weight: 600; color: #1e293b; }

/* Linen form */
.linen-form { margin-top: 14px; border-top: 1px solid #e8edf3; padding-top: 14px; }
.linen-form-title { font-size: 11px; font-weight: 700; color: #5b6b80; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.linen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.linen-item { background: #f1f4f8; border-radius: 10px; padding: 10px; }
.linen-item-label { font-size: 11px; color: #475569; margin-bottom: 6px; font-weight: 500; }
.linen-counter { display: flex; align-items: center; gap: 8px; }
.linen-btn { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #c3ccd8; background: white; font-size: 18px; font-weight: 400; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #1e293b; line-height: 1; flex-shrink: 0; }
.linen-btn:active { background: #c3ccd8; }
.linen-val { font-size: 18px; font-weight: 700; color: #1e293b; min-width: 24px; text-align: center; }
.linen-summary { margin-top: 10px; background: #f1f4f8; border-radius: 10px; padding: 10px 12px; }
.linen-summary-title { font-size: 11px; font-weight: 600; color: #5b6b80; margin-bottom: 6px; }
.linen-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.linen-tag { font-size: 11px; background: #c3ccd8; color: #334155; padding: 2px 8px; border-radius: 10px; }

/* Photos */
.photo-section { margin-top: 12px; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1.5px solid #c3ccd8; }
.photo-add-btn { width: 72px; height: 72px; border-radius: 8px; border: 1.5px dashed #94a3b8; background: #f1f4f8; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; color: #5b6b80; gap: 2px; }
.photo-add-btn span { font-size: 10px; font-weight: 500; color: #5b6b80; }
.photo-add-input { display: none; }
.photo-viewer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.95); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-viewer-close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; z-index: 10051; background: white; color: #0f172a; border: none; border-radius: 22px; padding: 11px 18px; font-size: 15px; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.4); }

.btn { border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; padding: 13px 16px; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-start   { background: #f59e0b; color: white; flex: 1; }
.btn-done    { background: #10b981; color: white; flex: 1; }
.btn-inspect { background: #3b82f6; color: white; flex: 1; }
.btn-danger  { background: #fee2e2; color: #b91c1c; }
.btn-ghost   { background: #e8edf3; color: #1e293b; flex: 1; }
.btn-status  { background: #f1f4f8; color: #5b6b80; flex: 1; font-size: 12px; pointer-events: none; border-radius: 10px; padding: 13px 16px; display: flex; align-items: center; justify-content: center; font-weight: 500; }
.btn-full    { width: 100%; display: block; }

.linen-card { background: #fffbeb; border: 1.5px solid #fbbf24; border-radius: 14px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.linen-icon { font-size: 26px; }
.linen-title { font-weight: 600; color: #92400e; font-size: 14px; }
.linen-sub { font-size: 12px; color: #b45309; margin-top: 2px; }

/* Common area card */
.ca-card { background: white; border-radius: 14px; border: 1.5px solid #e0e7ff; margin-bottom: 10px; }
.ca-card.ca-done { border-color: #6ee7b7; }
.ca-body { padding: 14px; display: flex; align-items: center; gap: 12px; }
.ca-icon { width: 48px; height: 48px; background: #eef2ff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.ca-card.ca-done .ca-icon { background: #d1fae5; }
.ca-info { flex: 1; }
.ca-name { font-weight: 600; font-size: 14px; color: #1e293b; }
.ca-sub { font-size: 12px; color: #475569; margin-top: 2px; }
.ca-btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ca-btn-done { background: #10b981; color: white; border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ca-btn-undo { background: #e8edf3; color: #475569; border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ca-card.ca-started { border-color: #fbbf24; }
.ca-btn-start-ca { background: #f59e0b; color: white; border: none; border-radius: 10px; padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Login */
.login-wrap { min-height: 100vh; background: #0f172a; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { color: white; font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.login-logo p { color: #475569; font-size: 14px; margin-top: 6px; }
.login-card { background: white; border-radius: 20px; padding: 22px; width: 100%; max-width: 380px; max-height: 80vh; overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch; }
.login-label { font-size: 11px; font-weight: 700; color: #5b6b80; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.staff-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; background: #f1f4f8; border: 1.5px solid #c3ccd8; border-radius: 12px; margin-bottom: 8px; cursor: pointer; font-size: 15px; font-weight: 500; color: #1e293b; }
.staff-rooms-tag { font-size: 11px; color: #475569; background: #c3ccd8; padding: 3px 8px; border-radius: 10px; font-weight: 400; }
.manager-btn { display: block; width: 100%; background: #1e293b; color: white; border: none; border-radius: 12px; padding: 14px; margin-top: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.divider { border: none; border-top: 1px solid #e8edf3; margin: 14px 0; }

.tab-scroll { overflow-x: auto; padding: 12px 12px 0; display: flex; gap: 8px; scrollbar-width: none; }
.tab-scroll::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1.5px solid #c3ccd8; background: white; color: #475569; cursor: pointer; }
.tab.active { background: #1e293b; color: white; border-color: #1e293b; }

.summary-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; color: white; }
.pill-dirty { background: #ef4444; } .pill-cleaning { background: #f59e0b; }
.pill-clean { background: #10b981; } .pill-inspected { background: #3b82f6; }
.pill-issue { background: #ec4899; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid #c3ccd8; display: flex; z-index: 100;
  /* 4 October: "it does look a bit messy". Fourteen buttons shared one phone's width equally,
     so the labels ran into each other ("SetupDashboardTasks..."). Each keeps its own room now and
     the bar scrolls sideways - with no scrollbar drawn - and it clears the iPhone's home bar. */
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-nav::-webkit-scrollbar { display: none; }
/* 6 October: "I've lost the logout button and the Switch button". Switch (and Logout, which lives
   in it) was the last button on a bar that scrolls, so on most screens it sat off the end. It is
   pinned to the right-hand edge now, always in sight. */
.nav-btn.nav-pin { position: sticky; right: 0; background: white; z-index: 1; box-shadow: -10px 0 12px -10px rgba(15,23,42,.35); }
.nav-btn { flex: 1 0 auto; min-width: 62px; white-space: nowrap; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 6px 14px; background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 500; color: #5b6b80; gap: 4px; }
.nav-btn.active { color: #1e293b; }
/* 20 October: "just make them closer together". On a wide screen five buttons stretched across
   the whole bar, a badge floating far from its icon. Each is at most 110px, and the row sits in
   the middle - by auto margins, not justify-content, which would cut off the start of a bar
   that scrolls. A long bar (the manager's) fills and scrolls as before. */
.bottom-nav > .nav-btn { max-width: 110px; }
.bottom-nav > .nav-btn:first-child { margin-left: auto; }
.bottom-nav > .nav-btn:last-child { margin-right: auto; }
.nav-icon { font-size: 20px; line-height: 1; }
/* 24 Nov: room for a button's count or dot */
.bottom-nav > .nav-btn:not(.nav-pin) { position: relative; }
/* 24 Nov: seven buttons and a More - they share the width rather than scroll off the edge */
.bottom-nav.nav-fit > .nav-btn { flex: 1 1 0; min-width: 0; padding: 10px 1px 14px; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }

.rota-wrap { padding: 14px 12px 80px; }
.rota-info { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #1e40af; margin-bottom: 16px; }
.rota-table-wrap { overflow-x: auto; border-radius: 14px; background: white; border: 1.5px solid #c3ccd8; }
.rota-table { border-collapse: collapse; min-width: 340px; }
.rota-table th { font-size: 11px; font-weight: 600; color: #475569; padding: 10px 6px; text-align: center; border-bottom: 1px solid #e8edf3; }
.rota-table th:first-child { text-align: left; padding-left: 14px; min-width: 110px; position: sticky; left: 0; background: white; z-index: 2; }
.rota-table td:first-child { text-align: left; padding-left: 14px; font-size: 13px; font-weight: 600; color: #1e293b; position: sticky; left: 0; z-index: 1; }
.rota-table tbody tr:nth-child(even) td { background: #f1f4f8; }
.rota-table tbody tr:nth-child(even) td.today-col { background: #e8fdf2; }
.rota-table tbody tr:nth-child(odd) td.today-col { background: #f0fdf4; }
.rota-table tbody tr:nth-child(even) td:first-child { background: #f1f4f8; }
.rota-table tbody tr:nth-child(odd) td:first-child { background: white; }
.rota-table th.today-col { background: #f0fdf4; color: #065f46; }
.rota-table td { padding: 6px 4px; text-align: center; border-bottom: 1px solid #f1f4f8; }
/* td:first-child handled above with sticky */
.rota-table tr:last-child td { border-bottom: none; }
.rota-table td.today-col { background: #f0fdf4; }
.rota-toggle { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid #c3ccd8; background: #f1f4f8; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transition: all 0.15s; }
.rota-toggle.on { background: #1e293b; border-color: #1e293b; color: white; }
.rota-toggle.today-on { background: #10b981; border-color: #10b981; color: white; }
.rota-hint { font-size: 12px; color: #5b6b80; text-align: center; margin-top: 12px; }

.reset-btn { width: 100%; padding: 14px; border: 1.5px solid #c3ccd8; border-radius: 12px; background: white; color: #5b6b80; font-size: 13px; cursor: pointer; margin: 4px 0 12px; }
.demo-banner { background: #fef3c7; border-bottom: 1px solid #fde68a; padding: 9px 16px; font-size: 12px; color: #92400e; text-align: center; }

/* ===== SETUP VIEW ===== */
.setup-wrap { padding: 14px 12px 80px; }
.setup-section-title { font-size: 11px; font-weight: 700; color: #5b6b80; text-transform: uppercase; letter-spacing: 0.07em; margin: 18px 0 10px; }
.setup-section-title:first-child { margin-top: 0; }
.floor-label { font-size: 12px; font-weight: 600; color: #475569; margin: 12px 0 6px; }
.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.room-tile { border-radius: 12px; border: 1.5px solid #c3ccd8; background: #f1f4f8; padding: 10px 6px 8px; text-align: center; cursor: pointer; transition: all 0.15s; user-select: none; }
.room-tile.departing { background: #fee2e2; border-color: #fca5a5; }
.room-tile.assigned  { background: #d1fae5; border-color: #6ee7b7; }
.room-tile-num  { font-size: 18px; font-weight: 700; color: #1e293b; }
.room-tile.departing .room-tile-num { color: #b91c1c; }
.room-tile.assigned  .room-tile-num { color: #065f46; }
.room-tile-type { font-size: 10px; color: #5b6b80; margin-top: 1px; }
.room-tile.departing .room-tile-type { color: #ef4444; }
.room-tile.assigned  .room-tile-type { color: #10b981; }
.room-tile-hk { font-size: 9px; font-weight: 700; color: #065f46; margin-top: 2px; }

.suggest-bar { background: white; border: 1.5px solid #c3ccd8; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.suggest-title { font-size: 14px; font-weight: 600; color: #1e293b; }
.suggest-sub { font-size: 12px; color: #475569; margin-top: 2px; }
.suggest-btn { background: #f59e0b; color: white; border: none; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.suggest-btn:active { opacity: 0.85; }

.workload-grid { display: flex; flex-direction: column; gap: 8px; }
.workload-card { background: white; border: 1.5px solid #c3ccd8; border-radius: 12px; padding: 12px 14px; }
.wl-top { display: flex; justify-content: space-between; align-items: baseline; }
.wl-name { font-size: 14px; font-weight: 700; color: #1e293b; }
.wl-rooms { font-size: 12px; color: #475569; }
.wl-bar-wrap { background: #e8edf3; border-radius: 4px; height: 6px; margin: 8px 0 6px; overflow: hidden; }
.wl-bar { height: 6px; background: #10b981; border-radius: 4px; transition: width 0.3s; }
.wl-finish { font-size: 12px; font-weight: 600; color: #059669; }
.wl-finish.wl-over { color: #dc2626; }

.assign-list { display: flex; flex-direction: column; gap: 8px; }
.assign-row { background: white; border: 1.5px solid #c3ccd8; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.assign-room-num { width: 40px; height: 40px; background: #e8edf3; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: #1e293b; flex-shrink: 0; }
.assign-room-info { flex: 1; min-width: 0; }
.assign-room-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.assign-room-sub  { font-size: 11px; color: #475569; margin-top: 1px; }
.assign-select { border: 1.5px solid #c3ccd8; border-radius: 8px; padding: 7px 8px; font-size: 13px; color: #1e293b; background: #f1f4f8; cursor: pointer; min-width: 100px; }
.assign-selects { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.twin-check { font-size: 11px; color: #7c3aed; font-weight: 600; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.twin-check input { cursor: pointer; accent-color: #7c3aed; }
.share-label { font-size: 10px; color: #5b6b80; font-weight: 500; }
.setup-note-input { width: 100%; border: 1.5px solid #c3ccd8; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #334155; background: #f1f4f8; margin-top: 5px; }
.setup-note-input:focus { outline: none; border-color: #5b6b80; }

.setup-confirm-btn { display: block; width: 100%; background: #1e293b; color: white; border: none; border-radius: 12px; padding: 15px; margin-top: 20px; font-size: 15px; font-weight: 600; cursor: pointer; }
.mgr-panel-btn { background: #e8edf3; color: #1e293b; border: 1.5px solid #c3ccd8; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; width: 100%; text-align: left; margin-top: 10px; }
.mgr-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e8edf3; }
.mgr-comment-input { width: 100%; border: 1.5px solid #c3ccd8; border-radius: 8px; padding: 10px; font-size: 13px; color: #1e293b; background: #f1f4f8; min-height: 72px; resize: none; font-family: inherit; display: block; }
.mgr-comment-input:focus { outline: none; border-color: #5b6b80; }
.date-input { border: 1.5px solid #c3ccd8; border-radius: 10px; padding: 10px 14px; font-size: 15px; color: #1e293b; background: white; width: 100%; }

/* ===== REPORTS VIEW ===== */
.reports-wrap { padding: 14px 12px 80px; }
.period-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.period-tab { flex: 1; padding: 9px 6px; border-radius: 10px; border: 1.5px solid #c3ccd8; background: white; color: #475569; font-size: 13px; font-weight: 500; cursor: pointer; text-align: center; }
.period-tab.active { background: #1e293b; color: white; border-color: #1e293b; }
.rpt-stat-card { background: white; border: 1.5px solid #c3ccd8; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.rpt-stat-name { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.rpt-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rpt-stat-cell { background: #f1f4f8; border-radius: 10px; padding: 10px 12px; }
.rpt-stat-cell.warning { background: #fff7ed; }
.rpt-stat-cell.danger { background: #fee2e2; }
.rpt-stat-cell.good { background: #d1fae5; }
.rpt-stat-num { font-size: 22px; font-weight: 700; color: #1e293b; line-height: 1; }
.rpt-stat-cell.danger .rpt-stat-num { color: #b91c1c; }
.rpt-stat-cell.good .rpt-stat-num { color: #065f46; }
.rpt-stat-cell.warning .rpt-stat-num { color: #92400e; }
.rpt-stat-lbl { font-size: 11px; color: #475569; margin-top: 4px; }
.export-btn { display: block; width: 100%; background: #059669; color: white; border: none; border-radius: 12px; padding: 14px; margin-top: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.export-btn:active { opacity: 0.85; }
.history-day-card { background: white; border: 1.5px solid #c3ccd8; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.history-day-date { font-size: 14px; font-weight: 600; color: #1e293b; }
.history-day-sub { font-size: 12px; color: #475569; margin-top: 3px; }
.save-day-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.rota-row:hover { background:#f5f7ff !important; }
.rota-row:hover > span:first-child { background:#f5f7ff !important; }
.save-day-btn { flex: 1; padding: 13px; border-radius: 12px; border: 1.5px solid #bbf7d0; background: #f0fdf4; color: #065f46; font-size: 13px; font-weight: 600; cursor: pointer; }
.no-data-box { text-align: center; padding: 40px 20px; color: #5b6b80; }
.no-data-box .no-data-icon { font-size: 44px; margin-bottom: 12px; }
.no-data-box .no-data-title { font-size: 15px; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.no-data-box .no-data-sub { font-size: 13px; line-height: 1.5; }

.room-time-hints { font-size: 11px; color: #5b6b80; margin-top: 3px; }
.room-time-hints strong { color: #334155; }

/* ===== CHECKLIST ===== */
.checklist-wrap { margin-top: 14px; border-top: 1px solid #e8edf3; padding-top: 14px; }
.checklist-area-label { font-size: 10px; font-weight: 700; color: #5b6b80; text-transform: uppercase; letter-spacing: 0.07em; margin: 10px 0 4px; }
.checklist-area-label:first-child { margin-top: 0; }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f1f4f8; cursor: pointer; }
.checklist-item:last-child { border-bottom: none; }
.checklist-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #94a3b8; background: white; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; transition: all 0.15s; }
.checklist-item.done .checklist-box { background: #10b981; border-color: #10b981; }
.checklist-tick { display: none; color: white; font-size: 13px; font-weight: 700; }
.checklist-item.done .checklist-tick { display: block; }
.checklist-text { font-size: 13px; color: #334155; line-height: 1.4; flex: 1; }
.checklist-item.done .checklist-text { color: #5b6b80; text-decoration: line-through; }
.checklist-progress { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.checklist-progress-bar { background: #e8edf3; border-radius: 4px; height: 5px; flex: 1; margin: 0 10px; overflow: hidden; }
.checklist-progress-fill { height: 5px; background: #10b981; border-radius: 4px; transition: width 0.3s; }

/* ===== INSPECTION ===== */
.insp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.insp-area { border-radius: 10px; border: 1.5px solid #c3ccd8; padding: 8px 6px; text-align: center; cursor: pointer; }
.insp-area-name { font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.insp-btns { display: flex; gap: 4px; justify-content: center; }
.insp-btn { flex: 1; border: none; border-radius: 6px; padding: 5px 0; font-size: 11px; font-weight: 700; cursor: pointer; }
.insp-btn-pass { background: #d1fae5; color: #065f46; }
.insp-btn-fail { background: #fee2e2; color: #b91c1c; }
.insp-btn-pass.active { background: #10b981; color: white; }
.insp-btn-fail.active { background: #ef4444; color: white; }
.insp-result-pass { border-color: #6ee7b7; background: #f0fdf4; }
.insp-result-fail { border-color: #fca5a5; background: #fff1f2; }

/* ===== TRAINING ===== */
.training-wrap { padding: 14px 12px 80px; }
.training-select-wrap { background: white; border: 1.5px solid #c3ccd8; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.training-select { width: 100%; border: 1.5px solid #c3ccd8; border-radius: 10px; padding: 11px 14px; font-size: 14px; color: #1e293b; background: #f1f4f8; }
.training-section { background: white; border: 1.5px solid #c3ccd8; border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.training-section-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px; cursor: pointer; }
.training-section-title { font-size: 15px; font-weight: 700; color: #1e293b; }
.training-section-status { display: flex; gap: 6px; align-items: center; }
.training-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.training-badge-shown { background: #dbeafe; color: #1e40af; }
.training-badge-done { background: #d1fae5; color: #065f46; }
.training-section-body { border-top: 1px solid #e8edf3; padding: 14px; }
.training-task-list { margin-bottom: 14px; }
.training-task { font-size: 13px; color: #334155; padding: 7px 0; border-bottom: 1px solid #f1f4f8; line-height: 1.4; display: flex; gap: 8px; align-items: flex-start; }
.training-task::before { content: '•'; color: #5b6b80; flex-shrink: 0; margin-top: 1px; }
.training-task:last-child { border-bottom: none; }
.training-signoff-row { display: flex; gap: 8px; margin-top: 4px; }
.training-signoff-btn { flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid #c3ccd8; background: #f1f4f8; color: #475569; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.training-signoff-btn.active-shown { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.training-signoff-btn.active-done { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }

.rezlynx-bar{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:12px 14px;margin-bottom:12px;gap:12px;}
.rezlynx-status{display:flex;align-items:center;gap:8px;font-size:13px;color:#374151;font-weight:500;}
.rezlynx-dot{width:9px;height:9px;border-radius:50%;background:#d1d5db;flex-shrink:0;transition:background .3s;}
.rezlynx-dot.synced{background:#10b981;}
.rezlynx-dot.syncing{background:#f59e0b;animation:pulse 1s infinite;}
.rezlynx-btn{padding:8px 16px;border-radius:8px;border:1.5px solid #d1d5db;background:#fff;font-size:13px;font-weight:600;color:#111827;cursor:pointer;white-space:nowrap;transition:background .15s;}
.rezlynx-btn:active{background:#f3f4f6;}

.room-flag-btn{padding:6px 12px;border-radius:20px;border:none;font-size:12px;font-weight:600;cursor:pointer;transition:all .15s;}
.arrival-time-input{border:1.5px solid #c3ccd8;border-radius:8px;padding:5px 8px;font-size:12px;color:#1e293b;background:#fff;width:90px;}
.maint-log-input{width:100%;box-sizing:border-box;border:1.5px solid #ddd6fe;border-radius:8px;padding:8px 10px;font-size:12px;color:#4c1d95;background:#faf5ff;min-height:60px;resize:vertical;}
.photo-upload-label{display:inline-block;background:#e8edf3;border:1.5px dashed #94a3b8;border-radius:8px;padding:5px 12px;font-size:11px;font-weight:600;color:#475569;cursor:pointer;}
.photo-upload-label:active{background:#c3ccd8;}
.insp-photo-thumb{display:inline-block;background:#dbeafe;border-radius:6px;padding:4px 8px;font-size:11px;margin-left:6px;cursor:pointer;}
.end-shift-btn{width:100%;margin-top:10px;background:#0f172a;color:white;border:none;border-radius:12px;padding:14px;font-size:15px;font-weight:700;cursor:pointer;letter-spacing:0.01em;}
.end-shift-btn:active{background:#1e293b;}
.shift-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:999;display:flex;align-items:flex-end;justify-content:center;}
.shift-modal{background:white;border-radius:20px 20px 0 0;padding:20px 16px 32px;width:100%;max-width:480px;max-height:85vh;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.shift-modal-hdr{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;}

.training-login-btn{width:100%;padding:14px;border:2px dashed #c7d2fe;border-radius:14px;background:#eef2ff;color:#4338ca;font-size:15px;font-weight:700;cursor:pointer;margin-top:8px;letter-spacing:0.01em;}
.training-login-btn:active{background:#e0e7ff;}
.trainee-hdr{background:linear-gradient(135deg,#4338ca,#6366f1);color:white;padding:20px 16px 16px;}
.trainee-hdr h1{font-size:22px;font-weight:700;margin:4px 0 2px;}
.trainee-hdr p{font-size:13px;opacity:0.8;margin:0;}
.trainee-select-card{background:white;border-radius:14px;padding:20px;margin:16px;box-shadow:0 2px 8px rgba(0,0,0,0.07);}
.trainee-select-card h2{font-size:16px;font-weight:700;color:#1e293b;margin:0 0 6px;}
.trainee-select-card p{font-size:13px;color:#475569;margin:0 0 16px;}
.trainee-pick-btn{width:100%;padding:13px 16px;border:1.5px solid #c3ccd8;border-radius:12px;background:white;font-size:14px;font-weight:600;color:#1e293b;cursor:pointer;text-align:left;margin-bottom:8px;transition:all .15s;}
.trainee-pick-btn:active,.trainee-pick-btn.sel{background:#eef2ff;border-color:#6366f1;color:#4338ca;}
.trainee-task-wrap{padding:0 16px 100px;}
.trainee-task-section{background:white;border:1.5px solid #c3ccd8;border-radius:14px;margin-bottom:10px;overflow:hidden;}
.trainee-section-hdr{padding:12px 14px;background:#f1f4f8;border-bottom:1px solid #c3ccd8;font-size:11px;font-weight:700;color:#1e293b;text-transform:uppercase;letter-spacing:0.07em;}
.trainee-task-row{display:flex;align-items:center;padding:10px 14px;border-bottom:1px solid #f1f4f8;gap:10px;}
.trainee-task-row:last-child{border-bottom:none;}
.trainee-task-label{flex:1;font-size:13px;color:#1e293b;line-height:1.4;}
.trainee-task-label.shown{color:#475569;}
.trainee-task-label.done{color:#5b6b80;text-decoration:line-through;}
.trainee-signoff-btn{padding:6px 13px;border-radius:8px;border:1.5px solid #c3ccd8;background:#f1f4f8;color:#5b6b80;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap;transition:all .15s;}
.trainee-signoff-btn.shown-active{background:#fef3c7;border-color:#fbbf24;color:#92400e;}
.trainee-signoff-btn.done-active{background:#d1fae5;border-color:#10b981;color:#065f46;}

.btn-training-off{padding:6px 10px;border:1.5px dashed #c7d2fe;border-radius:20px;background:transparent;color:rgba(255,255,255,0.7);font-size:13px;cursor:pointer;}
.btn-training-off:active{background:rgba(255,255,255,0.1);}
.btn-training-active{padding:6px 12px;border:none;border-radius:20px;background:#6366f1;color:white;font-size:12px;font-weight:700;cursor:pointer;}
.btn-training-active:active{background:#4338ca;}


/* ===== RESPONSIVE / DESKTOP ===== */
@media (min-width: 640px) {
  .rooms-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .content { max-width:960px; margin:0 auto; }
  /* 960px is a reading width, which is right for a board of rooms and wrong for fifty-two
     weeks side by side. The year sheet asks for every pixel the window has. */
  .content.wide { max-width:none; }
  .hdr { padding:20px 24px 16px; }
  /* 8 October: left:50% with the base rule's right:0 made the bar HALF the window wide, whatever
     max-width said, so Staff and Info slid under the pinned Switch. right:auto + width:100%. */
  .bottom-nav { width:100%; max-width:1240px; margin:0 auto; left:50%; right:auto; transform:translateX(-50%); border-radius:16px 16px 0 0; }
}
@media (max-width: 639px) {
  .rooms-grid { display:block; }
}

/* Photo thumbnails */
.photo-thumb { width:56px;height:56px;object-fit:cover;border-radius:8px;border:2px solid #c3ccd8;flex-shrink:0;cursor:pointer; }
.photo-thumb-sm { width:40px;height:40px;object-fit:cover;border-radius:6px;border:1.5px solid #c3ccd8;cursor:pointer; }
.photo-btn { background:#f1f4f8;border:1.5px solid #c3ccd8;border-radius:8px;padding:5px 10px;font-size:12px;color:#334155;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:4px;flex-shrink:0; }
.photo-btn:active { background:#c3ccd8; }

.perm-ro input,.perm-ro select,.perm-ro textarea{background:#f1f4f8!important;color:#475569!important}
.perm-ro .content button:not(.tab):not(.perm-ro-ok),.perm-ro .content [onclick]:not(.tab){cursor:not-allowed!important}
.perm-ro .content button:not(.tab):not(.perm-ro-ok){opacity:.5}

/* 3 November: everything pinned to the bottom of the screen moves by --vvfix, which corrects an
   iPhone that has the bottom of the screen in the wrong place after the keyboard closes
   (_vvFix in 01-render-and-boot.js). 'translate' adds to any transform already there. */
.bottom-nav, [style*="position:fixed"][style*="bottom:"]:not([style*="top:"]):not(#vv-probe) { translate: 0 var(--vvfix, 0px); }

/* 4 November: while a pop-up is open the page behind it does not scroll (_fsLockCheck, 07-forms-stay-open.js). */
html.popup-open, html.popup-open body { overflow: hidden; overscroll-behavior: none; }

/* THE SETUP BOARD (16 November): one grid, give rooms by housekeeper, a summary that stays put. */
.room-tile{position:relative;}
.room-tile-tags{font-size:9px;font-weight:700;color:#475569;margin-top:3px;line-height:1.3;}
.room-tile.open{box-shadow:0 0 0 2px #1e293b inset;}
.room-tile.qs{background:#ede9fe;border-color:#a78bfa;}
.room-tile.qs .room-tile-num{color:#5b21b6;} .room-tile.qs .room-tile-type{color:#7c3aed;} .room-tile.qs .room-tile-hk{color:#5b21b6;}
.room-tile.makeup{background:#f0fdfa;border-color:#5eead4;}   /* make-up only: an arrival, nobody leaving (1 Dec) */
.room-tile.makeup .room-tile-num{color:#0f766e;} .room-tile.makeup .room-tile-hk{color:#0f766e;}
.room-tile.unsold{background:#ffedd5;border-color:#fb923c;}   /* its own colour, orange (20 Nov) - it was a dashed grey */
.room-tile.unsold .room-tile-num{color:#c2410c;}
.room-tile.mine{box-shadow:0 0 0 3px #1e293b inset;}
.sb-corner{position:absolute;top:4px;left:7px;font-size:8px;font-weight:800;letter-spacing:.04em;}
.room-panel{background:white;border:1.5px solid #6ee7b7;border-radius:12px;padding:12px 14px;margin:8px 0 12px;}
.room-panel-head{display:flex;align-items:center;gap:10px;}
.room-panel-x{background:#e8edf3;border:none;border-radius:8px;width:30px;height:30px;font-size:13px;cursor:pointer;color:#475569;flex-shrink:0;}
.room-panel-foot{display:flex;gap:8px;margin-top:12px;}
.room-panel-done{flex:1;padding:10px;border-radius:10px;border:none;background:#1e293b;color:white;font-size:13px;font-weight:700;cursor:pointer;}
.sb-seg{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:#f1f4f8;border-radius:10px;padding:4px;margin-top:10px;}
.sb-seg button{border:none;background:transparent;border-radius:7px;padding:9px 2px;font-size:12px;font-weight:700;color:#5b6b80;cursor:pointer;}
.sb-seg button.on{background:white;color:#1e293b;box-shadow:0 1px 2px rgba(15,23,42,.18);}
.sb-seg button.on.sb-dep{background:#fee2e2;color:#b91c1c;box-shadow:0 0 0 1.5px #fca5a5 inset;}
.sb-seg button.on.sb-given{background:#d1fae5;color:#065f46;box-shadow:0 0 0 1.5px #6ee7b7 inset;}
.sb-seg button.on.sb-qs{background:#ede9fe;color:#5b21b6;box-shadow:0 0 0 1.5px #a78bfa inset;}
.sb-seg button.on.sb-none{background:#e2e8f0;color:#334155;box-shadow:0 0 0 1.5px #94a3b8 inset;}
.sb-switch{display:flex;align-items:center;gap:10px;background:#f8fafc;border-radius:10px;padding:10px 12px;margin-top:10px;cursor:pointer;}
.sb-toggle{width:42px;height:24px;border-radius:12px;background:#c3ccd8;position:relative;flex-shrink:0;}
.sb-toggle.on{background:#059669;}
.sb-toggle::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:white;transition:left .15s;}
.sb-toggle.on::after{left:21px;}
.sb-sum{position:sticky;top:0;z-index:20;background:#1e293b;color:white;border-radius:0 0 14px 14px;padding:9px 12px;margin:-4px 0 12px;display:grid;grid-template-columns:repeat(5,auto);justify-content:space-between;gap:8px;align-items:center;box-shadow:0 4px 12px rgba(15,23,42,.18);}
.sb-cell{display:flex;flex-direction:column;}
.sb-k{font-size:16px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.15;}
.sb-l{font-size:8.5px;white-space:nowrap;color:#cbd5e1;text-transform:uppercase;letter-spacing:.06em;}
.sb-fin{text-align:right;}
.sb-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}
.sb-chips .sb-chip{flex:0 1 calc(50% - 4px);max-width:220px;min-width:0;}
.sb-chip{background:white;border:1.5px solid #c3ccd8;border-radius:12px;padding:9px 11px;cursor:pointer;}
.sb-chip.on{border-color:#1e293b;box-shadow:0 0 0 2px #1e293b inset;}
.sb-chip-n{font-size:13px;font-weight:800;color:#1e293b;}
.sb-chip-s{font-size:11px;color:#5b6b80;margin-top:2px;font-variant-numeric:tabular-nums;}
.sb-chip .wl-bar-wrap{margin-top:6px;}
.sb-badge{display:inline-block;border-radius:10px;padding:1px 7px;font-size:10px;font-weight:700;margin-left:4px;}
.sb-give{background:#1e293b;color:white;border-radius:10px;padding:9px 12px;margin-top:8px;font-size:12px;display:flex;align-items:center;gap:8px;position:sticky;top:58px;z-index:19;}
.sb-give button{margin-left:auto;background:transparent;border:1.5px solid white;color:white;border-radius:8px;padding:5px 12px;font-weight:700;font-size:12px;cursor:pointer;}
.sb-btn{padding:9px 12px;background:white;color:#1e293b;border:1.5px solid #94a3b8;border-radius:10px;font-size:12px;font-weight:800;cursor:pointer;}
.sb-empty{background:#fef2f2;border:1.5px solid #fecaca;border-radius:12px;padding:10px 13px;font-size:12.5px;color:#b91c1c;font-weight:700;}
.sb-legend{display:flex;gap:10px;flex-wrap:wrap;font-size:11px;color:#5b6b80;margin:-2px 0 6px;}
.sb-legend span{display:flex;align-items:center;gap:5px;}
.sb-legend i{width:12px;height:12px;border-radius:4px;border:1.5px solid;display:inline-block;}
.sb-fold{background:white;border:1.5px solid #c3ccd8;border-radius:12px;padding:10px 13px;margin-bottom:12px;}
.sb-fold summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:10px;font-size:13px;font-weight:700;color:#1e293b;}
.sb-fold summary::-webkit-details-marker{display:none;}
.sb-fold summary small{font-size:11px;font-weight:500;color:#5b6b80;}
.sb-fold-more::after{content:"Show";font-size:11px;font-weight:700;color:#5b6b80;}
.sb-fold[open] .sb-fold-more::after{content:"Hide";}
.sb-tick{width:22px;height:22px;border-radius:50%;background:#d1fae5;color:#065f46;display:inline-grid;place-items:center;font-weight:800;font-size:12px;flex-shrink:0;}
.sb-settings{margin-top:18px;}
/* Quick marks over the room grid (16 November) */
.sb-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:0 0 8px;}
.sb-tool{border:1.5px solid;border-radius:10px;padding:10px 4px;font-size:12px;font-weight:800;cursor:pointer;}
.sb-tool.on{box-shadow:0 0 0 2px #1e293b inset;}

/* Self-check choice (18 Nov): the chosen one in the self-check colour */
.si-seg button.on{background:#4338ca;color:#fff;border-color:#4338ca;}

/* Timesheet full screen, add and remove (18 Nov) */
.pay-grid-bar{display:flex;align-items:center;gap:8px;padding:0 10px 8px;}
.pay-bar-btn{padding:7px 12px;border-radius:9px;border:1.5px solid #c3ccd8;background:#f1f4f8;color:#1e293b;font-size:12px;font-weight:800;cursor:pointer;}
.pay-bar-x{background:#1e293b;color:#fff;border-color:#1e293b;}
.pay-grid-box.pay-full{position:fixed;inset:0;z-index:9600;margin:0!important;border-radius:0!important;border:none!important;display:flex;flex-direction:column;padding:10px 0 0!important;}
.pay-grid-box.pay-full .pay-grid-scroll{flex:1;max-height:none!important;min-height:0;overscroll-behavior:contain;}
body:has(.pay-full){overflow:hidden;}

/* 25 Nov (Tyler: "the same for Me and Logout"): the header's own buttons had no style at all, so they were
   the phone's plain default buttons. Matching pills, readable on the dark header. */
.logout-btn { display:inline-flex; align-items:center; gap:5px; padding:8px 14px; border-radius:999px; border:1px solid rgba(255,255,255,.3);
  background:rgba(255,255,255,.12); color:#fff; font-size:13px; font-weight:700; line-height:1; cursor:pointer; white-space:nowrap; font-family:inherit; }
.logout-btn:active { background:rgba(255,255,255,.24); }

/* 26 Nov: a photo on its way up (finish photos) */
.ph-spin{display:inline-block;width:9px;height:9px;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;border-radius:50%;animation:phspin .8s linear infinite}
@keyframes phspin{to{transform:rotate(360deg)}}

/* 30 Nov: a room's details open under its own tile, in its column (Setup) */
.room-grid.sb-open{grid-auto-flow:row dense;align-items:start}
.sb-panel-cell{grid-column:var(--col);min-width:0}
.sb-panel-cell .room-panel{margin:0}
@media (max-width:700px){.sb-panel-cell{grid-column:1/-1}}
