* { box-sizing: border-box; margin: 0; }

/* ---------- Design tokens (from design_handoff_bm_tool) ---------- */
:root {
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Figtree", system-ui, sans-serif;

  /* accent — indigo */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-ink: #ffffff;
  --primary-light: #e9e8ff;
  --avatar-tint: #e7e6ff;

  /* warm-grey neutrals */
  --bg: #f7f7f4;
  --card: #ffffff;
  --text: #1a1a19;
  --text-2: #5f5d56;
  --muted: #78766e;
  --faint: #9a988f;
  --faintest: #b3b1a8;
  --border: #ecebe6;
  --border-subtle: #f1f0ec;
  --border-hover: #d9d7cf;
  --hover: #f4f3ef;
  --row-hover: #fbfbf9;
  --field: #ffffff;

  /* badge palette */
  --amber: #9a6700;   --amber-light: #fdf1d6;
  --blue: #1d4ed8;    --blue-light: #dce7fd;
  --green: #15803d;   --green-light: #dcf5e3;
  --red: #c2352b;     --red-light: #fce4e1;
  --gray: #6b6b64;    --gray-light: #f0efea;

  /* status dots */
  --dot-green: #22a35a;
  --dot-red: #d9483f;
  --dot-amber: #e0a11a;

  --radius: 16px;
  --radius-btn: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-ink: #17171f;
    --primary-light: #2a2850;
    --avatar-tint: #2a2850;

    --bg: #141412;
    --card: #1d1c1a;
    --text: #f2f1ed;
    --text-2: #c9c7bf;
    --muted: #a09e94;
    --faint: #807e74;
    --faintest: #5f5d56;
    --border: #2b2a26;
    --border-subtle: #252420;
    --border-hover: #3a3833;
    --hover: #262521;
    --row-hover: #21201d;
    --field: #191917;

    --amber: #f0c452;   --amber-light: #382c0e;
    --blue: #93b4f8;    --blue-light: #1d2a48;
    --green: #6fdd9f;   --green-light: #143323;
    --red: #f2988f;     --red-light: #3b201c;
    --gray: #b3b1a8;    --gray-light: #2b2a26;

    --dot-green: #37c974;
    --dot-red: #f06a60;
    --dot-amber: #ecb43a;
  }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 74px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.form-section { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; margin: 20px 0 2px; padding-top: 14px; border-top: 1px solid var(--border); }
/* Flat form: manager picker (2 Dec 2026) */
.mgr-pick { background: var(--primary-light, #eef2ff); border-radius: 12px; padding: 10px 12px 12px; margin-bottom: 14px; }
.mgr-pick label { margin-top: 0; }
.mgr-pick select { width: 100%; font-size: 16px; }
.mgr-pick .item-sub { margin-top: 6px; }
input.mgr-filled { border-color: var(--green, #16a34a); background: color-mix(in srgb, var(--green, #16a34a) 8%, transparent); }

/* ---------- Brand lockup ---------- */
.mark {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: #4f46e5; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--text); line-height: 1.25;
}
.brand-name em { font-style: normal; color: var(--primary); }

/* ---------- Sidebar (desktop) ---------- */
#sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column;
}
.side-logo { display: flex; align-items: center; gap: 11px; padding: 0 6px; margin-bottom: 16px; }
.side-sub { font-size: 11px; color: var(--faint); margin-top: 1px; }

/* 13 entries (the three phone apps sit here so nobody has to go through More — Sam, 16 Nov):
   the list scrolls on short screens instead of pushing the footer off. */
#sidenav { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#sidenav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: background 0.12s ease;
}
#sidenav a:hover { background: var(--hover); }
#sidenav a.active { background: var(--hover); color: var(--text); font-weight: 600; }
#sidenav .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--faintest); flex-shrink: 0; }
#sidenav a.active .dot { background: var(--primary); }
#sidenav .pill {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 20px; background: var(--gray-light); color: var(--faint);
  font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
#sidenav a.active .pill { background: var(--primary-light); color: var(--primary); }

.side-footer {
  margin-top: auto; background: var(--bg); border-radius: 12px; padding: 14px;
}
.org-name { font-size: 12px; font-weight: 600; }
.org-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }
.side-divider { height: 1px; background: var(--border); margin: 12px 0; }
.side-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--avatar-tint); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.user-name { font-size: 12px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--faint); }

/* ---------- Top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; padding-top: max(11px, env(safe-area-inset-top));
}
#topbar .brand { display: flex; align-items: center; gap: 10px; }
#topbar .brand .mark { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
#page-heading {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  letter-spacing: -0.4px; flex: 1;
  display: none;
}
#topbar-user { margin-left: auto; font-size: 13px; color: var(--faint); font-weight: 500; }

#globalSearch {
  display: none; align-items: center; gap: 9px;
  height: 40px; width: 280px; padding: 0 14px;
  background: var(--hover); border-radius: 10px;
}
#globalSearch .s-ico {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--faintest); flex-shrink: 0;
}
#globalSearch input {
  border: none; background: transparent; padding: 0;
  font: inherit; font-size: 13px; color: var(--text); width: 100%;
}
#globalSearch input:focus { outline: none; box-shadow: none; border: none; }
#topbar-action { display: none; height: 40px; align-items: center; gap: 7px; padding: 0 18px; white-space: nowrap; }
#topbar-action .plus { font-weight: 500; font-size: 16px; }

/* ---------- Bottom nav (phones) ---------- */
#bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  gap: 2px;
}
#bottomnav a {
  flex: 1 1 auto; min-width: 0; text-align: center; padding: 5px 2px 4px;
  font-size: 9.5px; font-weight: 600; color: var(--muted); text-decoration: none;
  border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#bottomnav a .ico { display: block; font-size: 17px; margin-bottom: 1px; }
#bottomnav a.active { color: var(--primary); background: var(--primary-light); }

/* ---------- Layout ---------- */
#main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
#view { max-width: 900px; margin: 0 auto; padding: 18px 16px; width: 100%; }

/* Desktop shell: sidebar + fixed-height main with scrolling content */
@media (min-width: 920px) {
  body { display: flex; height: 100vh; overflow: hidden; padding-bottom: 0; }
  #bottomnav { display: none !important; }
  #topbar { height: 68px; padding: 0 32px; flex-shrink: 0; }
  #topbar .brand, #topbar-user { display: none; }
  #page-heading { display: block; }
  #globalSearch { display: flex; }
  #topbar-action { display: inline-flex; }
  #view { flex: 1; overflow-y: auto; max-width: none; padding: 32px; }
}
@media (max-width: 919.9px) {
  #sidebar { display: none !important; }
}

.page-title {
  font-family: var(--font-display); font-weight: 600; font-size: 19px;
  letter-spacing: -0.4px; text-wrap: balance;
  margin: 2px 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
@media (min-width: 920px) {
  .page-title { font-size: 15px; margin: 0 0 16px; }
}
.section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--faint); margin: 22px 0 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.card.clickable { cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease; }
.card.clickable:active { background: var(--hover); }
@media (hover: hover) {
  .card.clickable:hover { background: var(--row-hover); border-color: var(--border-hover); }
}

.empty { text-align: center; color: var(--faint); padding: 34px 10px; font-size: 13.5px; }

/* ---------- List items ---------- */
.item { display: flex; align-items: flex-start; gap: 10px; }
.item .grow { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.item-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; overflow-wrap: anywhere; line-height: 1.5; }

.badge {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge.red { background: var(--red-light); color: var(--red); }
.badge.green { background: var(--green-light); color: var(--green); }
.badge.amber { background: var(--amber-light); color: var(--amber); }
.badge.blue { background: var(--blue-light); color: var(--blue); }
.badge.gray { background: var(--gray-light); color: var(--gray); }
.badge.indigo { background: var(--primary-light); color: var(--primary); }

/* ---------- Buttons & forms ---------- */
button, .btn {
  font: inherit; border: none; border-radius: var(--radius-btn); cursor: pointer;
  padding: 10px 18px; font-weight: 600; font-size: 13px;
  background: var(--primary); color: var(--primary-ink);
  text-decoration: none; display: inline-block;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
button:active, .btn:active { background: var(--primary-hover); }
@media (hover: hover) { button:hover, .btn:hover { background: var(--primary-hover); } }
button.secondary, .btn.secondary {
  background: var(--card); color: var(--muted);
  border: 1px solid var(--border); padding: 9px 17px;
}
button.secondary:active, .btn.secondary:active { background: var(--hover); color: var(--text); border-color: var(--border-hover); }
@media (hover: hover) {
  button.secondary:hover, .btn.secondary:hover { background: var(--hover); color: var(--text); border-color: var(--border-hover); }
}
button.danger { background: var(--red-light); color: var(--red); }
button.danger:hover, button.danger:active { background: var(--red-light); filter: brightness(0.96); }
button.small, .btn.small { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; }
button.small.secondary, .btn.small.secondary { padding: 6px 13px; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

.check-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--card); color: transparent;
  font-size: 16px; padding: 0; line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
@media (hover: hover) {
  .check-btn:hover { border-color: var(--dot-green); color: var(--green); background: var(--green-light); }
}
.check-btn:active { border-color: var(--dot-green); color: var(--green); background: var(--green-light); }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 13px 0 5px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--field); color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
input::placeholder, textarea::placeholder { color: var(--faintest); }

.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-actions button, .form-actions .btn { flex: 1; text-align: center; }

.searchbar { margin-bottom: 12px; background: var(--hover); border-color: transparent; }
.searchbar:focus { background: var(--field); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Login ---------- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; padding: 0 16px; }
.login-logo { text-align: center; margin-bottom: 10px; }
.login-logo img { border-radius: 12px; border: 1px solid var(--border); background: #fff; padding: 8px 12px; }
.login-title {
  text-align: center; font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 20px;
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 920px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; } }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: left;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: border-color 0.12s ease;
}
@media (hover: hover) { .stat:hover { border-color: var(--border-hover); } }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .num {
  font-family: var(--font-display); font-size: 34px; font-weight: 700;
  letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat .sub { font-size: 12px; color: var(--faint); }

/* ---------- Photos & video ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
.loc-video { width: 100%; max-height: 320px; border-radius: 10px; background: #000; margin-top: 8px; }

/* Lockbox key strip — the one thing cleaners look up most, so it sits on top. */
.key-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.key-strip.missing { cursor: default; }
.key-ico { font-size: 22px; flex-shrink: 0; }
.key-code {
  font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: 2px;
  color: var(--primary); background: var(--primary-light);
  padding: 4px 14px; border-radius: 10px; flex-shrink: 0;
}
.key-where { font-size: 13px; color: var(--text-2); line-height: 1.35; min-width: 0; }
.key-hint { font-size: 11px; color: var(--faint); }
.key-inline { color: var(--blue); letter-spacing: 0.5px; }
.photo-grid .ph { position: relative; }
.ph-del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%; padding: 0;
  background: rgba(26, 26, 25, 0.62); color: #fff;
  font-size: 12px; line-height: 24px; text-align: center;
}
.ph-del:hover, .ph-del:active { background: rgba(26, 26, 25, 0.85); }

/* ---------- Timeline ---------- */
.timeline { margin-top: 6px; }
.timeline-entry { border-left: 3px solid var(--primary-light); padding: 4px 0 12px 12px; margin-left: 4px; }
.timeline-entry .when { font-size: 11.5px; color: var(--faint); margin-top: 1px; }

/* ---------- Import table ---------- */
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 10px; display: block; overflow-x: auto; }
.preview-table th, .preview-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
.preview-table th {
  background: var(--bg); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--faint);
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--card);
  padding: 10px 18px; border-radius: 99px; font-size: 13.5px; font-weight: 500;
  z-index: 50; max-width: 90vw;
  box-shadow: 0 8px 28px rgba(20, 20, 18, 0.25);
}
#toast.error { background: var(--dot-red); color: #fff; }
@media (min-width: 920px) { #toast { bottom: 32px; } }

/* ---------- Flat picker ---------- */
.flat-picker { position: relative; }
.fp-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  max-height: 260px; overflow-y: auto;
  box-shadow: 0 8px 28px rgba(20, 20, 18, 0.12);
}
.fp-item { padding: 11px 12px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.fp-item:last-child { border-bottom: none; }
.fp-item:hover, .fp-item:active { background: var(--hover); }
.fp-item.muted { color: var(--faint); cursor: default; }

/* ---------- Linen ---------- */
.linen-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.linen-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.linen-form div { display: flex; align-items: center; gap: 8px; }
.linen-form span { flex: 1; font-size: 12.5px; color: var(--muted); }
.linen-form input { width: 64px; padding: 6px 8px; text-align: center; border: 2px solid var(--muted, #78716c); border-radius: 9px; font-weight: 600; }

/* ---------- Cleaning audits ---------- */
.a-row { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
.a-row:last-child { border-bottom: none; }
.a-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a-label { font-size: 13px; flex: 1; line-height: 1.4; }
.seg { display: flex; gap: 4px; flex-shrink: 0; }
.seg button {
  padding: 6px 11px; font-size: 12.5px; border-radius: 8px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.seg button:hover, .seg button:active { background: var(--hover); color: var(--text); border-color: var(--border-hover); }
.seg button.on-pass, .seg button.on-pass:hover { background: var(--green-light); color: var(--green); border-color: transparent; }
.seg button.on-fail, .seg button.on-fail:hover { background: var(--red-light); color: var(--red); border-color: transparent; }
.seg button.on-na, .seg button.on-na:hover { background: var(--gray-light); color: var(--gray); border-color: transparent; }
.a-fail { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.a-fail input { flex: 1; }
.a-fail button { flex-shrink: 0; }
.shot-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }

/* ---------- Cleaning calendar ---------- */
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.3px; min-width: 130px; text-align: center;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { margin-bottom: 6px; gap: 6px; }
.cal-dowh {
  text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--faint); padding: 2px 0;
}
.cal-cell {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); text-decoration: none; color: var(--text);
  overflow: hidden; transition: border-color 0.12s ease, background 0.12s ease;
}
.cal-cell.blank { border: none; background: transparent; }
@media (hover: hover) { .cal-cell.has:hover { border-color: var(--border-hover); background: var(--row-hover); } }
.cal-cell.has:active { background: var(--hover); }
.cal-dnum { position: absolute; top: 6px; left: 8px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.cal-cell.has { background: var(--primary-light); border-color: transparent; }
.cal-cell.heavy { background: var(--primary); }
.cal-cell.heavy .cal-dnum, .cal-cell.heavy .cal-count, .cal-cell.heavy .cal-sub { color: var(--primary-ink); }
.cal-count {
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1;
  letter-spacing: -1px; color: var(--primary); font-variant-numeric: tabular-nums;
}
.cal-cell.has .cal-count { color: var(--primary); }
.cal-cell.heavy .cal-count { color: var(--primary-ink); }
.cal-sub { font-size: 10.5px; font-weight: 600; color: var(--green); margin-top: 2px; }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (min-width: 920px) {
  .cal-grid { gap: 8px; }
  .cal-count { font-size: 32px; }
  .cal-dnum { font-size: 12.5px; }
}
.check-btn.done { border-color: var(--dot-green); color: var(--green); background: var(--green-light); }

/* ---------- Daily cleaning list ---------- */
.sum-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 14px;
}
.sum-cell { background: var(--card); padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; }
.sum-cell.strong { background: var(--primary-light); }
.sum-n {
  font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.1;
  letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
}
.sum-cell.strong .sum-n { color: var(--primary); }
.sum-l { font-size: 10.5px; color: var(--faint); font-weight: 600; line-height: 1.25; }

.cl-filters { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 10px 0 12px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.lg-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 600;
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
}
.lg-item:hover { background: var(--hover); color: var(--text); }
.lg-item.on { border-color: var(--primary); color: var(--text); background: var(--hover); }
.sw { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.cl-shown { font-size: 12px; color: var(--faint); margin-left: auto; }

.cl-row {
  display: grid; align-items: start; gap: 4px 10px;
  grid-template-columns: 28px 36px 1fr auto auto;
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid transparent;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 6px;
}
.cl-row.is-done { opacity: 0.55; }
.cl-no {
  font-size: 11.5px; font-weight: 700; color: var(--faintest);
  font-variant-numeric: tabular-nums; padding-top: 9px;
}
.cl-main { min-width: 0; }
.cl-name { font-weight: 600; font-size: 13.5px; line-height: 1.4; }
.cl-meta { font-size: 12px; color: var(--faint); margin-top: 2px; line-height: 1.5; overflow-wrap: anywhere; }
.cl-task {
  font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.5;
  background: var(--bg); border-radius: 8px; padding: 6px 9px; overflow-wrap: anywhere;
}
.cl-status { text-align: right; white-space: nowrap; padding-top: 1px; }
.cl-stat-txt { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-next { font-size: 11px; color: var(--primary); margin-top: 2px; }
.cl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.cl-row .check-btn { width: 30px; height: 30px; font-size: 14px; }

/* Row colours — same meanings as the team's spreadsheet. */
.cl-row.c-yellow { border-left-color: #d4a800; background: color-mix(in srgb, #d4a800 12%, var(--card)); }
.cl-row.c-pink { border-left-color: #d9489b; background: color-mix(in srgb, #d9489b 7%, var(--card)); }
.cl-row.c-orange { border-left-color: #e08a17; background: color-mix(in srgb, #e08a17 8%, var(--card)); }
.cl-row.c-green { border-left-color: #2e9e63; background: color-mix(in srgb, #2e9e63 8%, var(--card)); }
.cl-row.c-blue { border-left-color: #2f6fd0; background: color-mix(in srgb, #2f6fd0 8%, var(--card)); }
.sw-yellow { background: #d4a800; }
.sw-pink { background: #d9489b; }
.sw-orange { background: #e08a17; }
.sw-green { background: #2e9e63; }
.sw-blue { background: #2f6fd0; }

@media (max-width: 719.9px) {
  .cl-row { grid-template-columns: 24px 32px 1fr; }
  .cl-status { grid-column: 3; text-align: left; margin-top: 2px; }
  .cl-actions { grid-column: 3; flex-direction: row; align-items: center; gap: 10px; margin-top: 4px; }
  .sum-bar { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
}

/* ---------- Stock ---------- */
.st-back { display: inline-block; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; text-decoration: none; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.st-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle); font-size: 13.5px;
}
.st-row:last-child { border-bottom: none; }
.st-row .grow { flex: 1; min-width: 0; }
.st-row.clickable { cursor: pointer; }
.st-row.is-low b { color: var(--red); }
.st-num { font-family: var(--font-display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.st-num.low, .st-num.neg { color: var(--red); }
input.st-in { width: 72px; flex-shrink: 0; padding: 7px 8px; text-align: center; font-variant-numeric: tabular-nums;
  /* Sam, 2 Dec 2026: "can't see where to enter the quantity" — every number box has a clear frame */
  border: 2px solid var(--muted, #78716c); border-radius: 9px; background: var(--card); color: var(--text); font-weight: 600; }
input.st-in:focus { border-color: var(--primary, #4f46e5); outline: none; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18); }
select.st-field, input.st-field { border: 2px solid var(--muted, #78716c); border-radius: 9px; }
.st-shelf { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.st-shelf.low { color: var(--red); font-weight: 700; }
.st-big { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -1.5px; margin: 14px 0 6px; }
.st-big span { font-family: var(--font-body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.st-del { border-left: 4px solid var(--border); }
.st-del.must { border-left-color: var(--dot-red); }
.st-del.is-done { opacity: 0.6; }
.st-del-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.st-del-head .grow { flex: 1; min-width: 0; }
.st-del .seg button { min-width: 38px; padding: 8px 0; font-weight: 700; }
.st-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.st-lines .badge { justify-self: start; }
.st-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.st-line span { flex: 1; min-width: 0; }
.st-line input.st-in { width: 58px; padding: 6px; }
.st-del-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.st-del-foot select { flex: 1; min-width: 120px; max-width: 200px; padding: 7px 8px; font-size: 12.5px; }
.st-del-foot .grow { flex: 1; }
.st-short { border-color: var(--red); background: color-mix(in srgb, var(--red) 5%, var(--card)); }
/* The bag sequence on the Stock hub: Needed › Pack › With driver › Dropped */
.flow { display: flex; align-items: stretch; gap: 4px; margin: 4px 0 10px; overflow-x: auto; }
.flow-step {
  flex: 1; min-width: 118px; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; text-decoration: none; color: inherit;
}
.flow-step:hover { border-color: var(--accent); }
.flow-step.hot { border-color: var(--dot-red); }
.flow-n { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.6px; }
.flow-step b { font-size: 13px; }
.flow-num { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -1px; line-height: 1.1; }
.flow-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.flow-arrow { align-self: center; color: var(--muted); font-size: 20px; flex-shrink: 0; }
/* Flats tab (phone-first search) and the More grid */
.searchbar.big { font-size: 17px; padding: 14px 16px; }
.flats-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.flats-sum .grow { flex: 1; }
.flats-sum b { color: var(--text); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.more-grid .card { margin: 0; text-decoration: none; color: inherit; }
.more-grid .pill { margin-left: 6px; }
/* Stock hub: tomorrow's cleans per warehouse */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 12px; }
.plan-card { display: block; text-decoration: none; color: inherit; margin: 0; }
.plan-card:hover { border-color: var(--accent); }
.plan-card.hot { border-color: var(--dot-red); }
.plan-card.warn { border-color: var(--amber); }
.plan-num { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -1.5px; line-height: 1.1; margin: 6px 0 2px; }
.plan-num span { font-family: var(--font-body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; }
.sf-store { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-flat.is-checked { border-left-color: var(--dot-green); background: color-mix(in srgb, var(--green) 4%, var(--card)); }
.sf-tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; vertical-align: -3px; }
.sf-left { color: var(--amber, #9a6700); } .sf-ok { color: var(--green); }
.stat.red .num { color: var(--red); } .stat.amber .num { color: var(--amber, #9a6700); } .stat.green .num { color: var(--green); }
.sf-todo { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 0; }
.sf-todo input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
/* What's missing: the office's planning table per flat */
.sf-flat { border-left: 4px solid var(--border); }
.sf-flat.must { border-left-color: var(--dot-red); }
.sf-kit { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 2px; }
.sf-kit th { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border-subtle); }
.sf-kit td { padding: 4px 6px; border-bottom: 1px solid var(--border-subtle); }
.sf-kit tr:last-child td { border-bottom: none; }
.sf-kit .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sf-kit .pack { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sf-kit tr.is-short td:first-child { color: var(--red); font-weight: 600; }
.sf-kit input.st-in { width: 56px; padding: 5px 6px; }
.seg.sets button { min-width: 34px; padding: 6px 0; font-weight: 700; }
/* Bag journey: five dots, filled when the step is done */
.bag.must { border-left: 4px solid var(--dot-red); }
.journey { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.jstep { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); }
.jstep i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; margin-top: 3px; }
.jstep.done { color: var(--text); }
.jstep.done i { background: var(--accent); border-color: var(--accent); }
.jstep .item-sub { font-size: 11.5px; }
details.card summary { cursor: pointer; list-style-position: inside; }
details.card[open] summary { margin-bottom: 8px; }

.note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 8px 0; }
.divider { height: 1px; background: var(--border-subtle); margin: 14px 0; }
a.plain { color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* PMS mapping: one-tap flat suggestion chips under a listing */
.listing .chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.listing .chip { padding: 4px 10px; font-size: 12px; border-radius: 999px; text-align: left; }

/* Language switch (EN / PT) */
.lang-switch { font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); margin: 8px 0 4px; }

/* Today summary (16 Nov 2026): who is cleaning what, drivers */
.tl { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot-red); vertical-align: 0; margin-right: 4px; }
.tl.amber { background: var(--amber, #c99a2e); } .tl.green { background: var(--dot-green); }
.badge.pink { background: #fbe3f0; color: #b0307a; }
.badge.yellow { background: #fff3b8; color: #7a6100; }
.cl-guests { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cl-same { font-size: 11px; color: #7a6100; font-weight: 600; margin-top: 2px; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 8px; }
.sum-cleaner { margin: 0; }
.sum-flat { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--border-subtle); }
.sum-flat a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sum-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 13.5px; }
.sum-leg b { font-family: var(--font-display); font-size: 18px; }
.sum-leg.red b { color: var(--red); } .sum-leg.amber b { color: var(--amber, #9a6700); } .sum-leg.green b { color: var(--green); }
.sum-seq { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 6px; }
.sum-seq .tl { width: 12px; height: 12px; margin: 0; }
.sum-cleaner.unassigned { border-style: dashed; }

/* Calendar alerts (Sam, 17 Nov 2026) */
.alerts-card { border-color: var(--amber); background: var(--amber-light); padding: 10px 14px; margin-bottom: 12px; }
.alerts-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.alert-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(0,0,0,0.06); font-size: 13px; }
.alert-ico { flex-shrink: 0; }
.alert-txt { flex: 1; }
.alert-seen { flex-shrink: 0; font-size: 14px; }
#sidenav .pill-alert { background: var(--amber-light); color: var(--amber); margin-left: 4px; }
.timepick select { width: 100%; }

/* Calendar: filter by one flat (Sam, 17 Nov 2026) — the flat picker sits in the header row */
.cal-flat-filter { display: inline-flex; align-items: center; gap: 6px; }
.cal-flat-filter .flat-picker { width: 220px; }
.cal-flat-filter .fp-search { padding: 7px 10px; font-size: 12.5px; margin: 0; }
@media (max-width: 600px) { .cal-flat-filter .flat-picker { width: 100%; } .cal-flat-filter { width: 100%; } }

/* Flat page: clean timeline card (last clean · next clean · next check-in) */
.tl-card { padding: 12px 16px; }
.tl-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tl-step { display: block; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border-subtle); color: inherit; text-decoration: none; min-width: 0; }
a.tl-step:hover { border-color: var(--border-hover); }
.tl-step.tl-pink { background: #fbe3f0; border-color: #f3c3dc; }
.tl-step.tl-yellow { background: #fff3b8; border-color: #f0dd8a; }
.tl-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tl-main { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; margin: 2px 0; }
.tl-sub { font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.tl-foot { font-size: 12px; margin-top: 10px; }
.clean-hint { margin-top: 2px; font-size: 12.5px; }
@media (max-width: 600px) { .tl-row { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { .tl-step.tl-pink { background: #3a2230; border-color: #5a3048; } .tl-step.tl-yellow { background: #3a3414; border-color: #5a5020; } .badge.yellow { background: #3a3414; color: #e8d26a; } .cl-same { color: #e8d26a; } }

/* Flats master sheet (#/flats/sheet): the upload preview, one block per flat */
.sheet-flat { border-top: 1px solid var(--border); padding: 10px 0; }
.sheet-flat .item-title { margin-bottom: 6px; }
.sheet-diff { border-collapse: collapse; font-size: 13px; width: 100%; }
.sheet-diff th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 10px 3px 0; white-space: nowrap; width: 1%; }
.sheet-diff td { padding: 3px 6px; vertical-align: top; word-break: break-word; }
.sheet-diff td.old { color: var(--red); text-decoration: line-through; }
.sheet-diff td.new { color: var(--green); font-weight: 600; }
.sheet-diff td.arrow { color: var(--muted); width: 1%; padding: 3px 2px; }
.sheet-issues { margin: 8px 0; } .sheet-issues summary { cursor: pointer; font-weight: 600; color: var(--amber); }
.sheet-issues ul, .sheet-new ul { margin: 6px 0 0 18px; font-size: 13px; }
.sheet-new { margin: 8px 0; padding: 10px; border-radius: 12px; background: var(--primary-light); }
.warn-text { color: var(--amber); }

/* Today → Drivers today: the counts text is long, so on a phone it squeezed the
   name column to one letter per line (Sam's screenshot, 23 Nov 2026). The name
   keeps a sensible minimum and the counts drop to their own line when tight. */
.drv-row { flex-wrap: wrap; }
.drv-row .grow { flex: 1 1 170px; }
.drv-row > .item-sub { flex: 1 1 auto; text-align: right; }
@media (max-width: 600px) { .drv-row > .item-sub { flex: 1 1 100%; text-align: left; padding-left: 18px; } }
