:root {
  --bg: #f5f5f4; --panel: #ffffff; --ink: #1c1917; --ink-2: #44403c; --muted: #78716c; --line: #e7e5e4;
  --line-2: #d6d3d1; --brand: #0f766e; --brand-ink: #ffffff; --brand-soft: #ccfbf1; --side: #134e4a;
  --side-ink: #d1fae5; --side-active: #0f766e; --focus: #14b8a6;
  --green: #15803d; --green-soft: #dcfce7; --amber: #b45309; --amber-soft: #fef3c7; --red: #b91c1c;
  --red-soft: #fee2e2; --blue: #1d4ed8; --blue-soft: #dbeafe; --purple: #7e22ce; --purple-soft: #f3e8ff;
  --gray-soft: #f5f5f4; --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 17px; padding: 4px 8px 14px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: #2dd4bf; color: #134e4a; display: grid; place-items: center; font-weight: 800; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #99f6e4; opacity: .7; margin: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 9px; color: var(--side-ink); padding: 7px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; }
.nav .count { margin-left: auto; background: #f87171; color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.ico { width: 18px; text-align: center; opacity: .9; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.prop-switch { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; margin: 0; }
.prop-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.prop-switch select { font-weight: 600; min-width: 220px; }
.prop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.content { padding: 20px 22px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-h h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.stat a { color: inherit; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafaf9; white-space: nowrap; }
.table tr:hover td { background: #fafaf9; }
.table tfoot td { font-weight: 700; background: #fafaf9; }
.table .num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.table.compact td, .table.compact th { padding: 5px 8px; }
tr.muted-row td { color: var(--muted); }

/* ---------- forms */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font: inherit; color: inherit;
}
input[type=color] { width: 60px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: -3px; accent-color: var(--brand); }
select[multiple] { min-height: 110px; }
.field { margin-bottom: 14px; }
.field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.help { color: var(--muted); font-size: 12px; margin-top: 3px; }
.errorlist { color: var(--red); margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; }
.form-grid .wide, .form-grid-3 .wide, .form-grid-4 .wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.actions input, .actions select, .inline-form > input, .inline-form > select { width: auto; max-width: 260px; }
.page-head .actions form { margin: 0; }
/* quick fees: one row per fee – name, what to fill in, the post button */
.fee-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); margin: 0; }
.quick-fees .fee-row:first-of-type { margin-top: 10px; }
.fee-row .fee-name { font-weight: 600; min-width: 170px; }
.fee-row .fee-how { flex: 1; min-width: 200px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fee-row .fee-how input { width: auto; max-width: 100%; margin: 0; }
.fee-row .btn { margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) { .fee-row .fee-name { min-width: 0; width: 100%; } .fee-row .btn { margin-left: 0; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filters > div { min-width: 140px; }
.filters label { font-size: 12px; }
.checkbox-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.checkbox-groups fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.checkbox-groups legend { font-weight: 700; padding: 0 4px; }
.checkbox-groups label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 4px 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
#id_permissions { list-style: none; padding: 0; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #fafaf9; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #115e59; }
.btn-danger { background: #fff; border-color: #fca5a5; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
input.input-sm { width: auto; padding: 3px 8px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---------- badges & messages */
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.b-green { background: var(--green-soft); color: var(--green); border-color: #bbf7d0; }
.b-amber { background: var(--amber-soft); color: var(--amber); border-color: #fde68a; }
.b-red { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.b-blue { background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe; }
.b-purple { background: var(--purple-soft); color: var(--purple); border-color: #e9d5ff; }
.b-gray { background: var(--gray-soft); color: var(--muted); }
.msgs { margin-bottom: 14px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; border: 1px solid; }
.msg-success { background: var(--green-soft); border-color: #bbf7d0; color: #14532d; }
.msg-error { background: var(--red-soft); border-color: #fecaca; color: #7f1d1d; }
.msg-warning { background: var(--amber-soft); border-color: #fde68a; color: #78350f; }
.msg-info { background: var(--blue-soft); border-color: #bfdbfe; color: #1e3a8a; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.strong { font-weight: 700; }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.flex { display: flex; gap: 8px; align-items: center; }
.flex.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.pill-color { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: 0; margin-right: 4px; }

/* ---------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- reservation header */
.res-head { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.res-head .big { font-size: 20px; font-weight: 700; }
.res-head .meta { color: var(--muted); }
.money-box { display: flex; gap: 22px; }
.money-box div span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.money-box div b { font-size: 18px; }

/* ---------- tape chart */
.tape-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tape { --label: 150px; --col: 58px; min-width: calc(var(--label) + var(--days) * var(--col)); }
.tape-row { display: grid; grid-template-columns: var(--label) repeat(var(--days), minmax(var(--col), 1fr)); position: relative; min-height: 36px; border-bottom: 1px solid var(--line); }
.tape-row > * { grid-row: 1; }
.tape-head { position: sticky; top: 0; background: #fafaf9; z-index: 3; font-size: 12px; }
.tape-head .day { text-align: center; padding: 6px 2px; border-left: 1px solid var(--line); line-height: 1.2; }
.tape-head .day.weekend { background: #f5f5f4; }
.tape-head .day.today { background: var(--brand-soft); font-weight: 700; }
.tape-label { padding: 8px 10px; font-weight: 600; border-right: 1px solid var(--line); background: #fff; position: sticky; left: 0; z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape-label .hk { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.tape-cell { border-left: 1px solid var(--line); min-height: 36px; display: block; }
.tape-cell:hover { background: var(--brand-soft); }
.tape-cell.weekend { background: #fafaf9; }
.tape-cell.today { background: #f0fdfa; }
.tape-type { background: #f5f5f4; font-size: 12px; color: var(--ink-2); }
.tape-type .tape-label { background: #f5f5f4; font-weight: 700; }
.tape-type .avail { text-align: center; padding: 6px 0; border-left: 1px solid var(--line); font-weight: 700; }
.avail.zero { color: var(--red); } .avail.neg { background: var(--red-soft); color: var(--red); }
.bar { align-self: center; margin: 3px 2px; height: 28px; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.15); line-height: 20px; }
.bar:hover { text-decoration: none; filter: brightness(1.08); }
.bar.s-confirmed { background: #2563eb; } .bar.s-provisional { background: #d97706; } .bar.s-checked_in { background: #16a34a; }
.bar.s-checked_out { background: #78716c; } .bar.block { background: repeating-linear-gradient(45deg, #fecaca, #fecaca 6px, #fee2e2 6px, #fee2e2 12px); color: var(--red); box-shadow: none; }
.bar.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .bar.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.training-bar { position: sticky; top: 0; z-index: 100; background: #dc2626; color: #fff; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 12px; }
.pay-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #fff; vertical-align: -1px; margin-right: 5px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
/* payments on the calendar: a white mark at the start of each booking, or the whole bar in the payment colour */
.pay-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #fff; color: #57534e; font-size: 11px; font-weight: 800; line-height: 1; margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.pay-mark.m-paid { color: #15803d; } .pay-mark.m-partial { color: #b45309; } .pay-mark.m-unpaid { color: #dc2626; } .pay-mark.m-overpaid { color: #7c3aed; }
.pay-mark.overdue { background: #dc2626; color: #fff; box-shadow: 0 0 0 2px #fff; }
.by-pay .bar.pay-paid { background: #15803d !important; } .by-pay .bar.pay-partial { background: #d97706 !important; }
.by-pay .bar.pay-unpaid { background: #dc2626 !important; } .by-pay .bar.pay-none { background: #a8a29e !important; }
.by-pay .bar.pay-overpaid { background: #7c3aed !important; }
.seg { display: inline-flex; } .seg .btn { border-radius: 0; } .seg .btn:first-child { border-radius: 8px 0 0 8px; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; } .seg .btn.on { background: var(--side-active); color: #fff; border-color: transparent; }
.legend-pay .pay-mark { margin: 0 3px 0 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
/* room calendar without the reservations (housekeeping, maintenance): colours and guest numbers only */
.occ-grid { border-collapse: collapse; font-size: 12px; }
.occ-grid th, .occ-grid td { border: 1px solid var(--line); padding: 0; text-align: center; }
.occ-grid th { font-size: 11px; line-height: 1.2; padding: 4px 2px; background: #fafaf9; font-weight: 500; min-width: 32px; }
.occ-grid th.weekend { color: var(--brand); } .occ-grid th.today { background: var(--brand-soft); }
.occ-grid .who { text-align: left; padding: 6px 10px; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 600; }
.occ-grid thead .who { background: #fafaf9; }
.occ-grid tr.dept td { background: #fafaf9; font-size: 11px; color: var(--muted); height: 22px; text-align: left; }
.occ-grid .type-name { position: sticky; left: 10px; padding: 0 10px; white-space: nowrap; }
.occ-grid td.oc { height: 30px; min-width: 32px; font-weight: 700; color: #fff; }
.oc.in { background: #0f766e; }
.oc.arr { background: linear-gradient(90deg, transparent 45%, #0f766e 45%); text-align: right; padding-right: 4px; }
.oc.dep { background: linear-gradient(90deg, #0f766e 45%, transparent 45%); }
.oc.turn { background: linear-gradient(90deg, #d97706 45%, #0f766e 45%); text-align: right; padding-right: 4px; }
.oc.block { background: repeating-linear-gradient(45deg, #fecaca, #fecaca 4px, #fee2e2 4px, #fee2e2 8px); }
.oc.linked { background: #d6d3d1; }
.occ-days tr.today td { background: #f0fdfa; font-weight: 600; }

/* ---------- gantt (vehicles) */
.gantt { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow-x: auto; }
.gantt-inner { min-width: 900px; }
.g-row { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid var(--line); min-height: 46px; }
.g-label { padding: 8px 10px; border-right: 1px solid var(--line); font-weight: 600; }
.g-label .small { font-weight: 400; }
.g-track { position: relative; }
.g-hours { position: relative; height: 26px; font-size: 11px; color: var(--muted); }
.g-hours span { position: absolute; top: 6px; transform: translateX(-50%); }
.g-grid { position: absolute; inset: 0; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / 18) 100%; pointer-events: none; }
.g-bar { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; color: #fff; font-size: 11.5px; padding: 3px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 1; line-height: 1.25; }
.g-bar:hover { text-decoration: none; filter: brightness(1.08); }
.g-buffer { position: absolute; top: 12px; bottom: 12px; background: repeating-linear-gradient(45deg, #e7e5e4, #e7e5e4 4px, transparent 4px, transparent 8px); }
.g-bar.other { background: #a8a29e !important; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 2; }

/* ---------- housekeeping board */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hk-card { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.hk-card.st-dirty { border-left-color: #dc2626; } .hk-card.st-cleaning { border-left-color: #d97706; }
.hk-card.st-clean { border-left-color: #16a34a; } .hk-card.st-inspected { border-left-color: #2563eb; }
.hk-card.blocked { background: repeating-linear-gradient(45deg, #fff, #fff 8px, #fef2f2 8px, #fef2f2 16px); }
.hk-card.in-room { background: #f3efff; border-color: #c4b5fd; }
.hk-card .in-room-tag { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 11.5px; font-weight: 600; }
.in-room-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #7c3aed; vertical-align: 0; }
.hk-card .next-arrival { margin-top: 4px; }
.hk-card .room { font-size: 16px; font-weight: 700; }
.hk-card .task { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; font-size: 12.5px; }
.hk-status-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.task-big { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
.checklist label { font-weight: 400; display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

/* ---------- staff planning */
.sd { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 5px; font-size: 12px; font-weight: 700; border: 1px solid transparent; position: relative; user-select: none; }
.sd input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sd-none { background: #fff; border-color: var(--line); color: var(--muted); }
.sd-work { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.sd-off { background: #e7e5e4; color: #57534e; border-color: #d6d3d1; }
.sd-leave { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.sd-sick { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.sd-extra { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.sd-owed_off { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.sd-absent { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.sd-special { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.plan-grid .sd.locked { cursor: default; opacity: .75; }
.staff-balances .big { font-size: 28px; font-weight: 700; line-height: 1.2; }
.table.compact tr.total td { border-top: 2px solid var(--line); }
.rest-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.rest-chip { background: #e7e5e4; color: #44403c; border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.rest-chip.past { opacity: .5; }
.sd.waiting { outline: 2px dashed #d97706; outline-offset: -2px; }
.sd:has(input:checked), .sd.picked { box-shadow: 0 0 0 2px var(--brand); transform: scale(1.08); }
.sd:has(input:focus-visible) { outline: 2px solid var(--focus); }
.sd-btn { font-weight: 600; }
.sd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 10px; color: var(--muted); }
.staff-grid { font-size: 13px; }
.staff-grid th, .staff-grid td { padding: 3px 2px; text-align: center; }
.staff-grid th { font-size: 11px; line-height: 1.2; }
.staff-grid .who { text-align: left; padding-left: 10px; min-width: 150px; position: sticky; left: 0; background: #fff; z-index: 1; }
.staff-grid .bal { text-align: right; padding-right: 10px; }
.staff-grid .today { background: #f0fdfa; }
.staff-grid th.weekend { color: var(--brand); }
.staff-grid tr.dept td { background: #fafaf9; border-top: 2px solid var(--line); }
.staff-grid tr.dept .who { background: #fafaf9; }
.staff-grid tr.info td { padding-top: 1px; padding-bottom: 1px; }
.plan-grid .sd { cursor: pointer; }
.season { height: 8px; }
.season-low { background: #d6d3d1; } .season-shoulder { background: #fde68a; } .season-peak { background: #fdba74; }
.season-super_peak { background: #f87171; }
.plan-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; margin-bottom: 10px; }
.plan-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-extra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.request-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.request-row:last-child { border-bottom: 0; }
.my-balance { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.my-balance .card { margin: 0; padding: 12px; }
.my-balance .big { font-size: 24px; font-weight: 700; line-height: 1.2; }
.my-cal th, .my-cal td { text-align: center; padding: 4px 2px; }
.app-message { padding: 10px 0; border-bottom: 1px solid var(--line); }
.app-message:last-child { border-bottom: 0; }
.app-message.unread { background: #f0fdfa; margin: 0 -12px; padding: 10px 12px; border-left: 4px solid var(--brand); }
.app-message-body { margin: 4px 0 8px; font-size: 15px; }
.app-row { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); color: inherit; }
.app-row:last-child { border-bottom: 0; }
a.app-row:hover { text-decoration: none; background: #fafaf9; }
.app-when { min-width: 92px; color: var(--muted); font-size: 13px; }
.my-cal td { vertical-align: top; height: 54px; }
@media (max-width: 600px) { .my-balance .big { font-size: 18px; } .my-balance .card { padding: 8px; } }
.my-cal td.today { background: #f0fdfa; }

/* ---------- month calendar */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.month .dow { background: #fafaf9; padding: 6px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.month .day { min-height: 110px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.month .day.other { background: #fafaf9; color: var(--muted); }
.month .day.today { background: #f0fdfa; }
.month .day .n { font-weight: 700; margin-bottom: 4px; }
.month .ev { display: block; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; background: var(--blue-soft); color: var(--blue); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.month .ev.proj { background: #fff; border: 1px dashed var(--line-2); color: var(--muted); }
.month .ev.p1 { background: var(--red-soft); color: var(--red); } .month .ev.p2 { background: var(--amber-soft); color: var(--amber); }
.month .ev.done { background: var(--green-soft); color: var(--green); text-decoration: line-through; }

/* ---------- roster */
.roster td { min-width: 120px; }
.shift { display: block; background: var(--brand-soft); color: #134e4a; border-radius: 6px; padding: 3px 6px; margin-bottom: 3px; font-size: 12px; }

/* ---------- template editor */
.editor { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.editor textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; min-height: 520px; }
.field-picker { max-height: 640px; overflow-y: auto; }
.field-picker h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.field-picker button { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 8px; margin-bottom: 4px; cursor: pointer; font-size: 12px; }
.field-picker button:hover { border-color: var(--brand); background: #f0fdfa; }
.field-picker code { display: block; color: var(--brand); word-break: break-all; }

/* ---------- auth & public pages */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #134e4a, #0f766e 55%, #14b8a6); }
.center-card { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.center-card h1 { margin-bottom: 4px; }
.pay-amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 18px; }

/* ---------- autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto; }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 10px; cursor: pointer; font: inherit; }
.ac-list button:hover { background: #f0fdfa; }

/* ---------- responsive */
@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 250px; z-index: 50; transition: left .2s; }
  body.nav-open .sidebar { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .content { padding: 14px 14px 60px; }
  .topbar { padding: 8px 14px; }
  .prop-switch { flex: 1 1 auto; }
  .prop-switch select { min-width: 0; width: 100%; }
  .cols-2, .cols-3, .cols-4, .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .hide-mobile { display: none; }
  .money-box { gap: 14px; flex-wrap: wrap; }
}
@media print {
  .sidebar, .topbar, .noprint, .actions, .tabs, .msgs { display: none !important; }
  .app { display: block; } body { background: #fff; } .card { box-shadow: none; border: 0; padding: 0; }
  .content { padding: 0; max-width: none; }
}

/* ---------- store: big buttons and the item picker, made for a phone */
.store-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.store-tile { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 96px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); position: relative; }
.store-tile:hover { text-decoration: none; border-color: var(--brand); }
.store-tile b { font-size: 20px; }
.store-tile .small { color: var(--muted); }
.store-tile.main { background: var(--brand); color: #fff; border-color: var(--brand); }
.store-tile.main .small { color: #ccfbf1; }
.store-tile .tile-count { position: absolute; top: 10px; right: 10px; background: #d97706; color: #fff; border-radius: 999px; min-width: 26px; padding: 2px 8px; text-align: center; font-weight: 700; font-size: 13px; }
.store-tile .tile-count.red { background: #b91c1c; }
/* the vendor's own price / order page, opened from WhatsApp on a phone */
.vendor-page { max-width: 640px; margin: 0 auto; padding: 18px 16px 40px; }
.vendor-page h1 { margin-top: 2px; }
.vendor-row .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.vendor-row input[inputmode="decimal"] { font-size: 18px; padding: 10px; }
.vendor-row input:not([type="checkbox"]):not([inputmode]) { padding: 8px; }
.vendor-na { display: flex; align-items: center; gap: 6px; align-self: flex-end; padding: 10px 4px; white-space: nowrap; }
.picker-tools { position: sticky; top: 52px; z-index: 5; background: var(--bg); padding: 6px 0 8px; }
.picker-tools input[type=search] { font-size: 18px; padding: 12px 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; }
.fill-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fill-bar .btn { font-size: 16px; padding: 10px 14px; }
.today-jobs { display: grid; gap: 10px; margin-bottom: 18px; }
.today-job { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
.today-job:hover { text-decoration: none; border-color: var(--side-active); }
.today-job .ico { font-size: 26px; width: 34px; text-align: center; flex: none; }
.today-job b { display: block; font-size: 17px; }
.today-job .small { color: var(--muted); }
.today-job.done { opacity: .6; } .today-job.done b::after { content: " ✓"; color: var(--green); }
.today-job.warn { border-color: #fecaca; background: #fff7f7; }
.chip { flex: 0 0 auto; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.picker-row .what { flex: 1 1 auto; min-width: 0; }
.picker-row .what b { display: block; }
.picker-row .in-stock { color: var(--muted); font-size: 13px; }
.picker-row .in-stock.neg { color: #b91c1c; font-weight: 600; }
.picker-row input { width: 86px; font-size: 18px; text-align: center; padding: 10px 6px; }
.picker-row input.price { width: 110px; font-size: 15px; }
.picker-row.chosen { background: #f0fdfa; }
.picker-row[hidden] { display: none; }
.sticky-save { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; background: var(--panel); border-top: 2px solid var(--brand); margin: 0 -14px; }
.sticky-save .btn { font-size: 18px; padding: 12px 26px; }
.store-lang { font-size: 13px; }

/* ---------- housekeeping on the phone */
.hk-room { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
a.hk-room:hover { text-decoration: none; border-color: var(--brand); }
.hk-room > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.hk-room b { font-size: 18px; }
.hk-room .small b { font-size: 13px; }
.hk-room.urgent { border-left: 5px solid #b91c1c; }
.hk-state { flex: 0 0 auto; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #e7e5e4; color: #44403c; }
.hk-state.s-in_progress { background: #fef3c7; color: #92400e; }
.hk-state.s-done, .hk-state.s-inspected { background: #dcfce7; color: #166534; }
/* the supervisor's overview: who cleans which room */
.hk-who-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.hk-who-row:first-of-type { border-top: 0; }
.hk-who-name { display: flex; flex-direction: column; min-width: 160px; }
.hk-who-rooms { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.hk-chip { display: inline-flex; gap: 5px; align-items: baseline; padding: 4px 10px; border-radius: 999px; font-size: 13px;
  background: #e7e5e4; color: #44403c; border: 1px solid transparent; text-decoration: none; }
.hk-chip.s-in_progress { background: #fef3c7; color: #92400e; }
.hk-chip.s-done, .hk-chip.s-inspected { background: #dcfce7; color: #166534; }
.hk-chip.s-skipped { background: transparent; border-color: var(--line); color: var(--muted); }
@media (max-width: 640px) { .hk-who-name { flex: 1 1 100%; flex-direction: row; gap: 8px; align-items: baseline; flex-wrap: wrap; } }
.hk-big { display: block; width: 100%; font-size: 19px; padding: 14px; }
.hk-part { margin: 14px 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hk-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 12px; margin-bottom: 6px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; }
.hk-item .box { flex: 0 0 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line-2); border-radius: 7px; color: transparent; font-weight: 700; }
.hk-item.on { background: #f0fdfa; border-color: var(--brand); }
.hk-item.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.hk-sync { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; }
.hk-sync[hidden] { display: none; }

/* Who may do what */
.role-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.role-pick { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; font-weight: 400; cursor: pointer; background: var(--panel); }
.role-pick:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin-top: 2px; }
.group-tools { margin: -2px 0 6px; color: var(--muted); }
button.link { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; }
.access-groups label.perm { padding: 2px 4px; border-radius: 6px; cursor: pointer; }
.access-groups label.perm .tag-extra, .access-groups label.perm .tag-removed { display: none; margin-left: 4px; font-size: 11px; }
.access-groups label.perm.extra { background: var(--green-soft); }
.access-groups label.perm.extra .tag-extra, .access-groups label.perm.removed .tag-removed { display: inline-block; }
.access-groups label.perm.removed { background: var(--red-soft); }
.access-groups label.perm.removed .txt { text-decoration: line-through; color: var(--muted); }
.access-save { margin: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.access-save .btn { font-size: 15px; padding: 10px 20px; }
.people-table tr.dept td { background: #fafaf9; font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* Money in */
.money-bad { color: var(--red); }
.follow-up { border-bottom: 1px solid var(--line); padding: 8px 0; }
.follow-up:last-child { border-bottom: 0; }
.mail-text { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; white-space: pre-wrap; }
textarea.mail-text { width: 100%; line-height: 1.45; }
.flow-bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 8px; overflow-x: auto; }
.flow-bar { flex: 1 0 48px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.flow-col { flex: 1; width: 70%; position: relative; display: flex; align-items: flex-end; }
.flow-col span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 4px 4px 0 0; }
.flow-opt { background: var(--brand-soft); }
.flow-sure { background: var(--brand); }
.flow-v { font-size: 11px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.flow-l { font-size: 11px; color: var(--muted); white-space: nowrap; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.key-sure { background: var(--brand); } .key-opt { background: var(--brand-soft); border: 1px solid var(--line-2); }
.flow-table td, .flow-table th { white-space: nowrap; }
tr.total-row td { border-top: 2px solid var(--line-2); background: #fafaf9; }

/* Park permits chosen by hand */
.permit-table select, .permit-table input { width: 100%; }
.permit-table td:first-child { min-width: 260px; }
.permit-table .other-fields { gap: 6px; }
.permit-table .other-fields[hidden] { display: none; }

/* Money in: overdue per period */
.period-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.period-tile { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink); background: var(--panel); }
.period-tile b { font-size: 18px; }
.period-tile:hover { border-color: var(--brand); }
.period-tile.on { border-color: var(--brand); background: var(--brand-soft); }

/* Bank page tabs */
.tabs-inline { display: flex; flex-wrap: wrap; gap: 6px; }
