:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #dfe3e8;
  --brand: #1f3a5f;
  --dirty: #c0392b;
  --cleaned: #d68910;
  --checked: #2e86c1;
  --ready: #1e8449;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.brand { font-weight: 700; font-size: 19px; }
.who { font-size: 14px; display: flex; gap: 10px; align-items: center; }
.who button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); padding: 4px 10px; border-radius: 8px; font-size: 14px; }
main { max-width: 640px; margin: 0 auto; padding: 16px; padding-bottom: 96px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input[type=email], input[type=password], textarea {
  width: 100%; font-size: 17px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
button { font: inherit; cursor: pointer; }
.btn {
  display: block; width: 100%; padding: 14px; margin-top: 16px;
  border: 0; border-radius: 10px; font-size: 17px; font-weight: 600;
  background: var(--brand); color: #fff;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.error { color: var(--dirty); font-size: 15px; margin-top: 10px; }

/* Section menu */
.tabs { display: flex; gap: 6px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* Staff screen */
.staff-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.staff-row:last-child { border-bottom: 0; }
.staff-row .info { flex: 1; min-width: 0; }
.staff-row .name { font-weight: 600; }
.staff-row .meta { font-size: 14px; color: var(--muted); }
.staff-row.inactive .name { text-decoration: line-through; color: var(--muted); }
.mini { padding: 7px 10px; font-size: 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--brand); white-space: nowrap; }
.mini.danger { color: var(--dirty); }
.role-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #e8edf3; color: var(--brand); margin-left: 6px; text-transform: capitalize; font-weight: 600; }
select, input[type=text] { width: 100%; font-size: 17px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.inline .mini { padding: 0 14px; }
.handout { background: #eef7f0; border: 1px solid #bfe0c7; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.handout .big { font-size: 22px; font-weight: 700; letter-spacing: .04em; }

/* Floor filter */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Room grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.room {
  border: 0; border-radius: 10px; padding: 12px 6px; color: #fff; text-align: center;
  font-weight: 700; font-size: 18px;
}
.room small { display: block; font-weight: 500; font-size: 12px; opacity: .9; }
.room.dirty { background: var(--dirty); }
.room.cleaned { background: var(--cleaned); }
.room.checked { background: var(--checked); }
.room.ready { background: var(--ready); }
.room.done { background: var(--ready); opacity: .85; }

/* Inspection */
.btn.pass { background: var(--ready); }
.btn.fail { background: #fff; color: var(--dirty); border: 1px solid var(--dirty); margin-top: 8px; }
.sentback { background: #fdecea; border: 1px solid #f5c2bd; color: #7b241c; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.tabs .count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--cleaned); color: #fff; font-size: 12px; text-align: center; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge.dirty { background: var(--dirty); }
.badge.cleaned { background: var(--cleaned); }
.badge.checked { background: var(--checked); }
.badge.ready { background: var(--ready); }

/* Segmented clean-type picker */
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.seg button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 4px; color: var(--text); font-size: 17px; }
.checklist input { width: 24px; height: 24px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--ready); }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--ready); transition: width .2s; }

.back { background: none; border: 0; color: var(--brand); padding: 0; font-size: 16px; margin-bottom: 8px; }
.starter-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #222; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 15px;
  max-width: 90vw; z-index: 20;
}
.toast.err { background: var(--dirty); }
