/* Staff app (mobile site). Colours and shared pieces (login card, buttons,
   popups, pills, photo grid) come from ../styles.css. */

body { font-size: 15px; min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); }
body.cam-open { overflow: hidden; }

a { color: inherit; }

/* ---------- Top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.bar h1 { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-back { font-size: 22px; text-decoration: none; padding: 2px 8px 2px 0; }
.home-bar img { border-radius: 12px; background: #0f1419; padding: 3px; }
.home-bar > div { flex: 1; min-width: 0; }
.home-bar small { color: var(--muted); font-weight: 600; }
.bar-btn { border: 1px solid var(--border); background: var(--chip); border-radius: 12px; width: 40px; height: 40px; font-size: 18px; }

/* ---------- Home menu ---------- */

.menus, .list, .page { padding: 16px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.section { font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin: 8px 0 -2px; }
.note { margin: 0; line-height: 1.5; }

.menu {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.menu > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.menu b { font-size: 16px; }
.menu small { color: var(--muted); font-size: 13px; }
.menu > i { color: var(--muted); font-style: normal; font-size: 22px; }
.menu-icon { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex-shrink: 0; }

.t-accent { background: var(--accent); color: var(--on-accent); }
.t-serious { background: var(--serious-soft); color: var(--serious); }
.t-blue { background: var(--blue-soft); color: var(--s1); }
.t-good { background: var(--good-soft); color: var(--good); }
.t-warn { background: var(--warn-soft); color: var(--warn-text); }
.t-none { background: var(--chip); color: var(--muted); }

/* ---------- Task cards ---------- */

.task {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
}
.task-room { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 17px; font-weight: 800; text-align: center; flex-shrink: 0; overflow: hidden; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-main small { color: var(--muted); font-size: 13px; }
.timer { font-weight: 800; color: var(--warn-text); }
.danger { color: var(--danger-text) !important; font-weight: 600; }

/* Status colours (st-checkout, st-cleaning, …) are the dashboard's, so a room
   looks the same on the Room Board and here. */
.task-room, .pill[class*="st-"] { color: var(--text); }

/* ---------- Detail / form pages ---------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card h3 { font-size: 12px; letter-spacing: 0.8px; color: var(--muted); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.big { font-size: 26px; font-weight: 800; }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.page .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.photos button { color: var(--muted); font-size: 11px; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.btn-block { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 16px; }
.btn-big { min-height: 60px; font-size: 17px; letter-spacing: 0.3px; }
.btn-secondary:disabled { opacity: 0.6; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.field select { height: 52px; font-size: 16px; }
.rule { font-weight: 800; font-size: 16px; margin: 4px 0 0; text-align: center; }
.center { text-align: center; margin: 0; }
.banner { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--critical-soft); }
.link-btn { border: none; background: none; color: var(--accent-text); font-weight: 800; padding: 0 0 0 8px; }

.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.strip-note { margin: -4px 0 0; font-size: 13px; }

.thumb { position: relative; width: 84px; height: 84px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--chip); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--critical); color: #fff; font-size: 12px; padding: 0; }
.thumb .up { position: absolute; left: 4px; bottom: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: #f5a524; }
.thumb .up.ok { background: #12a150; }
.thumb .up.bad { background: #d03b3b; }
.thumb.busy::after { content: ""; position: absolute; inset: 30%; border: 3px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Camera / scanner (always dark) ---------- */

.cam { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.cam-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.cam-icon { width: 44px; height: 44px; border: none; background: none; color: #fff; font-size: 20px; border-radius: 50%; }
.cam-icon.on { color: #f5b544; }
.cam-view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: contain; }
.cam-msg { position: absolute; padding: 24px; text-align: center; margin: 0; }
.cam-count { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6); padding: 6px 14px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.cam-flash.on { opacity: 0.6; }
.cam-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 4px; min-height: 76px; }
.cam-thumbs .thumb { width: 64px; height: 64px; }
.cam-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 24px calc(20px + env(safe-area-inset-bottom)); }
.cam-shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff; background: none; padding: 5px; }
.cam-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.cam-shutter:disabled i { background: rgba(255, 255, 255, 0.38); }
.cam-done { justify-self: end; height: 44px; padding: 0 18px; border: none; border-radius: 99px; background: #0f766e; color: #fff; font-weight: 800; font-size: 15px; }
.cam-done:disabled { background: #444; color: #999; }
.scan-frame { position: absolute; width: 250px; height: 250px; border: 4px solid #f5b544; border-radius: 24px; }
.scan-hint { margin: 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }

/* ---------- Misc ---------- */

.m-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; }
.m-lightbox img { max-width: 100%; max-height: 100%; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 70;
  margin: 0 auto;
  max-width: 480px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--tip-bg);
  color: var(--tip-text);
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* The dashboard's grey secondary button nearly matches this page's background. */
.page .btn-secondary { border: 1px solid var(--border); background: var(--surface); }

/* ---------- Complaints ---------- */

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--chip); border-radius: 14px; }
.seg a { text-align: center; padding: 10px 4px; border-radius: 11px; text-decoration: none; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg a[aria-current="true"] { background: var(--surface); color: var(--text); font-weight: 800; box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chips .chip { flex-shrink: 0; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-weight: 700; font-size: 13px; }
.chips .chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.task-room.p-Immediate { background: var(--p-immediate-bg); color: var(--p-immediate-fg); }
.task-room.p-Urgent { background: var(--p-urgent-bg); color: var(--p-urgent-fg); }
.task-room.p-Normal { background: var(--p-normal-bg); color: var(--p-normal-fg); }
.task-room.p-Low { background: var(--p-low-bg); color: var(--p-low-fg); }
.fab { position: fixed; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 20px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 32px; font-weight: 600; text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.list:has(.fab) { padding-bottom: 100px; }
.photos.one { grid-template-columns: 1fr; }
.photos.one button { aspect-ratio: 4 / 3; }
.field input, .field textarea { font: inherit; font-size: 16px; padding: 12px; border: 1px solid var(--axis); border-radius: 12px; background: var(--surface); color: var(--text); }
.field input { height: 52px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-btn { cursor: pointer; }
.photo-preview { position: relative; border-radius: 14px; overflow: hidden; background: var(--chip); }
.photo-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.photo-preview button { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--critical); color: #fff; }

/* ---------- Front desk ---------- */

.t-occupied { background: var(--occupied-soft); color: var(--occupied); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.fd-floor h3 { font-size: 12px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
.fd-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.fd-room { height: 56px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 16px; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.danger-btn { color: var(--danger-text); }
.undo { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.undo small { color: var(--muted); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choices .link-btn { align-self: center; padding: 8px; }

/* ---------- Notifications ---------- */

.bell { position: relative; display: grid; place-items: center; text-decoration: none; }
.bell em { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--critical); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.right { align-self: flex-end; }
.note-item { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.note-item span { color: var(--text-2); font-size: 14px; }
.note-item small { color: var(--muted); font-size: 12px; }
.note-item.unread { border-left: 4px solid var(--accent); }

/* The dashboard centres its toast with a transform; here it spans the width. */
.toast { transform: none; }
