:root {
  --navy: #4B506A; --navy-dark: #3A3E54; --teal: #4FA9A7; --teal-ink: #2F7F7D;
  --ink: #23263A; --muted: #5B6075; --line: #E1E4EC; --bg: #F4F5F8; --card: #FFFFFF;
  --warn-bg: #FDF1DC; --warn: #7A4B00; --ok-bg: #E2F3EC; --ok: #1E6A4A; --bad: #B3261E; --new-bg: #E8EAF3;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--teal-ink); }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.topbar { background: var(--navy); border-bottom: 3px solid var(--teal); padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { height: 68px; display: block; }
.who { color: #fff; font-size: 13px; text-align: right; }
.who small { display: block; color: #D7DAE5; }
.who button { margin-top: 4px; background: none; border: 1px solid #9AA0B4; color: #fff; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.layout { display: flex; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 20px 16px 96px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sidenav { flex: 0 0 210px; display: flex; flex-direction: column; gap: 6px; }
.sidenav a { display: block; padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.sidenav a.on { background: var(--navy); color: #fff; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { text-align: center; padding: 14px 4px; font-size: 12px; font-weight: 600; text-decoration: none; color: #6B7085; border-top: 3px solid transparent; }
.tabbar a.on { color: var(--teal-ink); border-top-color: var(--teal); }
@media (max-width: 760px) { .sidenav { display: none !important; } .layout { padding-top: 16px; } }
@media (min-width: 761px) { .tabbar.director { display: none !important; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 92px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; }
.tile.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.tile small { font-weight: 500; color: var(--muted); }
.tile.primary small { color: #E9F6F5; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; }
.label-caps { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.big { font-size: 28px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input, select, textarea { font: inherit; font-size: 15px; font-weight: 400; padding: 11px 12px; border: 1px solid #C9CDD8; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { min-height: 46px; padding: 0 18px; border-radius: 12px; border: none; font: inherit; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; }
.btn.teal { background: var(--teal); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid #C9CDD8; }
.btn.danger { background: #fff; color: var(--bad); border: 1px solid #E8B4B0; }
.btn:disabled { opacity: .6; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9CDD8; background: #fff; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.New { background: var(--new-bg); color: var(--navy); }
.pill.Booked { background: var(--warn-bg); color: var(--warn); }
.pill.Fixed, .pill.Closed, .pill.paid { background: var(--ok-bg); color: var(--ok); }
.pill.Emergency { background: #FBE3E1; color: var(--bad); }
.pill.soon { background: var(--warn-bg); color: var(--warn); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); text-decoration: none; }
.item .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .title { font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); padding: 9px 8px; border-bottom: 2px solid var(--navy); white-space: nowrap; }
td { padding: 11px 8px; border-bottom: 1px solid #EEF0F4; vertical-align: top; }
.notice { background: #E7F4F3; border-radius: var(--radius); padding: 16px; }
.bubble { max-width: 85%; padding: 11px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.bubble.mine { align-self: flex-end; background: var(--navy); color: #fff; border-color: var(--navy); }
.bubble .meta { font-size: 11px; opacity: .75; margin-top: 4px; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.error { color: var(--bad); font-size: 14px; }
.success { color: var(--ok); font-weight: 600; }
.back { align-self: flex-start; text-decoration: none; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.login { max-width: 420px; margin: 24px auto; }
.alerts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.alert-btn { position: relative; display: flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; padding: 9px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.alert-btn:hover, .alert-btn.on { background: rgba(255,255,255,.14); }
.alert-btn .ico svg { width: 22px; height: 22px; display: block; }
.alert-btn .badge { position: absolute; top: 3px; left: 23px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #E5484D; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; border: 2px solid var(--navy); }
.alert-btn .badge[hidden] { display: none; }
@media (max-width: 760px) { .alert-btn .lbl { display: none; } .brand img { height: 52px; } }
.fin-h { font-size: 15px; margin: 18px 0 8px; }
.finance .grid4 .card { background: var(--bg); border: none; }
.finance .list .item { background: var(--bg); border: none; padding: 11px 14px; }
.ticker { display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; font-size: 13px; }
.ticker[hidden] { display: none; }
.tk-label { flex: 0 0 auto; display: flex; align-items: center; background: var(--teal-ink); color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 0 14px; text-decoration: none; }
.tk-view { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.tk-track { display: inline-flex; white-space: nowrap; animation: tk-roll var(--dur, 30s) linear infinite; }
.ticker:hover .tk-track, .ticker:focus-within .tk-track { animation-play-state: paused; }
.tk-set { display: inline-flex; }
.tk-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0 10px 24px; }
.tk-item::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #C9CDD8; margin-left: 16px; }
.tk-date { font-weight: 700; color: var(--teal-ink); }
.tk-soon .tk-date { color: var(--warn); }
.tk-where { color: var(--muted); }
@keyframes tk-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tk-track { animation: none; } .tk-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .tk-set[aria-hidden] { display: none; } }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin-top: 14px; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot.rent { background: #2F9E7A; } .dot.out { background: var(--navy); } .dot.key { background: #D98A12; } .dot.doc { background: #8A5CC7; } .dot.tenancy { background: var(--teal); }
.cal { padding: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 6px 0; }
.cal-cell { min-height: 104px; border: 1px solid var(--line); border-radius: 8px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.empty { border: none; }
.cal-cell.today { border: 2px solid var(--teal); }
.cal-day { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-cell.today .cal-day { color: var(--teal-ink); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-chip { font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.rent { background: #E2F3EC; color: #1E6A4A; } .cal-chip.out { background: #E8EAF3; color: var(--navy); }
.cal-chip.key { background: var(--warn-bg); color: var(--warn); } .cal-chip.doc { background: #F0E8FA; color: #5B3A8A; } .cal-chip.tenancy { background: #E7F4F3; color: var(--teal-ink); }
.cal-chip.done { text-decoration: line-through; opacity: .65; } .cal-chip.late { outline: 1.5px solid var(--bad); }
.cal-more { font-size: 11px; color: var(--muted); }
.tabbar.director { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) {
  .cal-cell { min-height: 54px; padding: 4px; align-items: center; }
  .cal-chip, .cal-more { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-cell.has { background: #F7F8FB; }
}
.dropzone { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 26px 16px; border: 2px dashed #C9CDD8; border-radius: 12px; cursor: pointer; font-weight: 500; text-align: center; }
.dropzone.over, .dropzone:hover { border-color: var(--teal); background: #F2FAF9; }
.dropzone b { color: var(--teal-ink); }
table.upl td { vertical-align: middle; }
table.upl input, table.upl select { padding: 7px 8px; font-size: 13px; min-width: 120px; }
table.upl input[type=checkbox] { min-width: 0; width: 18px; height: 18px; }
input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; padding: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.sub { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.progress { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 8px 0 10px; }
.progress span { display: block; height: 100%; background: var(--teal); }
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-item { flex-direction: row; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; font-weight: 500; cursor: pointer; }
.check-item:hover { background: var(--bg); }
.check-item .ci-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.check-item.done .ci-main > span:first-child { text-decoration: line-through; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.dot.task { background: var(--bad); } .cal-chip.task { background: #FBE3E1; color: var(--bad); }
