:root {
  /* Corporate palette: navy brand, blue for actions, slate neutrals, muted status colours */
  --navy: #0b2545;
  --navy-d: #071a33;
  --accent: #1f5fad;
  --accent-d: #174a88;
  --accent-l: #9cc3ef;
  --gold: #b7791f;
  --green: #1e7b4f;
  --amber: #b7791f;
  --red: #b42318;
  --orange: #c4561b;
  --blue: #2563a8;
  --grey: #8792a2;
  --purple: #5e4fa2;
  --teal: #0e7c7b;
  --t-green: #e8f5ee;
  --t-amber: #fdf4e3;
  --t-red: #fcebe9;
  --t-blue: #e8f0fa;
  --t-grey: #f1f4f8;
  --t-teal: #e3f3f2;
  --t-orange: #fcede3;
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #5b6b82;
  --rule: #dde3ea;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.06);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Segoe UI',
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
body {
  border-top: 4px solid var(--navy);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 24px 60px;
}

/* ---- header ---- */
.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 16px;
  margin: -22px 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  /* white bar across the full window width */
  box-shadow: 0 0 0 100vmax var(--card);
  clip-path: inset(0 -100vmax);
}
.head h1 {
  margin: 0;
  color: var(--navy);
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.updated {
  color: var(--muted);
  font-size: 0.88em;
  margin-top: 3px;
}
.link-btn {
  border: 0;
  background: none;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
  padding: 0 0 0 8px;
  font-size: 1em;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.93em;
  white-space: nowrap;
  background: none;
  text-decoration: none;
  display: inline-block;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.btn-gold {
  background: var(--accent);
  color: #fff;
}
.btn-gold:hover {
  background: var(--accent-d);
}
.btn-outline {
  border-color: var(--rule);
  color: var(--navy);
  background: #fff;
}
.btn-outline:hover {
  border-color: var(--accent);
  background: var(--t-blue);
}
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover {
  background: var(--navy-d);
}
.btn-plain {
  border-color: var(--rule);
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
}
.btn-plain:hover {
  border-color: var(--navy);
}
.btn-danger {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
}
.btn-danger:hover {
  background: var(--t-red);
}

/* ---- summary cards ---- */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
}
.sec-head h2 {
  margin: 0;
  font-size: 1.15em;
  color: var(--navy);
}
.pill-btn {
  border: 1.5px solid var(--rule);
  background: #fff;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
}
.pill-btn .count {
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 6px;
  font-size: 0.85em;
}
.month-pop {
  position: absolute;
  right: 0;
  top: 40px;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.14);
  min-width: 200px;
}
.month-pop label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  cursor: pointer;
}
.month-pop .row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.month-pop .row button {
  flex: 1;
  border: 1px solid var(--rule);
  background: var(--bg);
  border-radius: 6px;
  padding: 5px;
  cursor: pointer;
}
.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--c, var(--navy));
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  min-height: 118px;
}
.card b {
  font-size: 1.85em;
  color: var(--c, var(--navy));
  line-height: 1.1;
}
.card .lbl {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86em;
  margin-top: 2px;
}
.card .note {
  font-size: 0.8em;
  color: var(--red);
  font-weight: 700;
  min-height: 1.1em;
  margin-top: 2px;
}
.card.hot {
  background: var(--t-red);
}
.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  margin-top: auto;
}
.spark i {
  flex: 1;
  background: var(--c, var(--navy));
  opacity: 0.75;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
}
.spark i.zero {
  background: var(--rule);
  opacity: 1;
  height: 3px;
}

/* ---- panels / calendar ---- */
.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 1.02em;
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cal-title {
  margin: 0;
  color: var(--navy);
  font-size: 1.12em;
}
.cal-title small {
  color: var(--muted);
  font-weight: 500;
}
.month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-nav h3 {
  margin: 0;
  min-width: 150px;
  text-align: center;
  color: var(--ink);
}
.arrow {
  border: 1.5px solid var(--rule);
  background: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-weight: 700;
}
.arrow:hover {
  border-color: var(--navy);
}
.cal-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86em;
}
.legend span::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--d);
  margin-right: 6px;
  vertical-align: -1px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
select,
input[type='search'],
input[type='date'],
input[type='text'],
input[type='number'],
input[type='email'],
textarea {
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}
.dow,
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.dow div {
  color: var(--muted);
  font-size: 0.8em;
  font-weight: 700;
  padding: 0 4px 4px;
}
.day {
  min-height: 92px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 5px 6px;
  background: #fff;
  overflow: hidden;
}
.day.blank {
  background: transparent;
  border-color: transparent;
}
.day.t-ready {
  background: var(--t-green);
  border-color: #bfe3cd;
}
.day.t-progress {
  background: var(--t-amber);
  border-color: #f1d9a4;
}
.day.t-action {
  background: var(--t-red);
  border-color: #f0c2bd;
}
.day.t-new {
  background: var(--t-grey);
}
.day.t-sched {
  background: var(--t-blue);
  border-color: #c9dbea;
}
.day.t-clean {
  background: var(--t-teal);
  border-color: #b6dfdd;
}
.day.today {
  box-shadow: inset 0 0 0 2px var(--navy);
}
.day .num {
  font-weight: 700;
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 3px;
}
.day.today .num {
  color: var(--navy);
}
.job {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 5px;
  padding: 3px 6px;
  margin-bottom: 3px;
  font-size: 0.8em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--s, var(--grey));
}
.job:hover {
  background: #fff;
}
.job small {
  display: block;
  color: var(--muted);
  font-size: 0.86em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job.done {
  opacity: 0.9;
}
.job .ico {
  margin-right: 3px;
}
.job.clean {
  border-left-width: 4px;
}
.job.clean.done {
  background: rgba(230, 244, 236, 0.95);
}
.loading,
.empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}
@media (max-width: 700px) {
  .day {
    min-height: 60px;
  }
  .job {
    font-size: 0.72em;
    padding: 2px 4px;
  }
}

.lower {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 20px;
}
@media (max-width: 1000px) {
  .lower {
    grid-template-columns: 1fr;
  }
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 4px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
}
.list li:first-child {
  border-top: 0;
}
.list li:hover {
  background: var(--bg);
}
.list li.empty {
  display: block;
  cursor: default;
}
.list li.grp {
  display: block;
  cursor: default;
  padding: 14px 4px 4px;
  color: var(--navy);
  font-weight: 700;
  border-top: 0;
}
.list li.grp:hover {
  background: none;
}
.l-date {
  color: var(--muted);
  font-size: 0.86em;
}
.l-ref {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l-ref small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  white-space: normal;
}
.l-who {
  color: var(--muted);
  font-size: 0.86em;
  white-space: nowrap;
}

table.prog {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93em;
}
table.prog th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rule);
}
table.prog td {
  padding: 7px 4px;
  border-top: 1px solid var(--rule);
}
table.prog .n {
  text-align: right;
  white-space: nowrap;
}
table.prog tr.total td {
  font-weight: 700;
  border-top: 2px solid var(--navy);
}
table.prog button.sec-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
table.prog button.sec-link:hover {
  text-decoration: underline;
}
.bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--green);
}
.yes-c {
  color: var(--green);
}
.no-c {
  color: var(--red);
}

/* ---- table view ---- */
.tbl-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.tbl-tools input[type='search'] {
  min-width: 240px;
  flex: 1;
}
.tbl-count {
  color: var(--muted);
  font-size: 0.88em;
  margin-left: auto;
}
.tbl-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
}
table.data th {
  text-align: left;
  font-size: 0.8em;
  color: var(--muted);
  padding: 8px;
  border-bottom: 2px solid var(--rule);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
table.data th.nosort {
  cursor: default;
}
table.data th .arr {
  margin-left: 4px;
  color: #b5bdc9;
}
table.data td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.data tr:hover td {
  background: #fafbfc;
}
table.data .ref {
  font-weight: 700;
  color: var(--navy);
}
table.data .sub {
  color: var(--muted);
  font-size: 0.85em;
}
table.data .num {
  text-align: right;
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.82em;
  font-weight: 700;
  white-space: nowrap;
}
.s-Ready,
.s-Cleaned,
.s-In-house {
  background: var(--t-green);
  color: var(--green);
}
.s-In-progress {
  background: var(--t-amber);
  color: #8a6412;
}
.s-Action-needed,
.s-Overdue,
.s-Cleaning-overdue {
  background: var(--t-red);
  color: var(--red);
}
.s-Issues-reported {
  background: var(--t-orange);
  color: #9a4614;
}
.s-Not-started,
.s-Checked-out,
.s-Cancelled {
  background: var(--t-grey);
  color: var(--muted);
}
.s-Due-today,
.s-Due-this-week,
.s-Cleaning-today,
.s-Checking-out-today {
  background: var(--t-amber);
  color: #8a6412;
}
.s-Scheduled,
.s-Upcoming {
  background: var(--t-blue);
  color: var(--blue);
}
.s-Cleaning-scheduled {
  background: var(--t-teal);
  color: var(--teal);
}
.mini {
  width: 90px;
}
.btn-xs {
  padding: 5px 10px;
  font-size: 0.85em;
}
.seg {
  display: inline-flex;
  border: 1.5px solid var(--navy);
  border-radius: 8px;
  overflow: hidden;
  flex-wrap: wrap;
}
.seg button {
  border: 0;
  background: #fff;
  color: var(--navy);
  padding: 7px 14px;
  font-weight: 700;
  cursor: pointer;
}
.seg button.on {
  background: var(--navy);
  color: #fff;
}

/* ---- dialog ---- */
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.3);
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1100px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-width: none;
  max-height: none;
  overflow: hidden;
}
@media (max-width: 640px) {
  dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
}
dialog::backdrop {
  background: rgba(20, 28, 45, 0.45);
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
.dlg-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px 10px;
  background: var(--navy);
  color: #fff;
}
.dlg-head h3 {
  margin: 0;
  font-size: 1.15em;
}
.dlg-head .sid {
  opacity: 0.8;
  font-size: 0.86em;
  margin-top: 2px;
}
.x {
  border: 0;
  background: none;
  color: #fff;
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.dtabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  background: var(--navy);
  padding: 0 12px;
}
.dtab {
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.72);
  padding: 9px 12px 10px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  font-size: 0.9em;
}
.dtab.active {
  color: #fff;
  border-bottom-color: var(--accent-l);
}
.dtab .c {
  font-size: 0.8em;
  opacity: 0.85;
  margin-left: 4px;
}
.dlg-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.dlg-msg {
  padding: 0 20px;
  min-height: 0;
  color: var(--red);
  font-weight: 600;
  max-height: 5.5em;
  overflow-y: auto;
  flex-shrink: 0;
}
.dlg-msg:not(:empty) {
  padding: 8px 20px;
}
.dlg-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  background: #fafbfc;
}
.spacer {
  flex: 1;
}
.f-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}
@media (max-width: 720px) {
  .f-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .f-grid {
    grid-template-columns: 1fr;
  }
}
.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.f.wide {
  grid-column: 1 / -1;
}
.f label {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--muted);
}
.f input,
.f select,
.f textarea {
  width: 100%;
  background: #fdf6e7;
}
.f textarea {
  min-height: 70px;
  resize: vertical;
}
.hint {
  color: var(--muted);
  font-size: 0.86em;
  margin: 0 0 12px;
}
.sec-note {
  background: var(--t-blue);
  color: var(--navy);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9em;
  margin-bottom: 12px;
}
.sec-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sec-tools .tally {
  color: var(--muted);
  font-size: 0.9em;
  margin-left: auto;
}
.items {
  display: flex;
  flex-direction: column;
}
.item {
  display: grid;
  grid-template-columns: 30px 1fr 128px 70px minmax(120px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  border-top: 1px solid var(--rule);
}
.item:first-child {
  border-top: 0;
}
.item.c4,
.item-head.c4 {
  grid-template-columns: 30px 1fr 128px minmax(140px, 1fr);
}
.item.is-yes {
  background: linear-gradient(90deg, var(--t-green), transparent 60%);
}
.item.is-no {
  background: linear-gradient(90deg, var(--t-red), transparent 60%);
}
.item .no {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}
.item .txt {
  font-weight: 500;
}
.item input {
  width: 100%;
  padding: 6px 8px;
  background: #fdf6e7;
}
.yn {
  display: inline-flex;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.yn button {
  border: 0;
  background: #fff;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.yn button + button {
  border-left: 1.5px solid var(--rule);
}
.yn button.on-yes,
.yn button.on-Good {
  background: var(--green);
  color: #fff;
}
.yn button.on-no,
.yn button.on-Poor {
  background: var(--red);
  color: #fff;
}
.yn button.on-Fair {
  background: var(--amber);
  color: #fff;
}
.item-head {
  display: grid;
  grid-template-columns: 30px 1fr 128px 70px minmax(120px, 0.8fr);
  gap: 10px;
  padding: 0 4px 6px;
  color: var(--muted);
  font-size: 0.8em;
  font-weight: 700;
}
.item .yn {
  justify-self: start;
}
.cond-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.cond-row > span:first-child {
  font-weight: 700;
  color: var(--navy);
}
.cond-row.missing {
  background: var(--t-red);
  box-shadow: inset 3px 0 0 var(--red);
}
.dlg-head,
.dtabs,
.dlg-foot {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .item-head {
    display: none;
  }
  .item,
  .item.c4 {
    grid-template-columns: 22px auto 64px minmax(0, 1fr);
    row-gap: 6px;
  }
  .item .txt {
    grid-column: 2 / -1;
  }
  .item .yn {
    grid-column: 2;
  }
  .item .q {
    grid-column: 3;
  }
  .item .nt {
    grid-column: 4;
  }
  .item.c4 .nt {
    grid-column: 3 / -1;
  }
  .yn button {
    padding: 6px 11px;
  }
  .dlg-foot {
    flex-wrap: wrap;
  }
  .dlg-foot .spacer {
    display: none;
  }
  #dSave {
    flex: 1 1 100%;
    order: -1;
  }
  .dlg-foot .btn:not(#dSave) {
    flex: 1;
    padding: 8px 6px;
    font-size: 0.85em;
  }
}
.f.missing input,
.f.missing select {
  border-color: var(--red);
  background: var(--t-red);
}
.f.missing label {
  color: var(--red);
}
.item.missing {
  background: var(--t-red);
  box-shadow: inset 3px 0 0 var(--red);
}
.item.missing .yn {
  border-color: var(--red);
}
.dtab .c.bad {
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  padding: 0 6px;
  opacity: 1;
}
.req-note {
  background: var(--t-amber);
  color: #7a5a10;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88em;
  margin-bottom: 12px;
}
.req-note.bad {
  background: var(--t-red);
  color: var(--red);
  font-size: 0.95em;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  display: none;
  z-index: 100;
  max-width: calc(100vw - 32px);
}
@media (prefers-reduced-motion: no-preference) {
  .item {
    transition: background-color 0.15s;
  }
}
.step {
  color: var(--accent-l);
  font-size: 0.74em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mini-h {
  color: var(--navy);
  margin: 20px 0 8px;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mini-h .sub {
  font-weight: 500;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip {
  background: var(--t-blue);
  color: var(--navy);
  border-radius: 12px;
  padding: 3px 10px;
  font-weight: 600;
  font-size: 0.86em;
}
.chip.out {
  background: var(--t-teal);
  color: var(--teal);
}
.chip.stay {
  background: var(--t-grey);
  color: var(--muted);
}
.chip.in {
  background: var(--t-amber);
  color: #8a6412;
}
.sub {
  color: var(--muted);
  font-size: 0.86em;
}
.ro-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px 14px;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}
.ro-grid div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ro-grid span {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 700;
}
.ro-grid b {
  font-weight: 600;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .ro-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- beds (property form) ---- */
.beds-in {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: flex-end;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.beds-in label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.86em;
}
.beds-in input {
  width: 84px;
}
.beds-in .tot {
  color: var(--navy);
  font-weight: 700;
  margin-left: auto;
  padding-bottom: 8px;
}

/* ---- booking dialog ---- */
.bedroom {
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.bedroom h4 {
  margin: 0;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--navy);
  font-size: 0.95em;
  display: flex;
  justify-content: space-between;
}
.bedroom h4 span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9em;
}
.bedrow {
  display: grid;
  grid-template-columns: 82px minmax(160px, 1fr) 160px minmax(180px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--rule);
}
.bedrow:first-of-type {
  border-top: 0;
}
.bedrow .bl {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.bedrow .bl input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--navy);
}
.bedrow.need .st {
  border-color: var(--red);
  background: #fff;
}
.bedrow input {
  width: 100%;
  background: #fdf6e7;
}
.bedrow .bstat {
  font-size: 0.86em;
  font-weight: 600;
}
.bedrow.free .bstat {
  color: var(--green);
}
.bedrow.set {
  background: linear-gradient(90deg, var(--t-green), transparent 70%);
}
.bedrow.set .bstat {
  color: var(--green);
}
.bedrow.part .bstat {
  color: #8a6412;
}
.bedrow.taken {
  background: var(--t-grey);
}
.bedrow.taken input {
  background: var(--t-grey);
  color: var(--muted);
}
.bedrow.taken .bstat {
  color: var(--muted);
}
.bedrow.clash {
  background: var(--t-red);
  box-shadow: inset 3px 0 0 var(--red);
}
.bedrow.clash .bstat {
  color: var(--red);
}
@media (max-width: 640px) {
  .bedrow {
    grid-template-columns: 74px 1fr;
  }
  .bedrow .co,
  .bedrow .bstat {
    grid-column: 2;
  }
}
.cap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- cleaner page ---- */
body:not(.cleaner) .cl-only {
  display: none !important;
}
body.cleaner .mgr-only {
  display: none !important;
}
.sched-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sched-tools label {
  color: var(--muted);
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}
#cleanSched li {
  grid-template-columns: 110px 1fr auto;
}

/* ---- staff check-out report ---- */
.item.cw,
.item-head.cw {
  grid-template-columns: 30px 1fr 214px minmax(140px, 1fr);
}
@media (max-width: 640px) {
  .item.cw {
    grid-template-columns: 22px auto 64px minmax(0, 1fr);
  }
  .item.cw .nt {
    grid-column: 2 / -1;
  }
}
.dmg {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
}
.dmg select,
.dmg textarea {
  width: 100%;
  background: #fdf6e7;
}
.dmg textarea {
  min-height: 64px;
  resize: vertical;
}
.dmg.missing {
  background: var(--t-red);
  box-shadow: inset 3px 0 0 var(--red);
}
@media (max-width: 640px) {
  .dmg {
    grid-template-columns: 1fr;
  }
}
table.near td,
table.near th {
  vertical-align: middle;
}
table.near tr.full td {
  color: var(--muted);
}
table.near tr.picked td {
  background: var(--t-green);
}
.cl-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.cl-row input {
  width: 100%;
  background: #fdf6e7;
}
@media (max-width: 640px) {
  .cl-row {
    grid-template-columns: 1fr;
  }
}
.link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.link-row input {
  flex: 1;
  min-width: 240px;
  background: var(--bg);
}
#coList li {
  grid-template-columns: 110px 1fr auto;
}

/* ---- bed QR labels ---- */
.qr-labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.qr-label {
  background: #fff;
  border: 2px dashed #b5bdc9;
  border-radius: 12px;
  padding: 18px 18px 16px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.qr-label .ql-top {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.05em;
}
.qr-label .ql-bed {
  color: var(--navy);
  font-weight: 700;
  font-size: 1.7em;
  margin: 4px 0 2px;
}
.qr-label .ql-addr {
  color: var(--muted);
  font-weight: 600;
}
.qr-label .ql-code {
  margin: 12px auto 10px;
  width: 62%;
  max-width: 230px;
}
.qr-label .ql-code svg {
  width: 100%;
  height: auto;
  display: block;
}
.qr-label .ql-text {
  font-size: 0.92em;
  line-height: 1.35;
}
.qr-label .ql-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 3px solid var(--accent);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.82em;
}
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }
  body {
    background: #fff;
  }
  .wrap {
    padding: 0;
    max-width: none;
  }
  .head,
  .qr-tools,
  .toast {
    display: none !important;
  }
  #qrView .panel {
    border: 0;
    padding: 0;
    margin: 0;
  }
  .qr-labels {
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
  }
  .qr-label {
    border-radius: 0;
  }
}

/* ---- sign-in page ---- */
.signin {
  max-width: 480px;
  margin: 72px auto;
  padding: 32px 32px 24px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.signin h1 {
  color: var(--navy);
  margin-top: 0;
}
.signin .btn {
  margin-top: 6px;
}
.signin-who {
  margin-top: 28px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- privacy policy and terms ---- */
.legal {
  max-width: 800px;
  margin: 40px auto 60px;
  padding: 32px 40px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.6;
}
.legal .step {
  color: var(--accent);
}
@media (max-width: 640px) {
  .signin,
  .legal {
    margin: 0;
    padding: 24px 18px;
    border-radius: 0;
  }
}
.legal h1 {
  color: var(--navy);
  margin: 0 0 4px;
}
.legal h2 {
  color: var(--navy);
  font-size: 1.1em;
  margin: 24px 0 6px;
}
.legal li {
  margin-bottom: 6px;
}
.legal-links {
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}
.legal-links a,
.legal a {
  color: var(--accent);
}

/* ---- PIH module bar and the /apps page ---- */
body.has-modules {
  border-top: 0;
}
.modules {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-height: 50px;
  padding: 0 24px;
  background: var(--navy);
  overflow-x: auto;
}
.mod-brand {
  display: flex;
  align-items: center;
  align-self: center;
  margin-right: 14px;
  padding: 2px 8px;
  background: #fff;
  border-radius: 6px;
}
.mod-brand img {
  display: block;
  height: 34px;
  width: auto;
}
.brand-logo {
  display: block;
  height: 54px;
  width: auto;
  margin: 0 0 16px;
}
.mod {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mod:hover {
  color: #fff;
}
.mod.active {
  color: #fff;
  border-bottom-color: var(--accent-l);
}
.mod-all {
  margin-left: auto;
  font-weight: 500;
}
@media (max-width: 640px) {
  .modules {
    padding: 0 12px;
  }
  .mod-all {
    display: none; /* the logo opens All apps */
  }
}
@media print {
  .modules {
    display: none;
  }
}
.apps {
  max-width: 720px;
  margin: 72px auto;
  padding: 0 20px;
}
.apps h1 {
  color: var(--navy);
  margin: 0 0 20px;
}
.app-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.app-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--navy);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}
.app-card:hover {
  border-top-color: var(--accent);
}
.app-card b {
  color: var(--navy);
  font-size: 1.15em;
}
.app-card span {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}
