/* Dwell Manager — 2026-10 redesign.
   Calm light shell, one accent colour for actions, red only for problems. */
:root {
  --accent: #2952cc; --accent-h: #1f40a8; --accent-soft: #eef2ff; --accent-ring: rgba(41,82,204,.22);
  --red: #c8281e; --red-soft: #fdecea; --green: #0b7a43; --green-soft: #e6f6ec;
  --amber: #a15c07; --amber-soft: #fff4e0; --blue: #2952cc; --blue-soft: #eef2ff;
  --black: #111827; --ink: #111827; --ink2: #374151; --muted: #6b7280; --faint: #9ca3af;
  --border: #e5e7eb; --border2: #d1d5db; --soft: #f3f4f6; --bg: #f7f8fa; --card: #ffffff;
  --side: #ffffff; --sidew: 248px; --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: Inter, -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ APP SHELL: SIDEBAR ============ */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidew);
  background: var(--side); color: var(--ink2); display: flex; flex-direction: column;
  z-index: 50; border-right: 1px solid var(--border); }
body.has-sidebar .wrap { margin-left: var(--sidew); max-width: none; padding: 22px 32px 40px; }
body.has-sidebar .wrap > * { max-width: 1240px; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; }
.sb-brand .brandmark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sb-brand .brandmark svg.ic { width: 18px; height: 18px; stroke-width: 2; }
.sb-brand .brandlogo { height: 32px; max-width: 120px; width: auto; display: block;
  border-radius: 6px; }
.sb-biz { min-width: 0; }
.sb-biz b { display: block; color: var(--ink); font-size: 14.5px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-biz span { font-size: 11.5px; color: var(--muted); }

/* workspace switcher */
.sb-ws { position: relative; padding: 4px 12px 8px; }
.sb-wsbtn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; color: var(--ink); }
.sb-wsbtn:hover { background: #eceef2; }
.sb-wsbtn[disabled] { cursor: default; opacity: 1; }
.sb-wsbtn[disabled]:hover { background: var(--soft); }
.sb-wsbtn .wsdot { width: 30px; height: 30px; border-radius: 8px; background: #fff;
  border: 1px solid var(--border); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; color: var(--accent); flex: none; }
.sb-wsbtn .wst { flex: 1; min-width: 0; }
.sb-wsbtn .wst small { display: block; font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; }
.sb-wsbtn .wst b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.sb-wsbtn .ic { color: var(--muted); width: 16px; height: 16px; }
.sb-wsmenu { display: none; position: absolute; left: 12px; right: 12px; top: calc(100% - 4px);
  background: #fff; border: 1px solid var(--border); border-radius: 12px; z-index: 80;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow-y: auto; }
.sb-wsmenu.open { display: block; }
.sb-wsmenu .wsh { font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .5px; padding: 6px 8px 4px; }
.sb-wsmenu input { width: 100%; margin: 2px 0 6px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; font-size: 13px; }
.wsitem { display: flex; width: 100%; align-items: center; gap: 8px; text-align: left;
  border: none; background: none; padding: 8px; border-radius: 8px; font-size: 13.5px; }
.wsitem:hover { background: var(--soft); }
.wsitem.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.wsitem small { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.wsmanage { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border);
  margin-top: 4px; padding: 9px 8px 5px; font-size: 13px; color: var(--accent);
  text-decoration: none; font-weight: 600; }

.sb-new { margin: 4px 12px 8px; padding: 9px 12px; background: var(--accent);
  border: none; color: #fff; font-weight: 600; font-size: 13.5px; border-radius: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sb-new:hover { background: var(--accent-h); }
.sb-new svg.ic { width: 16px; height: 16px; stroke-width: 2.2; }
.sb-search { position: relative; padding: 0 12px 6px; }
.sb-search input { width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px 8px 32px;
  font: inherit; font-size: 13px; }
.sb-search .ic { position: absolute; left: 22px; top: 9px; width: 15px; height: 15px;
  color: var(--faint); pointer-events: none; }
.sb-search input::placeholder { color: var(--faint); }
.sb-search input:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring); }
.sb-results { display: none; position: absolute; left: 12px; right: 12px; top: 100%;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; z-index: 70;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 320px; overflow-y: auto; }
.sb-results a { display: flex; gap: 9px; align-items: center; padding: 9px 11px;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border); }
.sb-results a:last-child { border-bottom: none; }
.sb-results a:hover { background: var(--soft); }
.sb-results a span { font-size: 15px; flex: none; }
.sb-results a b { display: block; font-size: 13px; }
.sb-results a small { color: var(--muted); font-size: 11.5px; display: block; }
.sb-results .noresult { padding: 10px 12px; color: var(--muted); font-size: 12.5px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 10px; scrollbar-width: thin; }
.navsec { font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--faint); padding: 14px 10px 5px; }
.sidelink { display: flex; align-items: center; gap: 11px; color: var(--ink2);
  text-decoration: none; font-size: 14px; padding: 9px 10px; border-radius: 9px;
  margin-bottom: 2px; font-weight: 500; }
.sidelink .ni { display: inline-flex; color: var(--muted); }
.sidelink:hover { background: var(--soft); color: var(--ink); }
.sidelink.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidelink.active .ni { color: var(--accent); }
.sidelink .nc { margin-left: auto; background: var(--red); color: #fff; font-size: 11px;
  font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.sb-foot { border-top: 1px solid var(--border); padding: 10px 12px 12px; }
.sb-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
#notifyBell { cursor: pointer; display: inline-flex; align-items: center; color: var(--muted);
  padding: 4px; border-radius: 6px; }
#notifyBell:hover { background: var(--soft); color: var(--ink); }
.sb-user { display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 12.5px; color: var(--muted); }
.sb-user .uav { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; flex: none; font-size: 12px; }
.sb-user .uname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 500; }
.sb-user .uname small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.sb-user a { color: var(--ink2); cursor: pointer; text-decoration: underline; white-space: nowrap; }
#syncBadge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  background: var(--soft); color: var(--muted); white-space: nowrap; border: 1px solid var(--border); }
#syncBadge.ok { background: var(--green-soft); color: var(--green); border-color: #c6ebd4; }
#syncBadge.err { background: var(--red-soft); color: var(--red); border-color: #f6c9c5; }

/* section tabs (pages that belong together) */
.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: -4px 0 22px;
  overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
  margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.subnav .snlabel { padding: 10px 14px 10px 0; font-size: 13.5px; font-weight: 700;
  color: var(--ink); white-space: nowrap; margin-right: 6px; border-right: 1px solid var(--border); }

/* mobile top bar (hidden on desktop) */
.mobilebar { display: none; position: sticky; top: 0; z-index: 45;
  background: #fff; color: var(--ink); align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); }
.mobilebar button { background: var(--soft); color: var(--ink); border: 1px solid var(--border);
  padding: 7px 10px; border-radius: 9px; cursor: pointer; display: inline-flex; }
.mobilebar #mbNew { background: var(--accent); color: #fff; border-color: var(--accent); }
.mobilebar .mb-title { flex: 1; font-weight: 700; font-size: 15px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mobilebar .mb-title small { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.sb-scrim { display: none; }

/* ---- topbar (tenant/owner portals & public pages) ---- */
.topbar { position: sticky; top: 0; z-index: 40; background: #fff; color: var(--ink);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 18px; padding: 0 20px; height: 58px; }
.topbar .brand { font-weight: 800; font-size: 15px; color: var(--ink); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; }
.topbar .brand span { color: var(--accent); }
.topbar .brand .brandlogo { height: 32px; max-width: 150px; width: auto; display: block;
  border-radius: 5px; }
.topbar .brand .brandname { color: var(--ink); font-size: 14.5px; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: var(--muted); font-size: 13.5px; padding: 7px 11px; border-radius: 8px;
  text-decoration: none; font-weight: 500; }
.topbar nav a:hover { background: var(--soft); color: var(--ink); }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar .user { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.topbar .user a { color: var(--ink2); cursor: pointer; text-decoration: underline; }

/* trial / notice strip */
#rmTrialBar { background: var(--amber-soft); color: #6b4e00; padding: 7px 14px; font-size: 13px;
  text-align: center; border-bottom: 1px solid #f3d9a4; }
body.has-sidebar #rmTrialBar { margin-left: var(--sidew); }
#rmTrialBar a { color: #6b4e00; font-weight: 700; }

/* ---- layout ---- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 23px; letter-spacing: -.3px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; max-width: 760px; }
.page-head .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---- cards / stats ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; overflow-x: auto; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; margin-bottom: 12px; font-weight: 650; display: flex;
  align-items: center; gap: 8px; }
.card h2 .h2r { margin-left: auto; font-weight: 400; }
.card.flat { box-shadow: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat.bad { box-shadow: inset 3px 0 0 var(--red), var(--shadow); }
.stat.good { box-shadow: inset 3px 0 0 var(--green), var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

/* quick actions (dashboard) */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px;
  margin-bottom: 20px; }
.qa { display: flex; align-items: center; gap: 11px; text-align: left; padding: 12px 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.qa:hover { border-color: var(--accent); background: #fff; }
.qa .qi { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.qa b { display: block; font-size: 13.5px; font-weight: 600; }
.qa small { display: block; font-size: 12px; color: var(--muted); }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 9px 10px; border-bottom: 1px solid var(--border); background: #fafbfc;
  cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--ink); }
th.num { text-align: right; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #fafbfc; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 22px 10px; font-size: 13.5px; text-align: center; }
small.dim, .dim { color: var(--muted); }

/* ---- badges / buttons ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-green { background: var(--green-soft); color: var(--green); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-gray { background: var(--soft); color: var(--muted); }
.b-blue { background: var(--blue-soft); color: var(--blue); }

button, .button { font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--border2);
  background: #fff; color: var(--ink); padding: 7px 14px; font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  text-decoration: none; line-height: 1.3; }
button:hover, .button:hover { background: var(--soft); }
button[disabled] { opacity: .55; cursor: not-allowed; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: #f2b8b2; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--soft); }
button.small, .button.small { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.actions { white-space: nowrap; text-align: right; }
td.actions button + button, td.actions button + a, td.actions a + button { margin-left: 6px; }
@media (pointer: coarse) {
  button.small { min-height: 40px; padding: 8px 12px; }
  .actions { gap: 6px; }
}
.linklike { background: none; border: none; padding: 0; margin: 0; color: inherit;
  font: inherit; cursor: pointer; text-decoration: underline; border-radius: 3px; display: inline; }
.linklike:hover { background: none; }
.sb-user .linklike { color: var(--ink2); white-space: nowrap; font-size: 12.5px; }
.ferr { color: var(--red); font-size: 12px; margin-top: 4px; }
[aria-invalid="true"] { border-color: var(--red) !important; }
.searchbox, input.searchbox, select.searchbox { padding: 8px 12px; border: 1px solid var(--border2);
  border-radius: 9px; font: inherit; font-size: 13.5px; width: 220px; background: #fff; color: var(--ink); }
.searchbox:focus { border-color: var(--accent); outline: none; }
.searchbox:focus-visible, .modal input:focus-visible, .modal select:focus-visible,
.modal textarea:focus-visible, button:focus-visible, .button:focus-visible,
.linklike:focus-visible, th:focus-visible, a:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.flabel { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--ink2); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ---- segmented toggle ---- */
.segwrap { display: flex; gap: 6px; margin: 2px 0 6px; }
.seg { flex: 1; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--border2);
  background: #fff; font-size: 13px; }
.seg.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
  font-weight: 600; }

/* choice cards (radio-style) */
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px;
  border: 1px solid var(--border2); border-radius: 10px; cursor: pointer; background: #fff;
  font-weight: 400 !important; margin: 0 !important; }
.choice:hover { border-color: var(--accent); }
.choice input { width: auto !important; margin-top: 3px; accent-color: var(--accent); }
.choice b { display: block; font-size: 13.5px; }
.choice small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---- triple-net live calculation box ---- */
.nnnbox { background: var(--soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; margin-top: 10px; font-size: 13px; }
.nnnrow { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.nnnrow span { color: var(--muted); }
.nnnrow.tot { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-size: 14px; }
.nnnrow.tot b { color: var(--accent); }

/* ---- "+ New" quick-create menu ---- */
.newmenu h3 { margin-bottom: 4px; }
.newmenu .nmsub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.newgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.newgrp { grid-column: 1 / -1; font-size: 11.5px; color: var(--faint); text-transform: uppercase;
  letter-spacing: .5px; margin-top: 6px; }
.newitem { display: flex; width: 100%; align-items: center; gap: 12px; text-align: left;
  padding: 11px 12px; border-radius: 10px; justify-content: flex-start; }
.newitem:hover { background: var(--soft); border-color: var(--border2); }
.newitem.hero { grid-column: 1 / -1; border-color: var(--accent); background: var(--accent-soft); }
.newitem .nmi { font-size: 20px; width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--soft);
  color: var(--accent); }
.newitem.hero .nmi { background: var(--accent); color: #fff; }
.newitem .nmt b { display: block; font-size: 13.5px; }
.newitem .nmt small { color: var(--muted); font-size: 12px; font-weight: 400; }
@media (max-width: 520px) { .newgrid { grid-template-columns: 1fr; } }

/* ---- in-page tabs ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border-radius: 999px; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none; }
.ptabs button { border: none; background: none; border-radius: 0; padding: 10px 14px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; }
.ptabs button:hover { background: none; color: var(--ink); }
.ptabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ptabs .pc { background: var(--soft); color: var(--muted); border-radius: 999px; font-size: 11px;
  padding: 0 7px; font-weight: 600; }
.ptabs button.on .pc { background: var(--accent-soft); color: var(--accent); }
.ptabs .pc.alert { background: var(--red); color: #fff; }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); color: #1e3a8a; font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid #d8e0fb; }
.callout.warn { background: var(--amber-soft); color: #6b4e00; border-color: #f3d9a4; }
.callout.bad { background: var(--red-soft); color: #7a1a13; border-color: #f6c9c5; }
.callout.ok { background: var(--green-soft); color: #0a5530; border-color: #c6ebd4; }
.callout .cbody { flex: 1; min-width: 0; }
.callout .cbody b { display: block; margin-bottom: 2px; }

details.adv { border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  margin-bottom: 18px; }
details.adv > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::after { content: '▸'; margin-left: auto; color: var(--muted); }
details.adv[open] > summary::after { content: '▾'; }
details.adv > summary small { font-weight: 400; color: var(--muted); }
details.adv > .advbody { padding: 0 18px 16px; }
details.adv .card { box-shadow: none; }

/* person / workspace rows */
.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); }
.prow:last-child { border-bottom: none; }
.prow .pav { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: none; }
.prow .pmain { flex: 1; min-width: 0; }
.prow .pmain b { font-size: 14px; }
.prow .pmain small { display: block; color: var(--muted); font-size: 12.5px; }
.prow .pchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.prow .pact { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.wsgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.wscard { background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.wscard.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.wscard .wsh { display: flex; align-items: flex-start; gap: 10px; }
.wscard .wsh b { font-size: 15px; display: block; }
.wscard .wsh small { color: var(--muted); font-size: 12px; }
.wscard .wsm { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.wscard .wsm b { color: var(--ink); font-size: 14px; display: block; }
.wscard .wsa { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.wscard.new { align-items: center; justify-content: center; border-style: dashed;
  color: var(--accent); font-weight: 600; cursor: pointer; min-height: 150px; box-shadow: none; }
.wscard.new:hover { background: var(--accent-soft); }

/* wizard steps */
.wsteps { display: flex; gap: 6px; margin-bottom: 14px; }
.wsteps span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.wsteps span.on { background: var(--accent); }
.wslist { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.wsline { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); font-size: 13.5px; }
.wsline:last-child { border-bottom: none; }
.wsline span { flex: 1; min-width: 0; }
.wsline select { width: auto !important; min-width: 170px; }

/* ---- modal ---- */
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex;
  align-items: flex-start; justify-content: center; padding: 50px 16px; z-index: 60; }
.modal { background: #fff; border-radius: 16px; width: 520px; max-width: 100%;
  padding: 24px; max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 17px; margin-bottom: 14px; font-weight: 700; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--ink2); }
.modal input, .modal select, .modal textarea { width: 100%; padding: 9px 11px;
  border: 1px solid var(--border2); border-radius: 9px; font: inherit; font-size: 14px; background: #fff; }
.modal input[type=checkbox], .modal input[type=radio] { width: auto; accent-color: var(--accent); }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.modal .row { flex-wrap: wrap; }
.modal .tablescroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.note-item { border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 13.5px; }

/* ---- print/agreement overlay ---- */
.pa-overlay { position: fixed; inset: 0; z-index: 80; background: #525659;
  display: flex; flex-direction: column; }
.pa-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: #1c2742; color: #fff; padding: 10px 14px; flex-wrap: wrap; }
.pa-bar .pa-ttl { font-size: 13.5px; font-weight: 600; color: #e7cf72;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.pa-bar .pa-act { display: flex; gap: 8px; align-items: center; }
.pa-bar button { padding: 9px 16px; border: none; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.pa-bar .pa-print { background: var(--accent); color: #fff; }
.pa-bar .pa-print:hover { background: var(--accent-h); }
.pa-bar .pa-close { background: rgba(255,255,255,.14); color: #fff; }
.pa-bar .pa-close:hover { background: rgba(255,255,255,.26); }
.pa-bodywrap { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; }
.pa-frame { width: 100%; height: 100%; min-height: 100%; border: 0; background: #eef0f4; }
@media (max-width: 760px) {
  .pa-bar { padding: 8px 10px; }
  .pa-bar .pa-ttl { flex-basis: 100%; max-width: 100%; margin-bottom: 2px; }
  .pa-bar .pa-act { width: 100%; }
  .pa-bar .pa-act button { flex: 1 1 auto; padding: 11px 10px; }
}
@media print {
  .topbar, .sidebar, .mobilebar, .toast, .pa-bar, .subnav, #rmTrialBar { display: none !important; }
  body.has-sidebar .wrap { margin-left: 0; }
  .pa-overlay { position: static; background: #fff; }
}

/* ---- dashboard attention list ---- */
.attlist { display: flex; flex-direction: column; }
.attitem { display: flex; align-items: center; gap: 12px; padding: 11px 6px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); border-radius: 8px; }
.attitem:last-child { border-bottom: none; }
.attitem:hover { background: var(--soft); }
.attitem .atticon { font-size: 18px; flex: none; width: 26px; text-align: center; }
.attitem .atttext { flex: 1; font-size: 13.5px; min-width: 0; }
.attitem .attgo { color: var(--faint); font-size: 22px; flex: none; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px; font-size: 13.5px; z-index: 99;
  box-shadow: var(--shadow-lg); animation: fadein .2s; max-width: 420px; }
.toast .undo { background: #fff; color: var(--ink); border: none; border-radius: 6px;
  padding: 4px 12px; margin-left: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ---- move-in completion screen ---- */
.mistep { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); }
.mistep:last-of-type { border-bottom: none; }
.mistep .misicon { font-size: 20px; width: 28px; text-align: center; flex: none; }
.mistep .mistext { flex: 1; min-width: 0; }
.mistep .mistext b { display: block; font-size: 13.5px; }
.mistep .mistext small { display: block; color: var(--muted); font-size: 12px; }
.mistep .mistext .misnote { color: var(--amber); }
.mistep button { flex: none; }

/* ---- dashboard setup checklist ---- */
.setuplist { display: flex; flex-direction: column; }
.setupitem { display: flex; align-items: center; gap: 11px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: 13.5px; }
.setupitem:last-child { border-bottom: none; }
.setupitem .st-ic { width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--soft); color: var(--muted); font-weight: 700; border: 1px solid var(--border); }
.setupitem.done .st-ic { background: var(--green-soft); color: var(--green); border-color: #c6ebd4; }
.setupitem.done span.st-t { color: var(--muted); text-decoration: line-through; }
.setupitem a { color: var(--accent); cursor: pointer; text-decoration: none;
  margin-left: auto; white-space: nowrap; font-size: 13px; font-weight: 600; }
.setupbar { height: 6px; background: var(--soft); border-radius: 4px; overflow: hidden; margin: 4px 0 10px; }
.setupbar div { height: 100%; background: var(--green); }

/* ---- login ---- */
.loginwrap { max-width: 400px; margin: 80px auto; padding: 0 16px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ---- tenant portal: how to pay + occupants ---- */
.paybox { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 4px; }
.payrow { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.payrow:last-of-type { border-bottom: none; }
.paylabel { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.payval { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-word; }
.payval b { font-size: 15px; }
.paynote { padding: 10px 14px; background: var(--soft); font-size: 13px; color: var(--ink); }
.occlist { list-style: none; margin: 8px 0 0; padding: 0; }
.occlist li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.occlist li:last-child { border-bottom: none; }

/* ---- full-screen agreement signing sheet ---- */
.sign-overlay { padding: 0; align-items: stretch; justify-content: center; }
.sign-sheet { background: #eef0f4; width: 100%; max-width: 920px; height: 100%;
  display: flex; flex-direction: column; }
.sign-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: #1c2742; color: #fff; padding: 11px 16px; }
.sign-bar .sign-ttl { font-size: 14px; font-weight: 600; color: #e7cf72;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-bar .sign-x { background: rgba(255,255,255,.14); color: #fff; border: none;
  padding: 9px 15px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.sign-bar .sign-x:hover { background: rgba(255,255,255,.26); }
.sign-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; }
.sign-frame { width: 100%; border: 0; background: #fff; border-radius: 10px;
  box-shadow: 0 2px 16px rgba(20,30,60,.12); display: block; min-height: 300px; }
.sign-form { background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-top: 16px; max-width: 800px; margin-left: auto; margin-right: auto; }
.sign-form .btns { position: sticky; bottom: 0; }

/* ============ MOBILE ============ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease;
    width: 280px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sb-scrim, .sb-scrim.on { display: block; position: fixed; inset: 0;
    background: rgba(17,24,39,.35); z-index: 49; }
  body.has-sidebar .wrap { margin-left: 0; padding: 14px 14px 32px; }
  body.has-sidebar #rmTrialBar { margin-left: 0; }
  .mobilebar { display: flex; }
  .subnav { margin: -2px -14px 16px; padding: 0 8px; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; gap: 8px; }
  .topbar .brand { font-size: 14px; }
  .topbar .user { font-size: 12px; }
  .topbar nav { flex-basis: 100%; gap: 4px; }
  .wrap { padding: 14px 12px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head h1 { font-size: 20px; }
  .page-head .right { width: 100%; }
  .page-head .right .searchbox { flex: 1 1 140px; width: auto; min-width: 0; }
  .page-head .right button { flex: 0 0 auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 20px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .card { padding: 14px; border-radius: 10px; }
  .grid2 { gap: 12px; }
  table { font-size: 13px; }
  th, td { padding: 8px; }
  .modal { padding: 18px; border-radius: 14px; }
  .modal .row > div { flex: 1 1 100%; }
  .overlay { padding: 12px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  button.small { padding: 6px 10px; }
  td.actions button.small { margin-bottom: 3px; }
  .prow { flex-wrap: wrap; }
  .prow .pact { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .payrow { flex-direction: column; align-items: flex-start; gap: 4px; }
  .payval { font-size: 16px; width: 100%; justify-content: space-between; }
  .payval b { font-size: 16px; }
  .payrow .button, .payval button.small { padding: 8px 12px; }
  .sign-scroll { padding: 10px; }
  .sign-form { padding: 14px; }
  #sgpad { height: 180px !important; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .qa small { display: none; }
}

/* ============ UTILITIES ============ */
.w100 { width: 100%; }
.f1, .modal .row > div.f1 { flex: 1; }
.frow { display: flex; gap: 12px; }
.frow10 { display: flex; gap: 10px; }
.cardnote { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; line-height: 1.55; }
.cardnarrow { max-width: 560px; }
.mt12 { margin-top: 12px; }
.mt14 { margin-top: 14px; }
.subtle { font-weight: 400; color: var(--muted); }
.fs125 { font-size: 12.5px; }
.hide { display: none !important; }
button.qa { justify-content: flex-start; font-weight: 400; }
.modal label.choice, .modal label.wsline { display: flex; }
.modal .choice input, .modal .wsline input { flex: none; }
.wsline input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
/* compact per-row "⋯" menu (row actions) */
.rowmenu { position: relative; display: inline-block; vertical-align: middle; }
.rowmenu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center;
  padding: 3px 10px; font-size: 13px; line-height: 1.4; font-weight: 700; color: var(--ink2);
  border: 1px solid var(--border2); border-radius: 8px; background: #fff; }
.rowmenu summary::-webkit-details-marker { display: none; }
.rowmenu summary:hover, .rowmenu[open] summary { background: var(--soft); }
.rowmenu .mitems { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  min-width: 170px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; text-align: left; }
.rowmenu .mitems button, .rowmenu .mitems a { display: flex; width: 100%; justify-content: flex-start;
  text-align: left; margin: 1px 0; white-space: nowrap; border-color: transparent; background: none; }
.rowmenu .mitems button:hover, .rowmenu .mitems a:hover { background: var(--soft); }
.rowmenu .mitems button.danger { border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
.rowmenu.up .mitems { top: auto; bottom: calc(100% + 4px); }
td.actions .rowmenu { margin-left: 6px; }
@media (max-width: 900px) { .subnav .snlabel { display: none; } }
/* properties page: one card per property with its units inside */
.propcard { padding: 14px 18px; }
.pchead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pctoggle { width: 30px; padding: 4px 0; font-size: 14px; color: var(--muted); }
.pctitle { flex: 1 1 260px; min-width: 0; }
.pctitle b { font-size: 16px; }
.pctitle small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pcstats { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pcstats b { color: var(--ink); font-size: 13.5px; }
.pcact { display: flex; align-items: center; }
.pcunits { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 4px; overflow-x: auto; }
.pcunits th { background: none; }
@media (max-width: 760px) { .pcact { width: 100%; justify-content: flex-start; } }

/* ================= audit fixes (Oct 2026) ================= */
/* Width helpers beat the default 220px search-box width. */
input.w100, select.w100, textarea.w100, .searchbox.w100 { width: 100%; }
/* One visible focus ring everywhere (keyboard users). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.searchbox:focus-visible, .modal input:focus-visible, .modal select:focus-visible,
.modal textarea:focus-visible, button:focus-visible, .button:focus-visible,
.linklike:focus-visible, th:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
/* Tabs: same accent style as the rest of the app. */
.tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
/* Readable small text and form borders (WCAG contrast). */
.navsec, .newgrp { color: var(--muted); }
.b-gray { color: var(--ink2); }
input, select, textarea, .searchbox { border-color: #b8bec8; }
::placeholder { color: #7a818c; }
/* Dangerous action with a filled button (e.g. delete workspace). */
button.danger-solid, button.primary.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
button.danger-solid:hover { background: #a61f16; border-color: #a61f16; }
/* Agreement / signing bars in the app's colours (were navy + gold). */
.pa-bar, .sign-bar { background: #111827; }
.pa-bar .pa-ttl, .sign-bar .sign-ttl { color: #fff; }
/* Dates never wrap mid-value. */
td.date, td[data-label="Date"] { white-space: nowrap; }
/* Long forms on phones: Save / Cancel stay reachable. */
@media (max-width: 760px) {
  .modal .btns { position: sticky; bottom: -18px; background: #fff; margin: 18px -18px -18px;
    padding: 12px 18px; border-top: 1px solid var(--border); z-index: 2; }
}
/* Bigger touch targets on phones / tablets. */
@media (pointer: coarse) {
  .rowmenu summary, #notifyBell { min-width: 40px; min-height: 40px; display: inline-flex;
    align-items: center; justify-content: center; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  td a[href^="mailto:"], td a[href^="tel:"] { display: inline-block; padding: 6px 0; }
}
/* Tables become stacked cards on phones (labels come from the header;
   js/app.js sets data-label on every cell). */
@media (max-width: 760px) {
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tfoot { display: block; width: 100%; }
  table.rt tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 12px;
    padding: 12px 2px; border-bottom: 1px solid var(--border); }
  table.rt td { display: block; border: 0; padding: 0; text-align: left; min-width: 0;
    overflow-wrap: anywhere; }
  table.rt td.num { text-align: left; }
  table.rt td::before { content: attr(data-label); display: block; font-size: 11px;
    color: var(--muted); font-weight: 600; letter-spacing: .2px; }
  table.rt td[data-label=""]::before { display: none; }
  table.rt td:first-child { grid-column: 1 / -1; font-weight: 600; font-size: 14px; }
  table.rt td:first-child::before { display: none; }
  table.rt td.actions, table.rt td.rt-wide { grid-column: 1 / -1; text-align: left; }
  table.rt td.actions::before { display: none; }
  table.rt td.actions .rowmenu .mitems { right: auto; left: 0; }
  .card { overflow-x: visible; }
}
