/* Agency: a light desktop window in the Apple Mail / Finder manner, in the system font (Segoe UI on Windows, SF on
   Apple). Chosen by Francis on 2 December 2026. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --side: #eef0f3;
  --side-hover: rgba(15, 23, 42, .045);
  --side-on: rgba(15, 23, 42, .085);
  --pane: #ffffff;
  --sunk: #f5f6f8;
  --line: rgba(15, 23, 42, .09);
  --line-strong: rgba(15, 23, 42, .15);
  --text: #1c1f24;
  --text-2: #4f5661;
  --text-3: #5d6574;
  --accent: #0a66d9;
  --accent-hover: #0858bd;
  --accent-soft: rgba(10, 102, 217, .12);
  --ring: 0 0 0 3px rgba(10, 102, 217, .32);
  --inactive-sel: #e1e5eb;
  /* rent status: dot colour, then the darker text colour that reads on white */
  --ok: #2f9e52;   --ok-t: #1f7a3c;
  --bad: #dc3d43;  --bad-t: #be2a30;
  --warn: #e0950f; --warn-t: #8f5b00;
  --due: #2f7de1;  --due-t: #1c5fbf;
  --up: #9aa1ab;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.4 var(--font);
  color: var(--text);
  background: var(--pane);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
::selection { background: rgba(10, 102, 217, .2); }
button, input, select { font: inherit; color: inherit; }
button { cursor: default; }
:focus-visible { outline: none; box-shadow: var(--ring); }
* { scrollbar-width: thin; scrollbar-color: rgba(15, 23, 42, .22) transparent; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- window ---------- */
.window { display: grid; grid-template-columns: 232px 1fr; height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  height: 52px; padding: 0 18px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: var(--text); text-decoration: none;
}
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.sidebar h2 {
  margin: 16px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0;
}
.sidebar h2:first-child { margin-top: 6px; }
.src { list-style: none; margin: 0; padding: 0; }
.src button, .src a {
  display: flex; align-items: center; gap: 9px; width: 100%;
  height: 30px; padding: 0 8px; border: 0; border-radius: 6px;
  background: none; text-align: left; text-decoration: none; color: var(--text);
  transition: background-color .15s;
}
.src button:hover, .src a:hover { background: var(--side-hover); }
.src [aria-current="true"], .src [aria-current="page"] { background: var(--side-on); font-weight: 600; }   /* a chosen filter, and the page you are on */
.src span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src em { font-style: normal; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.src em.hot { color: var(--bad-t); font-weight: 600; }
.ico {
  width: 17px; height: 17px; flex: none; display: inline-block;
  background: var(--accent);
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.dot-dev { width: 17px; height: 17px; flex: none; display: grid; place-items: center; }
.dot-dev::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: #8a919c; }
.dot-dev.op::before { background: #3b7fd9; }
.dot-dev.rc::before { background: #8b5cc7; }
.dot-dev.th::before { background: #1f9a8a; }
.dot-dev.tm2::before { background: #c4842b; }
.sidebar .st { width: 17px; height: 17px; flex: none; display: grid; place-items: center; }
.sidebar .st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.me {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.me b { display: block; font-size: 13px; font-weight: 600; }
.me small { display: block; font-size: 12px; color: var(--text-3); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #d6dbe3; color: #3d4450; font-size: 11px; font-weight: 600;
}

/* ---------- toolbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px 0 20px; border-bottom: 1px solid var(--line);
  background: var(--pane); height: 52px; flex: none;
}
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.tb-title p { margin: 1px 0 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-icon { border: 0; background: none; width: 30px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
.tb-icon:hover { background: var(--sunk); }
.only-narrow { display: none; }

.seg {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: 7px;
  background: #e8eaee;
}
.seg button {
  border: 0; background: none; height: 24px; padding: 0 12px; border-radius: 5px;
  font-size: 13px; color: var(--text-2);
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] {
  background: #fff; color: var(--text); font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .14), 0 0 0 .5px rgba(15, 23, 42, .08);
}
.searchbox {
  display: flex; align-items: center; gap: 6px;
  width: 220px; height: 28px; padding: 0 9px; border-radius: 7px;
  background: #eceef1; color: var(--text-3);
  transition: background-color .15s, box-shadow .15s;
}
.searchbox:focus-within { background: #fff; box-shadow: 0 0 0 1px var(--line-strong), var(--ring); }
.searchbox svg { width: 14px; height: 14px; flex: none; }
.searchbox input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 13px; }
.searchbox input::placeholder { color: var(--text-3); }

/* ---------- panes ---------- */
.panes { display: grid; grid-template-columns: 384px 1fr; flex: 1; min-height: 0; position: relative; }
.listpane { display: grid; grid-template-rows: 1fr auto; min-height: 0; border-right: 1px solid var(--line); }
.rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; outline: none; }
.row {
  position: relative; padding: 10px 16px 11px 18px;
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 1px;
}
.row::after { content: ""; position: absolute; left: 18px; right: 0; bottom: 0; height: 1px; background: var(--line); }
.row:hover { background: #f7f8fa; }
.row .lot { font-weight: 600; font-size: 14px; letter-spacing: -.005em; white-space: nowrap; }
.row .lot small { font-weight: 500; font-size: 12px; color: var(--text-3); margin-left: 6px; }
/* an ended tenancy: 're-let Aug' or 'ended', small and grey next to the lot */
.etag { margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--text-3); white-space: nowrap; cursor: default; }
.listpane:focus-within .row[aria-selected="true"] .etag { color: rgba(255, 255, 255, .8); }
.endline a { color: var(--accent); text-decoration: none; }
.endline a:hover { text-decoration: underline; }
.row .owed { font-size: 13.5px; font-weight: 600; color: var(--bad-t); text-align: right; font-variant-numeric: tabular-nums; }
.row .owed.zero { font-weight: 400; color: var(--text-3); }
.row .who { grid-column: 1 / -1; color: var(--text-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .line { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; }
.row .line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .strip { align-self: end; margin-bottom: 3px; }
.row[aria-selected="true"] { background: var(--inactive-sel); }
.row[aria-selected="true"]::after, .row[aria-selected="true"] + .row::before { opacity: 0; }
.listpane:focus-within .row[aria-selected="true"] { background: var(--accent); color: #fff; }
.listpane:focus-within .row[aria-selected="true"] :is(.lot small, .who, .line, .owed, .owed.zero) { color: rgba(255, 255, 255, .88); }
.listpane:focus-within .row[aria-selected="true"] .lot { color: #fff; }
.listpane:focus-within .row[aria-selected="true"] .d { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }

/* status dot and the six-month strip */
.d { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--up); }
.d.done { background: var(--ok); }
.d.overdue { background: var(--bad); }
.d.part, .d.confirm, .d.collected { background: var(--warn); }
.d.due { background: var(--due); }
.d.upcoming { background: transparent; box-shadow: inset 0 0 0 1.5px var(--up); }
.d.none { background: rgba(15, 23, 42, .12); width: 6px; height: 6px; margin: 1px; }
.strip { display: inline-flex; gap: 3px; align-items: center; }
.sidebar .st.overdue { color: var(--bad); }
.sidebar .st.collected { color: var(--warn); }
.sidebar .st.due { color: var(--due); }
.sidebar .st.done { color: var(--ok); }

.statusbar {
  height: 28px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); background: #fbfbfc;
  font-variant-numeric: tabular-nums;
}
.empty { padding: 48px 28px; text-align: center; color: var(--text-3); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- detail ---------- */
.detail { overflow-y: auto; min-width: 0; container-type: inline-size; }
.detail-in { max-width: 760px; padding: 26px 32px 40px; }
.d-head { display: flex; align-items: flex-start; gap: 16px; }
.d-head .t { flex: 1; min-width: 0; }
.back { display: none; }
.d-head h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.d-head h2 small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 8px; letter-spacing: 0; }
.d-head .tenant { margin: 4px 0 0; font-size: 15px; color: var(--text); }
.d-head .meta { margin: 3px 0 0; font-size: 13px; color: var(--text-3); }
.d-actions { display: flex; gap: 8px; flex: none; padding-top: 2px; }

.btn {
  height: 28px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--text);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .05);
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: #f6f7f9; }
.btn:active { background: #eceef1; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(10, 60, 140, .3); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { background: #074a9f; }
.btn .ico { width: 15px; height: 15px; background: currentColor; }

.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figs div { padding: 12px 16px 13px 0; }
.figs div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.figs dt { font-size: 12px; color: var(--text-3); margin: 0 0 2px; }
.figs dd { margin: 0; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.figs dd.bad { color: var(--bad-t); }
.figs dd small { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }

.sect { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 8px; }
.sect h3 { margin: 0; font-size: 13px; font-weight: 600; }
.sect p { margin: 0; font-size: 12px; color: var(--text-3); }
.group { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mrow {
  display: grid; grid-template-columns: 92px 1fr auto; align-items: center; column-gap: 14px;
  padding: 9px 14px; min-height: 48px; width: 100%;
  border: 0; background: #fff; text-align: left;
}
.mrow + .mrow { border-top: 1px solid var(--line); }
button.mrow:hover { background: #f7f8fa; }
.mrow .m { font-weight: 600; font-size: 13.5px; }
.mrow .m small { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); }
.mrow .s { display: grid; grid-template-columns: 8px 1fr; align-items: center; column-gap: 8px; font-size: 13.5px; min-width: 0; }
.mrow .s em { grid-column: 2; font-style: normal; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .a { text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mrow .a small { display: block; font-size: 12px; color: var(--text-3); }
.mrow .a .go { color: var(--accent); font-weight: 500; }
.t-done { color: var(--ok-t); }
.t-overdue { color: var(--bad-t); font-weight: 600; }
.t-part, .t-confirm, .t-collected { color: var(--warn-t); font-weight: 500; }
.t-due { color: var(--due-t); font-weight: 500; }
.t-upcoming { color: var(--text-2); }
.d-foot { margin-top: 18px; font-size: 12px; color: var(--text-3); }
.d-foot a { color: var(--accent); text-decoration: none; }
.d-foot a:hover { text-decoration: underline; text-underline-offset: 2px; }

@container (max-width: 620px) {
  .detail-in { padding: 20px 20px 32px; }
  .d-head { flex-direction: column; gap: 14px; }
  .d-head h2 { font-size: 22px; }
  .mrow { grid-template-columns: 78px 1fr auto; column-gap: 10px; padding: 9px 12px; }
  .figs div { padding-right: 10px; }
  .figs div + div { padding-left: 10px; }
}

/* ---------- months view (Finder list view) ---------- */
.window[data-view="months"] .listpane, .window[data-view="months"] .detail { display: none; }
.monthsview { grid-column: 1 / -1; overflow: auto; min-height: 0; }
.mtable { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.mtable th {
  position: sticky; top: 0; z-index: 2; background: #fff;
  height: 30px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--line-strong);
}
.mtable th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.mtable th button:hover { color: var(--text); }
.mtable th[aria-sort] button::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.mtable th[aria-sort="ascending"] button::after { border-top-color: transparent; border-bottom-color: currentColor; margin-top: -4px; }
.mtable td { height: 34px; padding: 0 12px; white-space: nowrap; }
.mtable tbody tr:nth-child(even) td { background: #f5f6f8; }
.mtable tbody tr:nth-child(odd) td { background: #fff; }
.mtable tbody tr:hover td { background: var(--accent-soft); }
.mtable .c-lot { position: sticky; left: 0; z-index: 1; font-weight: 600; }
.mtable th.c-lot { z-index: 3; }
.mtable tr.sizer { visibility: collapse; }   /* holds each column's longest text, so columns keep their width */
.mtable .c-end .etag { margin-left: 0; }
.mtable .c-who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.mtable .n { text-align: right; font-variant-numeric: tabular-nums; }
.mtable .bad { color: var(--bad-t); font-weight: 600; }
.mtable .cell { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.mtable .cell b { font-weight: 500; }
.mtable th.ahead { color: var(--due-t); }

/* ---------- sheet ---------- */
.sheet {
  width: min(520px, calc(100vw - 32px)); margin: 52px auto auto; padding: 0;
  border: 0; border-radius: 12px; background: #fff; color: var(--text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24), 0 2px 8px rgba(15, 23, 42, .12), 0 0 0 .5px rgba(15, 23, 42, .2);
  opacity: 1; transform: none;
  transition: opacity .2s var(--ease), transform .25s var(--ease), display .25s allow-discrete, overlay .25s allow-discrete;
}
.sheet:not([open]) { opacity: 0; transform: translateY(-14px); }
@starting-style { .sheet[open] { opacity: 0; transform: translateY(-14px); } }
.sheet::backdrop { background: rgba(15, 23, 42, .16); transition: background-color .2s, display .25s allow-discrete, overlay .25s allow-discrete; }
@starting-style { .sheet[open]::backdrop { background: rgba(15, 23, 42, 0); } }
.sheet form { padding: 22px 24px 18px; }
.sheet h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.sheet-who { margin: 2px 0 18px; font-size: 13px; color: var(--text-3); }
.form { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; align-items: center; }
.form > label, .form > .lbl { text-align: right; font-size: 13px; color: var(--text-2); }
.form input, .form select, .money {
  height: 30px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff;
  padding: 0 9px; font-size: 13.5px; min-width: 0; width: 100%;
  transition: box-shadow .15s, border-color .15s;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.money { display: flex; align-items: center; gap: 6px; padding: 0 0 0 9px; }
.money span { color: var(--text-3); font-size: 13px; }
.money input { border: 0; height: 28px; padding: 0 9px 0 0; box-shadow: none; font-variant-numeric: tabular-nums; }
.money:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.money input:focus { box-shadow: none; }
/* date box: "3 Dec 2026" on every PC, typed or picked from Agency's own calendar */
.datebox { position: relative; display: flex; flex-wrap: wrap; align-items: center; min-width: 0; }
.datebox .date-text { flex: 1; padding-right: 34px; font-variant-numeric: tabular-nums; }
.datebox.bad .date-text { border-color: var(--bad); }
.date-cal { position: absolute; right: 3px; top: 3px; width: 26px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 4px; background: transparent; color: var(--text-2); cursor: pointer; }
.date-cal:hover { background: var(--sunk); color: var(--text); }
.date-cal:focus-visible { outline: none; box-shadow: var(--ring); }
.date-msg { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--bad-t); }
.date-msg:empty { display: none; }
.cal { position: fixed; inset: auto; margin: 0; width: 256px; padding: 10px; border: 0; border-radius: 10px;
  background: #fff; color: var(--text); font: inherit;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .2), 0 1px 4px rgba(15, 23, 42, .12), 0 0 0 .5px rgba(15, 23, 42, .2); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font-size: 13.5px; font-weight: 600; }
.cal-nav { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; }
.cal-nav:hover:not(:disabled) { background: var(--sunk); color: var(--text); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid span { padding: 4px 0; text-align: center; font-size: 11px; color: var(--text-3); }
.cal-grid button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-grid button:hover:not(:disabled) { background: var(--sunk); }
.cal-grid button.today { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 600; }
.cal-grid button[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.cal-grid button:disabled { color: var(--text-3); opacity: .4; cursor: default; }
.cal-nav:focus-visible, .cal-grid button:focus-visible, .cal-foot button:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.cal-foot button { padding: 4px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg.small { justify-self: start; }
.seg.small button { height: 24px; padding: 0 10px; font-size: 12.5px; }
.sheet-note { margin: 16px 0 0 110px; font-size: 12px; color: var(--text-3); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1c1f24; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 9px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
}

/* ---------- narrower windows ---------- */
@media (max-width: 1180px) { .panes { grid-template-columns: 330px 1fr; } .searchbox { width: 180px; } }
@media (max-width: 900px) {
  .only-narrow { display: grid; }
  .panes { grid-template-columns: 1fr; }
  .listpane { border-right: 0; }
  .detail {
    position: absolute; inset: 0; background: #fff; z-index: 5;
    transform: translateX(100%); transition: transform .28s var(--ease); visibility: hidden;
  }
  .window.show-detail .detail { transform: none; visibility: visible; }
  .back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent); padding: 0; margin: 0 0 12px; font-size: 14px; }
  .detail-in { padding: 18px 18px 32px; }
}
@media (max-width: 600px) {
  .toolbar { gap: 8px; padding: 0 10px; flex-wrap: wrap; }
  .toolbar { padding-top: 8px; padding-bottom: 8px; height: auto; }
  .searchbox { order: 5; width: 100%; }
  .d-head { flex-direction: column; gap: 12px; }
  .figs { grid-template-columns: 1fr 1fr; }
  .figs div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .mrow { grid-template-columns: 76px 1fr auto; }
  .form { grid-template-columns: 1fr; gap: 4px; }
  .form > label, .form > .lbl { text-align: left; margin-top: 8px; }
  .sheet-note { margin-left: 0; }
}

/* ---------- shared pieces for the other pages ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .18); z-index: 15; }
.me-t { flex: 1; min-width: 0; }
.me-t b, .me-t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .local { color: var(--warn-t); font-weight: 500; }
.me form { margin: 0; }
.tb-icon .ico { background: var(--text-2); }
.src [data-only-if] { display: none; }
.src [data-only-if].has { display: list-item; }

.page { flex: 1; min-height: 0; overflow: auto; }
.page-in { max-width: 1120px; padding: 24px 32px 48px; }
.page-in.narrow { max-width: 820px; }
.lede { margin: 0 0 18px; max-width: 72ch; color: var(--text-2); font-size: 13.5px; }
.banner { flex: none; padding: 9px 20px; font-size: 13px; border-bottom: 1px solid var(--line); }
.banner.err { background: #fdf0f0; color: var(--bad-t); }
.mute { color: var(--text-3); }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); text-decoration: none; font-size: 13px; }
.crumb:hover { text-decoration: underline; text-underline-offset: 2px; }
.tools { display: flex; align-items: center; gap: 8px; }
.tools select, .tools input:not([type=search]) {
  height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; padding: 0 8px; font-size: 13px;
}
.tools select:focus, .tools input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* segmented radios inside forms (Paid by) */
.seg label { position: relative; display: inline-flex; }
.seg label input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg label span {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 5px;
  font-size: 12.5px; color: var(--text-2); transition: background-color .15s, box-shadow .15s, color .15s;
}
.seg label:hover span { color: var(--text); }
.seg label input:checked + span { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(15, 23, 42, .14), 0 0 0 .5px rgba(15, 23, 42, .08); }
.seg label input:focus-visible + span { box-shadow: var(--ring); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* the small menu a single click brings up in the Months view */
.menu {
  position: fixed; z-index: 30; min-width: 220px; padding: 5px; margin: 0;
  border: 0; border-radius: 9px; background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .2), 0 0 0 .5px rgba(15, 23, 42, .22);
  opacity: 1; transform: none; transition: opacity .12s, transform .15s var(--ease);
}
@starting-style { .menu:popover-open { opacity: 0; transform: scale(.97); } }
.menu .mh { padding: 6px 10px 6px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .mh b { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.menu .msep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }   /* Mark as … sits last, apart */
.menu .mfoot { padding: 6px 10px 4px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); margin-top: 4px; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px; border: 0; border-radius: 5px;
  background: none; text-align: left; font-size: 13px; color: var(--text); text-decoration: none;
}
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--accent); color: #fff; box-shadow: none; }
.menu .ico { width: 15px; height: 15px; background: currentColor; }
.mtable tbody tr.picked td { background: var(--accent-soft); }

/* month headings that sort */
.mtable th.sortable button::after { content: none; }
.mtable th[aria-sort] button::after { content: ""; }

/* Finder-style table used by Staff, Audit log and the dashboard's list */
.ftable { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.ftable th {
  position: sticky; top: 0; z-index: 1; background: #fff; height: 30px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line-strong);
}
.ftable td { padding: 8px 12px; vertical-align: top; }
.ftable tbody tr:nth-child(even) td { background: #f5f6f8; }
.ftable .n { text-align: right; font-variant-numeric: tabular-nums; }
.ftable .nowrap { white-space: nowrap; }
.ftable .lot { font-weight: 600; white-space: nowrap; }
.ftable a { color: var(--text); text-decoration: none; }
.ftable a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ftable .bad { color: var(--bad-t); font-weight: 600; }
/* Rent received: payments by month received, each month ending in its total */
.rcv { padding: 0 0 40px; }
.rcv-sum { margin: 0; padding: 12px 16px 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rtable tbody tr:nth-child(even) td { background: none; }
.rtable tbody tr[data-row]:hover td { background: var(--sunk); }
.rtable tbody tr[data-row] td { border-bottom: 1px solid var(--line); }
.rtable .rmonth th { position: sticky; top: 30px; z-index: 1; height: 34px; padding: 0 12px; text-align: left; background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line-strong); }
.rtable .rtotal td { padding: 9px 12px 22px; font-weight: 600; border-top: 1px solid var(--line-strong); }
.rtable .rtotal .mute { font-weight: 400; }
/* Rent received: a table per month with the same columns; a month off screen is skipped until it scrolls near */
.rtable { table-layout: fixed; }
.rtable td { overflow: hidden; text-overflow: ellipsis; }
.rtable .c-date { width: 118px; } .rtable .c-lot { width: 180px; } .rtable .c-amt { width: 110px; }
.rtable .c-for { width: 290px; } .rtable .c-inv { width: 130px; }
.rhead { position: sticky; top: 0; z-index: 2; }
.rhead th { position: static; }
.rmon { content-visibility: auto; }
.rmon .rmonth th { top: 30px; }
/* when Agency last took in SQL Account, above Dashboard (a version note) */
/* a request waiting for the admin; the Requests page */
.reqline { color: var(--warn-t); }
.reqs { padding: 0 0 40px; }
.reqs-h { margin: 18px 16px 6px; font-size: 13px; font-weight: 600; }
.reqact { display: flex; gap: 6px; align-items: center; }
.reqact input { height: 26px; width: 150px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 12.5px; }
.ok-t { color: var(--ok-t); }
.reqs .ctext { white-space: pre-wrap; max-width: 520px; }
.reqs tr.cread td { color: var(--text-3); }
.sheet textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; font-size: 13px; resize: vertical; }
.sheet textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.synced { margin: -8px 0 2px; padding: 0 18px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.empty-row { padding: 36px 12px; text-align: center; color: var(--text-3); }

/* tenancy page */
.tpage .d-head { margin-top: 12px; }
.mlist { display: grid; gap: 10px; }
.mcard { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; scroll-margin-top: 16px; }
.mcard > header { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; column-gap: 14px; padding: 10px 14px; }
.mcard:target { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.mcard .m { font-weight: 600; font-size: 13.5px; }
.mcard .m small { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); }
.mcard .s { display: grid; grid-template-columns: 8px 1fr; align-items: center; column-gap: 8px; font-size: 13.5px; }
.mcard .s em { grid-column: 2; font-style: normal; color: var(--text-3); font-size: 12px; }
.mcard .acts { display: flex; gap: 6px; }
.mcard table { width: 100%; border-collapse: collapse; font-size: 12.5px; border-top: 1px solid var(--line); }
.mcard th { text-align: left; font-weight: 600; color: var(--text-3); padding: 6px 14px; background: #fafbfc; font-size: 12px; }
.mcard td { padding: 6px 14px; border-top: 1px solid var(--line); }
.mcard .n { text-align: right; font-variant-numeric: tabular-nums; }
.btn.small { height: 24px; padding: 0 9px; font-size: 12.5px; }

/* dashboard */
.dgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.dgroup { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 14px; }
.dgroup h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.dgroup h2 a { color: var(--text); text-decoration: none; }
.dgroup h2 a:hover { color: var(--accent); }
.dgroup h2 span { font-weight: 400; font-size: 12px; color: var(--text-3); }
.dmonth { display: grid; grid-template-columns: 1fr auto; row-gap: 5px; margin-bottom: 14px; font-size: 13px; }
.dmonth b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dmonth .r { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dbar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #e9ecf0; overflow: hidden; }
.dbar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.dmonth small { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; }
.dtrend { width: 100%; height: auto; display: block; margin-top: 4px; }
.dtrend .axis { stroke: var(--line-strong); }
.dtrend .exp { fill: #d5dae2; }
.dtrend .col { fill: var(--ok); }
.dtrend .hit { fill: transparent; }
.dtrend g:hover .hit { fill: rgba(15, 23, 42, .04); }
.dtrend text { font: 11px var(--font); fill: var(--text-3); }
.dtrend .val { fill: var(--text-2); font-weight: 600; }
.dlegend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.dlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
details.more { margin-top: 8px; font-size: 12.5px; }
details.more summary { color: var(--accent); cursor: default; }
details.more table { margin-top: 6px; }
.sub-h { margin: 28px 0 8px; font-size: 13px; font-weight: 600; }

/* sign-in (local copy) */
.signin { min-height: 100vh; display: grid; place-items: center; background: var(--side); padding: 24px; }
.signin-box { width: min(420px, 100%); background: #fff; border-radius: 14px; padding: 28px 24px 20px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .14), 0 0 0 .5px rgba(15, 23, 42, .14); }
.signin-box .brand { height: auto; padding: 0; font-size: 18px; }
.signin-box p { margin: 10px 0 18px; font-size: 13px; color: var(--text-3); }
.signin-box { display: flex; flex-direction: column; }
.signin-box label { margin: 10px 0 4px; font-size: 13px; color: var(--text-2); }
.signin-box input { height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; font-size: 14px; }
.signin-box input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.signin-box .btn { margin-top: 18px; height: 34px; justify-content: center; }
.signin-box .banner { margin: 0 0 4px; border-radius: 7px; }
.signin-box .fine { margin: 14px 0 0; font-size: 12px; }
a.me-t { color: inherit; text-decoration: none; border-radius: 6px; }
a.me-t:hover b { color: var(--accent); }
.card-form { max-width: 520px; padding: 18px 20px; margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.card-form h3 { margin: 0 0 14px; font-size: 14px; }
.form .check { display: flex; align-items: center; gap: 8px; font-size: 13px; text-align: left; }
.form .check input { width: auto; height: auto; }
[data-teamrow][hidden], [data-editrow][hidden], [data-rorow][hidden], [data-dashrow][hidden] { display: none !important; }

@media (max-width: 900px) {
  .page-in { padding: 18px 18px 36px; }
  .dgroups { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mcard > header { grid-template-columns: 1fr auto; row-gap: 6px; }
  .mcard .acts { grid-column: 1 / -1; }
  .tools { width: 100%; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition: none !important; } }

/* ---------- folding side menu, top scroll bar ---------- */
.monthsview { display: flex; flex-direction: column; }
.monthsview[hidden] { display: none; }
.mscroll { flex: 1; min-height: 0; overflow: auto; }
.scroll-top { flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: auto; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.scroll-top[hidden] { display: none; }
.scroll-top div { height: 1px; }
.mtable tbody tr { cursor: default; }
.mtable tbody tr:focus-visible td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.mtable tbody tr:focus-visible { outline: none; box-shadow: none; }
.window[data-view="list"] .monthsview { display: none; }

/* the top scroll bar: a slim rounded thumb on a quiet track, like a Mac overlay scroller.
   Chromium only honours the ::-webkit rules when the standard scrollbar properties are left at auto. */
.scroll-top {
  height: 14px; padding: 0 6px; border-bottom: 0; background: #fff;
  scrollbar-width: auto; scrollbar-color: auto;
  box-shadow: inset 0 -1px 0 var(--line);
}
.scroll-top::-webkit-scrollbar { height: 14px; }
.scroll-top::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.scroll-top::-webkit-scrollbar-track { background: linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat; margin: 0 6px; }
.scroll-top::-webkit-scrollbar-thumb {
  background-color: rgba(15, 23, 42, .26); border-radius: 999px;
  border: 4px solid transparent; background-clip: padding-box; min-width: 48px;
}
.scroll-top:hover::-webkit-scrollbar-thumb { background-color: rgba(15, 23, 42, .42); border-width: 3px; }
.scroll-top::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
@supports not selector(::-webkit-scrollbar) {
  .scroll-top { scrollbar-width: thin; scrollbar-color: rgba(15, 23, 42, .3) transparent; }
}

/* ---------- dashboard: due and collected by type, and the calendar ---------- */
.dsec { margin-top: 26px; }
.dsec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.dsec-h h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.seg.small button { height: 24px; padding: 0 10px; font-size: 12.5px; }
.dpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 12px; }
.dcard h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dcard svg { display: block; width: 100%; height: auto; overflow: visible; }
.dcard svg text { font: 12px var(--font); fill: var(--text-2); }
.dcard svg .lab { fill: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dcard svg .sub { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dcard svg .got-t { fill: var(--ok-t); }
.dcard svg .grid { stroke: var(--line); }
.dcard svg .axis { stroke: var(--line-strong); }
.dcard .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.dcard .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.dnote { margin: 12px 0 0; font-size: 12.5px; color: var(--text-3); }   /* as wide as the charts above it */
.figs dd small a { color: var(--accent); text-decoration: none; }
.figs dd small a:hover { text-decoration: underline; }
.tip { position: fixed; pointer-events: none; z-index: 40; background: #1c1f24; color: #fff; font-size: 12px; line-height: 1.5;
  padding: 7px 10px; border-radius: 7px; box-shadow: 0 6px 18px rgba(15, 23, 42, .25); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .dpair { grid-template-columns: 1fr; } }
[data-endrow][hidden] { display: none !important; }
