* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg) var(--bg-glow) no-repeat; color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums; min-height: 100vh;
}
a { color: var(--accent); }
h1 { font-size: var(--fs-xl); margin: 0 0 var(--s4); letter-spacing: -.01em; }
h2 { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s3); letter-spacing: -.01em; }
h3 { font-size: var(--fs-md); margin: var(--s4) 0 var(--s2); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s4) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header and navigation ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast); font-weight: 800; font-size: 15px; }
.brand .env { font-size: 11px; font-weight: 600; color: var(--warning); border: 1px solid var(--warning); border-radius: 999px; padding: 0 8px; }
.pillnav {
  display: none; margin: 0 auto; padding: 5px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.pill { position: relative; }
.pill > a, .pill > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.pill > a:hover, .pill > button:hover { color: var(--text); }
.pill.active > a, .pill.active > button, .pill > a[aria-current="page"] { background: var(--text); color: var(--bg); font-weight: 600; }
.pill > button svg { width: 12px; height: 12px; opacity: .7; }
.menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); min-width: 220px; padding: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: none; z-index: 40;
}
.menu.open { display: block; }
.menu a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.menu a:hover, .menu a:focus-visible { background: var(--surface-2); }
.menu a[aria-current="page"] { background: var(--surface-2); font-weight: 600; color: var(--accent); }
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.iconbtn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none;
}
.iconbtn:hover { border-color: var(--accent); }
.iconbtn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.aptswitch { display: none; max-width: 190px; min-height: 44px; border-radius: 999px; padding: 0 14px; background: var(--surface); }
.userchip { display: none; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.userchip .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-contrast); font-weight: 700; }
.userchip .who { text-align: left; line-height: 1.15; }
.userchip small { color: var(--text-2); font-size: 11px; display: block; }
.userchip svg { width: 14px; height: 14px; flex: none; opacity: .7; }
.userchip .who { white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; }
.userwrap { position: relative; }
.userwrap .menu { left: auto; right: 0; transform: none; }

.wrap { max-width: 1240px; margin: 0 auto; padding: var(--s5) var(--s4) 110px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--text-2); font-size: var(--fs-sm); }

.bottomnav {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; display: flex; padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; box-shadow: var(--shadow-lg); padding-bottom: calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 18px;
  font-size: 11px; color: var(--text-2); text-decoration: none;
}
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a[aria-current="page"] { background: var(--text); color: var(--bg); font-weight: 600; }
.footer { text-align: center; color: var(--text-2); font-size: var(--fs-xs); padding: var(--s4) var(--s4) 96px; }

@media (min-width: 960px) {
  .pillnav { display: flex; }
  .aptswitch { display: inline-block; }
  .userchip { display: inline-flex; }
  .bottomnav { display: none; }
  .wrap { padding-bottom: var(--s6); }
  .footer { padding-bottom: var(--s5); }
  .app-header { padding: var(--s3) var(--s5); }
  .hdr-tools { margin-left: 0; }
  .brand { min-width: 170px; }
}

/* ---------- cards, grid, text ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 92%, var(--bg))); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--s4); margin-bottom: var(--s4);
}
@media (min-width: 720px) { .card { padding: var(--s5); } }
.row { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--text-2); font-size: var(--fs-sm); }
.big { font-size: var(--fs-xxl); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: var(--s4); }
.grid > .card { margin-bottom: 0; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .grid.dash { grid-template-columns: 1.6fr 1fr 1fr; } .grid.dash .span-2 { grid-column: span 2; } }
a.tile { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.meter { height: 8px; background: var(--surface-2); border-radius: 999px; margin: var(--s2) 0; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- forms and buttons ---------- */
label { display: block; font-size: var(--fs-sm); font-weight: 500; margin: var(--s3) 0 var(--s1); color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--text-2) 70%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); vertical-align: middle; margin-inline-end: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 46px; padding: 0 20px; font: inherit; font-weight: 600; color: var(--accent-contrast);
  background: var(--accent); border: 1px solid transparent; border-radius: 999px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.secondary { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--accent); filter: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: .55; cursor: progress; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--success); } .badge.bad { color: var(--danger); } .badge.warn { color: var(--warning); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.delta.down { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.checks li:last-child { border-bottom: 0; }
.checks .fix { font-size: var(--fs-sm); color: var(--text-2); }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; }
.card:has(> table) { overflow-x: auto; }

.flash { padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s3); border: 1px solid var(--border); background: var(--surface); }
.flash.ok { border-color: var(--success); } .flash.err { border-color: var(--danger); }

.tabs { display: flex; gap: var(--s2); overflow-x: auto; margin-bottom: var(--s4); padding-bottom: 2px; }
.tabs a { white-space: nowrap; padding: 0 16px; min-height: 42px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text-2); background: var(--surface); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.method { margin: 0; }
.method input { position: absolute; opacity: 0; }
.method span { display: flex; align-items: center; justify-content: center; min-height: 56px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; background: var(--surface-2); cursor: pointer; color: var(--text); }
.method input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-contrast); }
.method input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- beds ---------- */
.bedgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.bedcard {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) var(--s4); color: var(--text); text-decoration: none; background: var(--surface);
  border: 1px solid var(--border); border-inline-start: 6px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.bedprice { font-size: var(--fs-lg); font-weight: 700; }
.bedcard.st-vacant { border-inline-start-color: var(--st-vacant); } .bedcard.st-occupied { border-inline-start-color: var(--st-occupied); }
.bedcard.st-reserved { border-inline-start-color: var(--st-reserved); } .bedcard.st-notice { border-inline-start-color: var(--st-notice); }
.bedcard.st-maintenance { border-inline-start-color: var(--st-maintenance); } .bedcard.st-blocked { border-inline-start-color: var(--st-blocked); }
.badge.st-vacant { color: var(--st-vacant); } .badge.st-occupied { color: var(--st-occupied); } .badge.st-reserved { color: var(--st-reserved); }
.badge.st-notice { color: var(--st-notice); } .badge.st-maintenance { color: var(--st-maintenance); } .badge.st-blocked { color: var(--st-blocked); }

/* ---------- dashboard widgets ---------- */
.kpi .label { color: var(--text-2); font-size: var(--fs-sm); }
.kpi .value { font-size: var(--fs-xxl); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .foot { color: var(--text-2); font-size: var(--fs-xs); margin-top: var(--s2); }
.ringwrap { display: flex; align-items: center; gap: var(--s4); }
.ring { width: 96px; height: 96px; flex: none; }
.ring .track { stroke: var(--surface-2); } .ring .arc { stroke: var(--accent); stroke-linecap: round; }
.ring text { fill: var(--text); font-weight: 700; font-size: 20px; }
.chart { width: 100%; height: 220px; display: block; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .lbl { fill: var(--text-2); font-size: 11px; }
.legend { display: flex; gap: var(--s4); font-size: var(--fs-sm); color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: var(--s3); }
.cal .dow { font-size: 11px; color: var(--text-2); text-align: center; }
.cal .d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: var(--fs-sm); color: var(--text-2); }
.cal .d.pad { background: transparent; }
.cal .d.today { outline: 2px solid var(--accent); color: var(--text); font-weight: 700; }
.cal .d.has { color: var(--text); background: color-mix(in srgb, var(--accent) 28%, var(--surface-2)); font-weight: 600; }
.cal .d.has.late { background: color-mix(in srgb, var(--danger) 30%, var(--surface-2)); }
.cal .d i { position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; margin-top: var(--s3); }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bars .col { width: 100%; border-radius: 12px; background: var(--surface-2); background-image: var(--hatch); min-height: 8px; position: relative; }
.bars .col.hi { background: var(--accent); background-image: none; }
.bars .col .tip { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.bars small { color: var(--text-2); font-size: 11px; }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li a { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); min-height: 52px; }
.attn li:last-child a { border-bottom: 0; }
.attn .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.attn .ic.bad { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.attn .ic.warn { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.attn .ic.ok { background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.attn .t { flex: 1; min-width: 0; } .attn .t small { color: var(--text-2); display: block; }
.searchbox { position: relative; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; }
.auth-art {
  display: none; padding: var(--s7); position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(900px 500px at 20% 10%, #7C5CE0 0%, transparent 60%), radial-gradient(700px 500px at 90% 90%, #F5D36B33 0%, transparent 60%), #120E22;
}
.auth-art h2 { font-size: 38px; line-height: 1.1; margin: 0 0 var(--s4); letter-spacing: -.03em; }
.auth-art p { color: #cfc8ea; max-width: 420px; }
.auth-art .stat { display: inline-block; margin: var(--s5) var(--s5) 0 0; }
.auth-art .stat b { display: block; font-size: 30px; }
.auth-art .stat span { color: #bdb3e0; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: var(--s5) var(--s4); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { margin-bottom: var(--s6); }
.auth-card h1 { font-size: 30px; margin-bottom: var(--s2); }
.pwwrap { position: relative; }
.pwwrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-width: 44px; min-height: 36px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 13px; }
.demo-hint { margin-top: var(--s5); padding: var(--s3) var(--s4); border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2); }
@media (min-width: 960px) { .auth { grid-template-columns: 1.1fr 1fr; } .auth-art { display: block; } }

/* ---------- skeleton and print ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .app-header, .bottomnav, .footer, .noprint { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none; background: #fff; border-color: #bbb; color: #000; }
  .muted, th { color: #333; }
  .wrap { padding: 0; max-width: none; }
}

/* ---------- inner pages: stat strip, avatars, list cards, breakdown bars ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } .stats.five { grid-template-columns: repeat(5, 1fr); } .stats.three { grid-template-columns: repeat(3, 1fr); } }
.stat { padding: var(--s4); background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 92%, var(--bg))); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat .label { color: var(--text-2); font-size: var(--fs-sm); }
.stat .value { font-size: var(--fs-xl, 24px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .foot { color: var(--text-2); font-size: var(--fs-xs); margin-top: 4px; }
.stat.good .value { color: var(--success); } .stat.bad .value { color: var(--danger); } .stat.warn .value { color: var(--warning); }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--accent); letter-spacing: .02em; }
.cardgrid { display: grid; gap: var(--s3); grid-template-columns: 1fr; margin-bottom: var(--s4); }
@media (min-width: 720px) { .cardgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cardgrid { grid-template-columns: repeat(3, 1fr); } }
.cardgrid > a.card, .cardgrid > .card { margin-bottom: 0; }
.person { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.person > div { min-width: 0; }
.person strong, .person .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cardfoot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.owes, .clear { white-space: nowrap; } .owes { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; } .clear { color: var(--success); font-weight: 600; }
.toolbar { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 180px; }
.barlist { display: grid; gap: var(--s3); }
.barlist .bl { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); font-size: var(--fs-sm); }
.barlist .bl .meter { grid-column: 1 / -1; margin: 2px 0 0; }
.barlist .bl.exp .meter span { background: var(--warning); }
.daygroup { display: flex; justify-content: space-between; align-items: baseline; margin: var(--s5) 0 var(--s2); }
.daygroup h2 { margin: 0; font-size: var(--fs-md, 16px); } .daygroup .muted { font-variant-numeric: tabular-nums; }
.lines { padding: 0 !important; overflow: hidden; }
.lines .line { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.lines .line:last-child { border-bottom: 0; }
.lines .line .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.occbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: var(--s2) 0; }
.occbar span { display: block; height: 100%; }
.bedcard .who { font-weight: 600; }
.bedcard { transition: transform .12s, border-color .12s; } .bedcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.roomhead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin: var(--s5) 0 var(--s3); flex-wrap: wrap; }
.roomhead h2 { margin: 0; }
.statusfilter { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.statusfilter a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.statusfilter a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.statusfilter i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cardfoot { flex-wrap: wrap; } .cardfoot .btn { white-space: nowrap; padding: 0 14px; }

/* ---------- agreements ---------- */
.agdoc { background: #fff; color: #111; border-radius: var(--radius); padding: var(--s5); line-height: 1.55; font-size: 15px; box-shadow: var(--shadow); }
.agdoc h2 { margin: 0 0 12px; font-size: 22px; color: #111; } .agdoc h3 { margin: 20px 0 6px; font-size: 16px; color: #111; }
.agdoc p { margin: 0 0 10px; } .agdoc ul { margin: 0 0 10px; padding-inline-start: 22px; } .agdoc .muted { color: #555; }
.agsign { margin-top: 28px; padding-top: 14px; border-top: 1px solid #ccc; } .sigimg { max-height: 90px; max-width: 280px; } .sigblank { height: 70px; }
.sigwrap { border: 2px dashed var(--border); border-radius: var(--radius-sm); background: #fff; } .sigwrap canvas { display: block; width: 100%; height: 200px; touch-action: none; cursor: crosshair; }
.agref { font-size: 11px; margin-top: 4px; font-family: ui-monospace, monospace; }
.phchips { display: flex; flex-wrap: wrap; gap: 6px; } .phchips code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; min-height: 360px; }
table.rpt thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
table.rpt tr.tot td { border-top: 2px solid var(--text); background: var(--surface-2); }
table.rpt td.num { white-space: nowrap; }

/* ---------- leads pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); margin-bottom: var(--s4); }
.pcol h2 { font-size: var(--fs-md, 16px); margin: 0 0 var(--s2); position: sticky; left: 0; }
.pcard { padding: var(--s3) var(--s4); margin-bottom: var(--s2); }

/* ---------- popup forms and row actions ---------- */
.pagebar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-inline-start: auto; }
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(680px, 94vw); max-height: 92vh; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(8, 8, 14, .62); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); flex: none; }
.modal-title { margin: 0; font-size: var(--fs-lg); }
.modal-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.modal-x:hover { border-color: var(--accent); }
.modal-body { padding: var(--s4) var(--s5) var(--s5); overflow-y: auto; }
.modal-body > form { margin: 0; }
.modal-body label:first-child { margin-top: 0; }
@media (max-width: 640px) { dialog.modal { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: var(--radius) var(--radius) 0 0; } }
.btn.small { min-height: 34px; padding: 0 14px; font-size: var(--fs-sm); }
.rowactions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rowactions form { display: inline; margin: 0; }
.rowactions .btn { white-space: nowrap; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--accent); }
.btn.ghost.danger-text:hover { color: var(--danger); border-color: var(--danger); }
.empty { text-align: center; padding: var(--s6, 32px) var(--s4); }
.empty p { margin: 6px 0 14px; }
#main > button.btn { margin: 0 8px 12px 0; }

/* ---------- leads kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s4); margin-bottom: var(--s4); scroll-snap-type: x proximity; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); scroll-snap-align: start; min-width: 0; }
.kcol header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: var(--s2); padding: 0 var(--s1); }
.kcol h2 { margin: 0; font-size: var(--fs-md, 16px); }
.kcount { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; text-align: center; color: var(--text-2); }
.k-won { border-top: 3px solid var(--success); } .k-lost { border-top: 3px solid var(--danger); } .k-new { border-top: 3px solid var(--accent); }
.klist { display: grid; gap: var(--s2); min-height: 90px; border-radius: var(--radius-sm); padding: 2px; transition: background .12s; align-content: start; }
.klist.over { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.kempty { text-align: center; padding: 18px 6px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: var(--s3); cursor: grab; box-shadow: var(--shadow); display: grid; gap: 6px; }
.kcard:hover { border-color: var(--accent); }
.kcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard.saving { opacity: .7; }
.ktop { display: flex; justify-content: space-between; gap: var(--s2); align-items: flex-start; }
.kname { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.kname:hover { text-decoration: underline; }
.kav { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.kmeta { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; font-size: var(--fs-xs); }
.kactions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border); }
.kactions .btn { min-height: 30px; padding: 0 11px; font-size: 12px; }
.kstages { display: grid; gap: var(--s2); }
.kfield input.kerr { border-color: var(--danger); }
.ktoast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 520px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: var(--fs-sm); }
.ktoast.bad { background: var(--danger); color: #fff; }
.ktoast a { color: inherit; font-weight: 700; text-decoration: underline; }
@media (max-width: 720px) { .kanban { grid-auto-columns: 82vw; } }

/* ---------- form layout, wizard, summary panels ---------- */
.fg { display: grid; gap: 0 var(--s4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .fg.two { grid-template-columns: 1fr 1fr; } .fg.three { grid-template-columns: repeat(3, 1fr); } }
.fg .full { grid-column: 1 / -1; }
.hint { color: var(--text-2); font-size: var(--fs-xs); margin-top: 4px; }
.split { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); } .split .sticky { position: sticky; top: 86px; } }
.split > .card, .split > div > .card { margin-bottom: var(--s4); }
.wsteps { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; counter-reset: ws; }
.wsteps button { counter-increment: ws; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; cursor: pointer; }
.wsteps button::before { content: counter(ws); width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.wsteps button[aria-current="step"] { color: var(--text); border-color: var(--accent); font-weight: 600; }
.wsteps button[aria-current="step"]::before { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.wsteps button.done::before { content: "\2713"; background: var(--success); color: #fff; border-color: var(--success); }
.wstep[hidden] { display: none !important; }
.wstep > h2 { margin-top: 0; }
.wnav { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }
.sumrow { display: flex; justify-content: space-between; gap: var(--s3); padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.sumrow:last-child { border-bottom: 0; }
.sumrow.total { font-weight: 700; font-size: var(--fs-md, 16px); border-top: 2px solid var(--text); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.chipbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chipbtns button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chipbtns button:hover { border-color: var(--accent); }
.preview { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: var(--s3); font-size: var(--fs-sm); }
.preview .ok { color: var(--success); font-weight: 600; }


/* ---------- side navigation (desktop) ---------- */
.sidenav { display: none; }
@media (min-width: 960px) {
  .pillnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: 248px; padding: var(--s4) var(--s3);
    background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; gap: var(--s3);
  }
  .sidenav .brand { padding: 4px 8px var(--s2); min-width: 0; }
  .sidenav nav { display: flex; flex-direction: column; gap: 2px; }
  body:has(.sidenav) .app-header, body:has(.sidenav) .wrap, body:has(.sidenav) .footer { margin-left: 248px; }
  body:has(.sidenav) .app-header .brand { display: none; }
  body:has(.sidenav) .hdr-tools { margin-left: auto; }
  body:has(.sidenav) .split .sticky { top: 86px; }
}
.sgroup { border-radius: 12px; }
.sgroup > summary, .sgroup.solo {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; cursor: pointer; list-style: none; color: var(--text);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none;
}
.sgroup > summary::-webkit-details-marker { display: none; }
.sgroup > summary span, .sgroup.solo span { flex: 1; }
.sgroup svg { width: 19px; height: 19px; flex: none; color: var(--text-2); }
.sgroup > summary svg:last-child { width: 13px; height: 13px; transition: transform .15s; }
.sgroup[open] > summary svg:last-child { transform: rotate(180deg); }
.sgroup > summary:hover, .sgroup.solo:hover { background: var(--surface-2); }
.sgroup.active > summary svg:first-child, .sgroup.solo.active svg { color: var(--accent); }
.sgroup.solo.active { background: var(--surface-2); color: var(--accent); }
.slinks { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid var(--border); }
.slinks a { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.slinks a:hover { background: var(--surface-2); color: var(--text); }
.slinks a[aria-current="page"] { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
@media print { .sidenav { display: none !important; } body:has(.sidenav) .app-header, body:has(.sidenav) .wrap, body:has(.sidenav) .footer { margin-left: 0 !important; } }

/* ---------- logo ---------- */
.brand .mark.has-logo { width: auto; height: 34px; background: transparent; border-radius: 0; }
.brand .mark.has-logo img { display: block; height: 100%; max-width: 130px; object-fit: contain; }
.auth-art .brand .mark.has-logo { background: #fff; padding: 4px 8px; border-radius: 10px; height: 40px; }
.sidenav .brand .mark.has-logo { height: 36px; }
.sidenav { overflow-x: hidden; }
.sidenav .brand { flex-wrap: wrap; row-gap: 4px; }
.sidenav .brand .mark.has-logo img { max-width: 100px; }


/* ---------- small phones (iPhone 12 mini is 375 pt wide) ---------- */
.stickybar { position: sticky; bottom: 12px; z-index: 5; }
.inv { overflow-wrap: anywhere; }
.inv table { max-width: 100%; }
@media (max-width: 959px) { .stickybar { bottom: 92px; } }
@media (max-width: 640px) {
  /* 16 px fields: iOS Safari zooms the page when a smaller field gets the cursor */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=month], input[type=search], select, textarea { font-size: 16px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .card { padding: 14px; border-radius: 16px; }
  .row > * { min-width: 0; }
  .row > .person { flex: 1 1 100%; }
  .person strong, .person .muted { white-space: normal; overflow-wrap: anywhere; }
  .cardfoot { flex-wrap: wrap; row-gap: 4px; }
  .pagehead h1, h1 { font-size: 24px; }
  .stats { gap: 10px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 21px; }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rowactions { flex-wrap: wrap; gap: 6px; }
  .lines .line { flex-wrap: wrap; row-gap: 6px; }
  .lines .line > * { min-width: 0; }
  .btn { white-space: normal; }
  dialog.modal { max-height: 92dvh; }
  dialog.modal .modal-body { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .inv { padding: 14px !important; font-size: 12px !important; }
  .fg.two, .fg.three { grid-template-columns: 1fr; }
  table.rpt { font-size: 12px; }
}
@media (max-width: 380px) {
  .app-header { padding: 8px 10px; gap: 6px; }
  .iconbtn { width: 40px; height: 40px; }
  .bottomnav { left: 8px; right: 8px; }
  .bottomnav a { font-size: 10px; }
}
input[type=file] { width: 100%; padding: 8px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-2); font: inherit; font-size: 14px; }
input[type=file]::file-selector-button { margin-right: 12px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- tenants list ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.stat.tile { display: block; color: inherit; text-decoration: none; }
.tfilter { display: grid; gap: var(--s3); }
.tsearch { display: flex; gap: var(--s2); }
.tsearch input { flex: 1; min-width: 0; margin: 0; }
.tselects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.tselects label { margin-top: 0; }
.tcount { display: inline-block; min-width: 20px; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; font-size: var(--fs-xs); background: color-mix(in srgb, currentColor 14%, transparent); text-align: center; }
.tcountline { margin: 0 0 var(--s2); }
.tlist { padding: 0; overflow: hidden; }
.trow { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr) 130px; gap: var(--s3); align-items: center; padding: 12px var(--s4); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.trow:last-child { border-bottom: 0; }
a.trow:hover, a.trow:focus-visible { background: var(--surface-2); }
.trow.thead { padding-block: 10px; color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.trow .num { text-align: right; }
.trow .who { display: block; min-width: 0; }
.trow .who strong, .trow .who .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .c-place strong { font-weight: 600; }
@media (max-width: 719px) {
  .tselects { grid-template-columns: 1fr 1fr; }
  .trow.thead { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who status" "place place" "rent bal"; row-gap: 6px; padding: 12px var(--s3); }
  .trow .c-who { grid-area: who; }
  .trow .c-status { grid-area: status; }
  .trow .c-place { grid-area: place; padding-inline-start: 52px; font-size: var(--fs-sm); }
  .trow .c-rent { grid-area: rent; text-align: left; padding-inline-start: 52px; font-size: var(--fs-sm); }
  .trow .c-bal { grid-area: bal; }
  .trow .c-place:empty, .trow .c-rent:empty { display: none; }
  .trow .who strong, .trow .who .muted { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 719px) {
  .tstats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tstats > .stat:last-child:nth-child(odd) { grid-column: auto; }
  .tstats .stat { padding: 10px; }
  .tstats .stat .label { font-size: var(--fs-xs); }
  .tstats .stat .value { font-size: 17px; }
  .tstats .stat .foot { display: none; }
  .trow .who strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; }
}

/* ---------- bigger logo, light login, login code ---------- */
.brand .mark.has-logo { height: 46px; }
.brand .mark.has-logo img { max-width: 190px; }
.sidenav .brand .mark.has-logo { height: 52px; }
.sidenav .brand .mark.has-logo img { max-width: 180px; }
.auth-art .brand .mark.has-logo { height: 64px; }
.auth-art .brand .mark.has-logo img { max-width: 240px; }
.auth-card .brand .mark.has-logo { height: 64px; }
.auth-card .brand .mark.has-logo img { max-width: 260px; }
.auth-light .auth-art { color: var(--text); background: radial-gradient(900px 500px at 15% 5%, rgba(109, 74, 224, .16) 0%, transparent 60%), radial-gradient(700px 500px at 95% 95%, rgba(183, 121, 31, .18) 0%, transparent 60%), #FBFAFE; border-right: 1px solid var(--border); }
.auth-light .auth-art p { color: var(--text-2); }
.auth-light .auth-art .stat span { color: var(--text-2); }
.auth-light .auth-art .brand .mark.has-logo { background: transparent; padding: 0; }
.codebox { font-size: 28px; letter-spacing: 10px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.codebox::placeholder { letter-spacing: 10px; font-weight: 400; }
.codeactions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); }
.codeactions .btn { flex: 1 1 140px; }
@media (max-width: 719px) {
  .app-header .brand .mark.has-logo { height: 40px; }
  .app-header .brand .mark.has-logo img { max-width: 150px; }
}

/* ---------- phone fixes found by the 375 px audit ---------- */
input[type=url], input[type=file], input[type=color] { font-size: 16px; }
input[type=url] { width: 100%; min-height: 46px; padding: 10px 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
input[type=color] { min-width: 56px; min-height: 46px; padding: 4px; }
details.card:has(> table) { overflow-x: auto; }
pre, code { overflow-wrap: anywhere; }
pre { max-width: 100%; overflow-x: auto; }
.checks li > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 719px) {
  /* plain text links get a taller touch area without changing the line */
  main p a:not([class]), main .foot a, main .muted a { padding-block: 10px; }
  main a.muted { display: inline-block; padding: 8px 0; margin: -8px 0; }
}
@media (max-width: 719px) {
  /* dashboard: the small figures sit two by two, the occupancy ring keeps the full width */
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.cols-4 > .kpi:first-child { grid-column: 1 / -1; }
  .grid.cols-4 > .kpi { padding: 14px; }
  .grid.cols-4 > .kpi .value { font-size: 22px; }
  /* the buttons beside a page title are one size and wrap two by two */
  .pagebar .btn { min-height: 42px; padding: 0 16px; font-size: 14px; }
}
@media (max-width: 719px) {
  /* bed cards: a shorter card with the full bed code on one or two clean lines */
  .bedgrid { gap: 10px; }
  .bedcard { padding: 12px; gap: 2px; }
  .bedcard > strong { font-size: 15px; overflow-wrap: anywhere; line-height: 1.25; }
  .bedcard .bedprice { font-size: 17px; }
  .bedcard .badge { margin-top: 4px; }
}

/* ---------- apartments list ---------- */
.aptgrid { display: grid; gap: var(--s4); grid-template-columns: 1fr; margin-bottom: var(--s5); }
@media (min-width: 720px) { .aptgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .aptgrid { grid-template-columns: repeat(3, 1fr); } }
.aptcard { position: relative; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.aptcard:hover, .aptcard:focus-within { border-color: var(--accent); transform: translateY(-1px); }
.aptcard-head { display: flex; align-items: center; gap: var(--s3); }
.aptcard-head .who { flex: 1; min-width: 0; }
.aptcard-head .who strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.aptcard-head .who .muted { display: block; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.avatar.sq { border-radius: 12px; }
a.stretched { color: inherit; text-decoration: none; }
a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.aptocc { display: flex; align-items: center; gap: var(--s4); }
.aptocc-fig { text-align: center; min-width: 74px; }
.aptocc-fig b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.aptocc-fig span { color: var(--text-2); font-size: var(--fs-xs); }
.aptocc-bar { flex: 1; min-width: 0; }
.aptocc-bar .meter { height: 10px; margin: 0 0 6px; }
.aptocc-nums { display: flex; justify-content: space-between; gap: var(--s2); font-size: var(--fs-sm); color: var(--text-2); }
.aptocc-nums b { color: var(--text); }
.aptocc-nums .vac b { color: var(--success); }
.aptempty { margin: 0; padding: var(--s3); border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-2); font-size: var(--fs-sm); }
.aptempty a { position: relative; z-index: 1; font-weight: 600; }
.aptmoney { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--border); }
.aptmoney > div { min-width: 0; }
.aptmoney span { display: block; font-size: var(--fs-xs); }
.aptmoney strong { display: block; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aptactions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }
.aptactions .btn { flex: 1 1 auto; min-height: 42px; }
@media (max-width: 719px) { .aptcard { padding: 14px; } .aptmoney strong { font-size: 14px; } }

/* ---------- tenants list: more filters and row buttons ---------- */
.filterlabel { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: var(--s3) 0 6px; }
.tabs-attn a[aria-current="page"] { background: var(--warning); border-color: var(--warning); color: #fff; }
.tsortrow { display: flex; align-items: center; gap: var(--s3); }
.tsortrow label { margin: 0; white-space: nowrap; }
.tsortrow select { max-width: 260px; }
.ftag { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: var(--fs-sm); }
.ftag:hover { border-color: var(--danger); color: var(--danger); }
.tlist .trow { position: relative; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1fr) 340px; }
.tlist .trow:not(.thead):hover { background: var(--surface-2); }
.trow .who .badge { margin-top: 4px; }
.c-actions { position: relative; z-index: 1; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.c-actions .btn { min-height: 38px; padding: 0 12px; font-size: 13px; }
@media (max-width: 1199px) {
  .trow.thead { display: none; }
  .tlist .trow { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); grid-template-areas: "who place rent bal" "actions actions actions actions"; row-gap: 10px; }
  .tlist .trow .c-who { grid-area: who; } .tlist .trow .c-place { grid-area: place; padding-inline-start: 0; } .tlist .trow .c-rent { grid-area: rent; padding-inline-start: 0; text-align: right; }
  .tlist .trow .c-bal { grid-area: bal; } .tlist .trow .c-actions { grid-area: actions; justify-content: flex-start; }
}
@media (max-width: 719px) {
  .tlist .trow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "who who" "place place" "rent bal" "actions actions"; }
  .tlist .trow .c-place, .tlist .trow .c-rent { padding-inline-start: 52px; text-align: left; }
  .tlist .trow .c-bal { text-align: right; }
  .c-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .c-actions .btn { min-height: 44px; }
  .tsortrow select { max-width: none; flex: 1; }
}
@media (max-width: 719px) { .pagebar .pb-extra { display: none; } }

/* side menu: the logo's artwork (and the Staging tag) start in line with the menu icons; the picture has a little clear space on its left */
@media (min-width: 960px) { .sidenav .brand { padding-left: 2px; } .sidenav .brand .env { margin-left: 10px; } }

/* ---------- record payment ---------- */
.tabs button { white-space: nowrap; padding: 0 16px; min-height: 42px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); background: var(--surface); font: inherit; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.paylist { display: grid; gap: 10px; margin-bottom: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .paylist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.payrow { min-width: 0; }
.payrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s; }
.payrow:hover, .payrow:focus-visible { border-color: var(--accent); }
.payrow[hidden] { display: none; }
.payrow .who { flex: 1; min-width: 0; }
.payrow .who strong, .payrow .who .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payrow .who .muted { font-size: var(--fs-sm); }
.payrow .amt { text-align: right; white-space: nowrap; }
.payrow .amt b, .payrow .amt small { display: block; }
.payrow .amt small { font-size: var(--fs-xs); }
.payrow .btn { flex: none; pointer-events: none; }
.paytenant-top { display: flex; align-items: center; gap: var(--s3); }
.paytenant-top .who { flex: 1; min-width: 0; }
.paytenant-top .who strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.paytenant-top .who .muted { display: block; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.paytenant-bal { text-align: right; }
.paytenant-bal span, .paytenant-bal strong { display: block; }
.paytenant-bal strong { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.paytenant-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--s3); }
.payamount { font-size: 28px; min-height: 64px; font-weight: 700; font-variant-numeric: tabular-nums; }
.methods-4 { grid-template-columns: repeat(4, 1fr); }
.paymore { margin-top: var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 14px; }
.paymore > summary { min-height: 48px; font-weight: 600; cursor: pointer; }
.paymore[open] { padding-bottom: 12px; }
.payform-note { margin: 0; }
.paysave { width: 100%; min-height: 56px; font-size: 18px; box-shadow: var(--shadow-lg); }
.stickybar { margin-top: var(--s4); }
@media (max-width: 719px) {
  .payrow { flex-wrap: wrap; }
  .payrow .who { flex-basis: calc(100% - 60px); }
  .payrow .amt { margin-left: 56px; text-align: left; flex: 1; }
  .payrow .amt b, .payrow .amt small { display: inline; }
  .payrow .amt small { margin-left: 6px; }
  .paytenant-top { flex-wrap: wrap; }
  .paytenant-top .who { flex-basis: calc(100% - 70px); }
  .paytenant-bal { flex: 1 1 100%; display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px solid var(--border); }
  .methods-4 { grid-template-columns: repeat(2, 1fr); }
  .payamount { font-size: 30px; }
}
#payform .stickybar { padding-top: 14px; background: linear-gradient(to top, var(--surface) 65%, transparent); }
/* side menu: the logo's artwork sits on the same line as the apartment switcher in the top bar */
@media (min-width: 960px) { .sidenav .brand { margin-top: -26px; } }
/* top bar on phones and tablets: the logo's artwork is centred on the search and bell buttons and starts at the page edge */
@media (max-width: 959px) { .app-header .brand .mark.has-logo img { position: relative; top: -14px; left: -2px; } }
@media (max-width: 719px) { .grid.cols-4 > .kpi:last-child { grid-column: 1 / -1; } }
/* desktop with the side menu: the page fills the space to the right of the menu, in line with the top bar, instead of stopping short on the right */
@media (min-width: 960px) { body:has(.sidenav) .wrap { max-width: none; margin-right: 0; padding-left: var(--s5); padding-right: var(--s5); } }

/* ---------- dashboard: income and expenses bars ---------- */
.chartcard { display: flex; flex-direction: column; }
.chartsum { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s4) 0 var(--s3); padding: var(--s3) 0; border-block: 1px solid var(--border); }
.chartsum span, .chartsum strong { display: block; }
.chartsum span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }
.chartsum strong { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bars2 { flex: 1; display: flex; flex-direction: column; min-height: 230px; }
.bars2-plot { position: relative; flex: 1; min-height: 230px; padding-top: 22px; }
.bars2-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 22px; bottom: 28px; background: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--border) calc(25% - 1px), var(--border) 25%); opacity: .7; pointer-events: none; }
.bars2-cols { position: absolute; inset: 22px 0 0 0; display: grid; gap: 6px; }
.bars2-col { display: flex; flex-direction: column; min-width: 0; }
.bars2-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding-inline: 6%; }
.bars2 .bar { position: relative; flex: 1; max-width: 34px; border-radius: 7px 7px 2px 2px; opacity: .7; transition: opacity .15s; }
.bars2 .bar.in { background: var(--accent); }
.bars2 .bar.ex { background: var(--accent-2); }
.bars2-col.now .bar, .bars2-col:hover .bar { opacity: 1; }
.bars2 .bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.bars2-col.now .bar span { color: var(--text); }
.bars2-lbl { height: 28px; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); color: var(--text-2); }
.bars2-col.now .bars2-lbl { color: var(--text); font-weight: 700; }
@media (max-width: 719px) { .chartsum strong { font-size: 16px; } .bars2 .bar span { font-size: 9px; } .bars2-pair { gap: 3px; padding-inline: 2%; } .bars2-cols { gap: 2px; } }

/* ---------- birthdays ---------- */
.bdmonth { padding: 10px var(--s4); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.bdrow { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 220px) auto; gap: var(--s3); align-items: center; padding: 12px var(--s4); border-bottom: 1px solid var(--border); }
.bdrow:last-child { border-bottom: 0; }
.bdrow:hover { background: var(--surface-2); }
.bddate { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.1; }
.bddate b { font-size: 20px; } .bddate small { font-size: 11px; text-transform: uppercase; color: var(--text-2); letter-spacing: .05em; }
.bdrow .who strong, .bdrow .who .muted { display: block; overflow-wrap: anywhere; }
.bdactions { position: relative; z-index: 1; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.bdactions .btn { min-height: 38px; }
@media (max-width: 719px) {
  .bdrow { grid-template-columns: 52px minmax(0, 1fr); row-gap: 8px; }
  .bdstate { grid-column: 2; }
  .bdactions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); }
  .bdactions .btn { min-height: 44px; width: 100%; }
}
/* grids never get wider than the screen: a long figure wraps inside its card instead of pushing the page sideways */
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid.dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); } }
.grid > .card, .kpi { min-width: 0; }
.kpi .value { overflow-wrap: anywhere; }
/* the filter chip rows scroll sideways when there are many, without showing a scroll bar */
.tabs { scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.prepay { margin-top: var(--s3); }
.prepay #pp_box { margin-top: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
#payform input[readonly] { opacity: .85; }
.methods-6 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 719px) { .methods-6 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- numerology card ---------- */
.numgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s2); }
.numgrid > div { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.numgrid span, .numgrid strong, .numgrid small { display: block; }
.numgrid span { font-size: var(--fs-xs); } .numgrid strong { font-size: 24px; line-height: 1.2; } .numgrid small { font-size: 11px; }
.plainlist { margin: 6px 0 0; padding-left: 18px; }

/* ---------- tenant photos ---------- */
.avatar.photo { object-fit: cover; border-radius: 50%; background: var(--surface-2); flex: none; display: block; }
.photofound { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.photogrid { display: grid; gap: 10px; }
.photorow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.photorow .who { flex: 1; min-width: 0; } .photorow .who strong, .photorow .who .muted { display: block; overflow-wrap: anywhere; }
