/* Mait House — rent platform. Palette taken from the logo. */
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("../fonts/montserrat-latin-400-normal.934faa18c225.woff") format("woff"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("../fonts/montserrat-latin-500-normal.f4ab9cec00b4.woff") format("woff"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/montserrat-latin-600-normal.ab4aca9bfc9d.woff") format("woff"); }

:root {
  --navy: #172A3D;
  --navy-2: #22394F;
  --navy-3: #2E4860;
  --terra: #C46A4A;
  --terra-soft: #F6E7E0;
  --bg: #F5F3EF;
  --surface: #FFFFFF;
  --ink: #172A3D;
  --muted: #5F6C79;
  --faint: #8A949E;
  --line: #E5E1DA;
  --line-strong: #D3CDC3;
  --ok: #2E7656;     --ok-bg: #E3F1EA;
  --warn: #9A6412;   --warn-bg: #FBF0DC;
  --bad: #AE3B2C;    --bad-bg: #F9E4E0;
  --info: #2F5E86;   --info-bg: #E3EDF6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 42, 61, .06), 0 1px 1px rgba(23, 42, 61, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Montserrat", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--navy); text-decoration-color: rgba(23, 42, 61, .3); text-underline-offset: 2px; }
a:hover { color: var(--terra); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .02em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- admin shell ---------- */
.sidebar-foot .who { display: block; }
.admin-lang { display: flex; width: max-content; gap: 2px; background: var(--navy-2); border-radius: 7px; padding: 2px; margin: 8px 0 2px; }
.admin-lang button { background: none; border: 0; color: rgba(255, 255, 255, .65); font: 600 11.5px var(--font); padding: 3px 9px; border-radius: 5px; cursor: pointer; text-decoration: none; }
.admin-lang button.on { background: #fff; color: var(--navy); }
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: #fff; text-decoration: none; }
.brand img { width: 40px; height: auto; }
.brand-name { font-family: var(--display); font-weight: 500; letter-spacing: .22em; font-size: 12.5px; line-height: 1.3; }
.brand-name small { display: block; letter-spacing: .3em; font-size: 10px; opacity: .6; }
.brand:hover { color: #fff; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--terra); }
.nav .badge { margin-left: auto; background: var(--terra); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 8px 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.sidebar-foot strong { color: #fff; display: block; font-weight: 600; }
.sidebar-foot a, .sidebar-foot button { color: rgba(255, 255, 255, .7); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); }
.sidebar-foot a:hover, .sidebar-foot button:hover { color: #fff; }
.sidebar-foot .links { display: flex; gap: 12px; margin-top: 6px; }

.main { min-width: 0; padding: 28px 36px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--terra); font-weight: 600; margin-bottom: 4px; }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 16px 20px; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--display); font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.alert .value { color: var(--bad); }
.meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.meter.terra > span { background: var(--terra); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #FAF9F6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
/* Tables inside cards line up with the card's title and text. */
.card th:first-child, .card td:first-child { padding-left: 20px; }
.card th:last-child, .card td:last-child { padding-right: 20px; }
tbody tr:hover { background: #FBFAF8; }
td.right, th.right { text-align: right; }
tfoot td { font-weight: 600; background: #FAF9F6; border-top: 1px solid var(--line-strong); }
.row-link { color: inherit; text-decoration: none; font-weight: 500; }
.row-link:hover { color: var(--terra); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

th a.sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
th a.sort:hover, th a.sort.on { color: var(--ink); }
th.right a.sort { justify-content: flex-end; }

.floor-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 8px; border-radius: 6px; font: 600 12.5px var(--display); border: 1px solid transparent; }
.floor-chip.f-st { background: #EEE9F7; color: #5B4691; border-color: #D9CFF0; }
.floor-chip.f-0 { background: #E3F1EA; color: #2E7656; border-color: #C9E3D5; }
.floor-chip.f-1 { background: #E3EDF6; color: #2F5E86; border-color: #C9DBEA; }
.floor-chip.f-2 { background: #F9E8E1; color: #A4513A; border-color: #F0D2C6; }
.floor-chip.f-3 { background: #FBF0DC; color: #8A5A10; border-color: #F1DDB7; }
.floor-chip.f-4, .floor-chip.f-other { background: #EEECE8; color: var(--muted); border-color: var(--line); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.paid, .pill.active, .pill.matched, .pill.high { background: var(--ok-bg); color: var(--ok); }
.pill.overdue, .pill.partial-overdue { background: var(--bad-bg); color: var(--bad); }
.pill.partial, .pill.medium, .pill.unmatched { background: var(--warn-bg); color: var(--warn); }
.pill.pending { background: #FFF1E3; color: #9A5A1F; }
.pill.due, .pill.upcoming, .pill.info { background: var(--info-bg); color: var(--info); }
.pill.ended, .pill.past, .pill.ignored, .pill.low, .pill.none { background: #EEECE8; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: #EFEDE9; font-size: 12px; color: var(--muted); font-weight: 500; }
.room-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 7px; border-radius: 7px; background: var(--navy); color: #fff; font-weight: 600; font-size: 13px; font-family: var(--display); }
.room-chip.free { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.balance-owed { color: var(--bad); font-weight: 600; }
.balance-credit { color: var(--ok); font-weight: 600; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 14px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-accent { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn-accent:hover { background: #B35C3D; border-color: #B35C3D; color: #fff; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.inline { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--bad); font-weight: 500; }
.field.check-field { flex-direction: row; align-items: flex-start; gap: 10px; }
.field.check-field label { font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=month], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font: 15px/1.35 var(--font);
}
input[type=file] { padding: 7px; background: #FAF9F6; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px rgba(23, 42, 61, .1); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--navy); margin: 2px 0 0; flex: none; }
fieldset { border: 0; margin: 0; padding: 0; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section { padding: 18px 20px; }
.form-section h2 { margin-bottom: 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--line); background: #FAF9F6; border-radius: 0 0 var(--radius) var(--radius); }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--bad); font-size: 13px; }
.form-errors { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { max-width: 300px; }
.segmented { display: inline-flex; background: #EAE7E1; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.segmented a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.segmented a .count { color: var(--faint); margin-left: 4px; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye.on { color: var(--navy); }

.file-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file-preview { width: 84px; height: 64px; border-radius: 8px; border: 1px solid var(--line); background: #FAF9F6; overflow: hidden; display: grid; place-items: center; font-size: 11px; color: var(--muted); padding: 2px; text-align: center; overflow-wrap: anywhere; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }

.hbar + .hbar { margin-top: 12px; }
.hbar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.hbar .meter { margin-top: 0; }

.period-box { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 12px 14px; }
.period-box legend { font-size: 13px; font-weight: 600; padding: 0 6px; }

input.gross { background: #F5F3EF; font-weight: 600; }

.gross-line { font-size: 13px; margin-top: 4px; }

.var-group { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--terra); margin: 14px 0 6px; }
.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit input { min-width: 180px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 14px 20px 14px 56px; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 20px; top: 14px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--display); background: #EEECE8; color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.steps li.current { background: #FFFBF6; }
.steps li.current::before { background: var(--terra); color: #fff; }
.steps li h3 { font-size: 14.5px; margin-bottom: 2px; }
.steps li .step-body { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.sign-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- messages ---------- */
.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.msg { padding: 11px 14px; border-radius: 8px; font-size: 14px; border: 1px solid transparent; }
.msg.success { background: var(--ok-bg); color: var(--ok); border-color: #C9E3D5; }
.msg.error { background: var(--bad-bg); color: var(--bad); border-color: #F0C9C2; }
.msg.warning { background: var(--warn-bg); color: var(--warn); border-color: #F1DDB7; }
.msg.info { background: var(--info-bg); color: var(--info); border-color: #C9DBEA; }

/* ---------- definition lists ---------- */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl-section + .dl-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.dl-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--terra); margin-bottom: 10px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.list li:last-child { border-bottom: 0; }
.list .who { min-width: 0; }
.list .who a { font-weight: 500; }

.callout { background: var(--terra-soft); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; }
.callout.navy { background: var(--navy); color: #fff; }
.callout.navy a { color: #fff; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 30px 20px; text-align: center; background: #FBFAF8; }
.dropzone.drag { border-color: var(--terra); background: var(--terra-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--terra); }

details.disclosure > summary { cursor: pointer; list-style: none; font-weight: 500; color: var(--navy); }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "+ "; color: var(--terra); font-weight: 600; }
details.disclosure[open] > summary::before { content: "– "; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 12px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--faint); font-size: 12.5px; min-width: 104px; flex: none; }

.evidence { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(1200px 500px at 50% -10%, #fff 0%, var(--bg) 70%); }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: block; width: 210px; margin: 0 auto 26px; }
.auth-card .card { padding: 26px; }
.auth-card h1 { font-size: 19px; margin-bottom: 6px; text-align: center; }
.auth-card .lead { text-align: center; color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.auth-card form .field + .field { margin-top: 14px; }
.auth-card .btn { width: 100%; margin-top: 20px; padding: 11px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }

/* ---------- tenant portal ---------- */
.portal-top { background: var(--navy); color: #fff; }
.portal-top .inner { max-width: 880px; margin: 0 auto; padding: 16px 16px 0; }
.portal-top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-top .bar form button, .portal-top .bar a { color: rgba(255, 255, 255, .8); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.portal-top .bar form button:hover { color: #fff; }
.portal-tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; }
.portal-tabs a { color: rgba(255, 255, 255, .75); text-decoration: none; padding: 10px 14px; font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.portal-tabs a:hover { color: #fff; }
.portal-tabs a.on { color: #fff; border-bottom-color: var(--terra); }
.portal-main { max-width: 880px; margin: 0 auto; padding: 26px 16px 60px; }
.hello { margin-bottom: 18px; }
.hello h1 { font-size: 22px; }
.status-hero { padding: 22px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.status-hero .big { font-family: var(--display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-hero.ok { border-left: 4px solid var(--ok); }
.status-hero.bad { border-left: 4px solid var(--bad); }
.status-hero.warn { border-left: 4px solid var(--warn); }
.pay-box { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14px; }
.pay-box dt { color: var(--muted); }
.pay-box dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }


/* ---------- settings tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin: -6px 0 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--terra); }

/* ---------- ticket & stripe status pills ---------- */
.pill.t-open { background: var(--warn-bg); color: var(--warn); }
.pill.t-in_progress { background: var(--info-bg); color: var(--info); }
.pill.t-waiting { background: #EFE7F6; color: #6B4C93; }
.pill.t-resolved, .pill.s-succeeded { background: var(--ok-bg); color: var(--ok); }
.pill.t-closed, .pill.s-canceled, .pill.s-refunded { background: #EEECE8; color: var(--muted); }
.pill.s-pending, .pill.s-processing { background: var(--info-bg); color: var(--info); }
.pill.s-failed { background: var(--bad-bg); color: var(--bad); }

/* ---------- chart ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.tick { height: 2px; width: 14px; border-radius: 0; background: var(--ink); }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart .grid { stroke: #ECE8E1; stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--font); }
.chart .expected { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; }
.chart .col:hover .hit, .chart .col:focus .hit { fill: rgba(23, 42, 61, .05); }
.chart .col:focus { outline: none; }

/* ---------- ticket thread ---------- */
.thread { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-width: 88%; background: #FBFAF8; }
.msg-bubble header { font-size: 13px; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-bubble time { color: var(--faint); font-size: 12px; }
.msg-bubble p { margin: 0 0 .4em; }
.msg-bubble.from-staff { align-self: flex-end; background: #EEF3F8; border-color: #D6E2EE; }
.msg-bubble.internal { align-self: flex-end; background: #FFF7E8; border-color: #F1DDB7; border-style: dashed; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; text-decoration: none; font-size: 12.5px; color: var(--ink); }
.attachment img { width: 96px; height: 72px; object-fit: cover; border-radius: 5px; display: block; }
.attachment span { padding-right: 6px; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 14px; cursor: pointer; font-weight: 500; background: #fff; }
.choice:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(23, 42, 61, .12); }
.choice input { accent-color: var(--navy); margin: 0; }

/* ---------- email template editor ---------- */
.placeholder-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ph { display: flex; justify-content: space-between; gap: 10px; text-align: left; background: #FAF9F6; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; cursor: pointer; font: inherit; color: var(--ink); }
.ph:hover { border-color: var(--terra); }
.ph .faint { font-size: 12px; text-align: right; }
.tox-tinymce { border-radius: 8px !important; border-color: var(--line-strong) !important; }

/* ---------- language switcher ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 4px; }
.lang-switch select { width: auto; padding: 5px 8px; font-size: 13.5px; border-radius: 7px; background: transparent; border-color: transparent; color: inherit; cursor: pointer; }
.lang-switch select:hover { border-color: var(--line-strong); }
.portal-top .lang-switch select { color: #fff; }
.portal-top .lang-switch select option { color: var(--ink); }
.auth-lang { text-align: center; margin-top: 14px; color: var(--muted); }

/* ---------- portal extras ---------- */
.bar-actions { display: flex; align-items: center; gap: 10px; }
.dot-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--terra); color: #fff; font-size: 11px; font-weight: 600; text-align: center; margin-left: 4px; }
.portal-foot { text-align: center; color: var(--faint); font-size: 12.5px; padding: 0 16px 36px; }
.portal-foot a { color: var(--muted); }
.pay-online { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; align-items: start; }
.pay-online .big { font-family: var(--display); font-size: 30px; font-weight: 600; }
.autopay-box { background: #FAF9F6; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.autopay-box p { margin: .4em 0 .8em; }
@media (max-width: 640px) { .pay-online { grid-template-columns: 1fr; } }

.door-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-left: 4px solid var(--terra); }
.door-card svg { color: var(--terra); }
.door-code { font-size: 26px; font-weight: 700; letter-spacing: .08em; }

.dd-invite { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: linear-gradient(90deg, #FDF3EE, #fff 70%); border-color: #F0D6C9; flex-wrap: wrap; }
.dd-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--terra); color: #fff; display: grid; place-items: center; flex: none; }
.dd-text { flex: 1 1 260px; }
.dd-text p { margin: 4px 0 0; color: var(--muted); }
.deposit-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; flex-wrap: wrap; }

/* ---------- public website ---------- */
.btn-light { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-light:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .08); }
.site-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-head { background: rgba(245, 243, 239, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.site-bar { display: flex; align-items: center; gap: 24px; height: 68px; }
.site-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.site-brand img { width: 36px; }
.site-brand span { font-family: var(--display); font-weight: 500; letter-spacing: .22em; font-size: 13px; line-height: 1.25; }
.site-brand small { display: block; font-size: 10px; letter-spacing: .3em; color: var(--muted); }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14.5px; }
.site-nav a:hover { color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 10px; }
.hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.hero-mark { position: absolute; right: -60px; bottom: -70px; width: 560px; opacity: .07; pointer-events: none; }
.hero-inner { padding: 110px 24px 120px; position: relative; }
.hero h1 { font-size: clamp(34px, 5.5vw, 58px); font-weight: 500; max-width: 780px; letter-spacing: -.02em; line-height: 1.08; }
.hero-lead { font-size: 18px; max-width: 620px; color: rgba(255, 255, 255, .78); margin-top: 22px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-cta .btn { padding: 12px 20px; font-size: 15px; }
.eyebrow, .eyebrow-light { font-size: 12.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 600; color: var(--terra); margin-bottom: 10px; }
.eyebrow-light { color: #E8A68C; }
.site-section { padding: 88px 0; }
.site-section.alt { background: #EFECE6; }
.site-section h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 500; letter-spacing: -.015em; max-width: 640px; }
.two-col { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.prose p { font-size: 17px; color: #36475A; line-height: 1.65; }
.room-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 32px; }
.room-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.room-art { height: 170px; display: grid; place-items: center; background: var(--navy); }
.room-art.double { background: #2E4860; }
.room-art.double_bed { background: #3B5A75; }
.room-art.studio { background: #9C5539; }
.room-art img { width: 84px; opacity: .9; }
.room-body { padding: 20px 22px 22px; }
.room-body h3 { font-size: 19px; font-weight: 600; }
.room-body .price { margin: 12px 0 0; font-size: 15px; }
.room-body .price strong { font-family: var(--display); font-size: 22px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.feature.feature-wide { grid-column: span 2; background: var(--navy, #172A3D); color: #fff; border-color: transparent; }
.feature.feature-wide h3 { color: #fff; }
.feature.feature-wide p { color: rgba(255,255,255,.82); }
.feature.feature-wide svg { color: #E8A58A; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feature svg { color: var(--terra); }
.feature h3 { margin: 12px 0 6px; font-size: 16px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }
.areas { margin-top: 36px; }
.areas h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.areas ul { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.areas li { background: #fff; border: 1px solid var(--line); padding: 7px 14px; border-radius: 99px; font-size: 14px; }
.contact { background: var(--navy); color: #fff; }
.contact p { color: rgba(255, 255, 255, .78); font-size: 16px; }
.contact a { color: #fff; }
.contact-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 26px; }
.contact-card .btn { font-size: 16px; padding: 12px 18px; margin-bottom: 12px; }
.contact-card p { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.site-foot { background: #101F2E; color: rgba(255, 255, 255, .6); padding: 36px 0; }
.site-foot a { color: rgba(255, 255, 255, .8); }
.site-foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-logo { width: 120px; }
@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-actions { margin-left: auto; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .site-section { padding: 60px 0; }
  .hero-inner { padding: 72px 24px 84px; }
}
@media (max-width: 520px) {
  .site-wrap { padding: 0 16px; }
  .site-bar { gap: 8px; }
  .site-brand span { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature.feature-wide { grid-column: auto; }
  .hero-inner { padding: 56px 16px 64px; }
  .site-actions .btn { padding: 7px 10px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .brand { padding: 0; }
  .brand img { width: 32px; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; gap: 4px; padding-bottom: 2px; }
  .nav a { padding: 7px 10px; white-space: nowrap; font-size: 13.5px; }
  .nav a.active { box-shadow: inset 0 -3px 0 var(--terra); }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .sidebar-foot strong, .sidebar-foot .who { display: none; }
  .sidebar-foot .links { margin: 0; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  h1 { font-size: 21px; }
  .hide-sm { display: none; }
  th, td { padding: 9px 10px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 21px; }
  .pay-box { grid-template-columns: 1fr; gap: 2px; }
  .pay-box dd { margin-bottom: 8px; }
}
@media print {
  .sidebar, .actions, .btn, form { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
}

/* ---------- public site: language hint, footer languages, cookie bar ---------- */
.lang-suggest { background: var(--navy, #172A3D); text-align: center; padding: 6px 16px; font-size: 14px; }
.lang-suggest a { color: #fff; text-decoration: none; font-weight: 600; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.foot-langs a { color: inherit; opacity: .75; }
.foot-langs a[aria-current] { opacity: 1; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 50;
  background: #fff; color: #172A3D; border-radius: 12px; box-shadow: 0 10px 30px rgba(23,42,61,.22); padding: 16px 18px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1 1 260px; }
.cookie-actions { display: flex; gap: 8px; }

.var-row { display: flex; gap: 8px; align-items: center; }
.var-row .inline-edit { flex: 1; }
.near-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.near-list li { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.near-list svg { color: var(--terra); flex: none; }

/* UPS & ATS page */
.pill.p-ok { background: var(--ok-bg); color: var(--ok); }
.pill.p-warn { background: var(--warn-bg); color: var(--warn); }
.pill.p-bad { background: var(--bad-bg); color: var(--bad); }
.card.p-warn { border-left: 4px solid var(--warn); }
.card.p-bad { border-left: 4px solid var(--bad); }
.power-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chart.power-chart { min-width: 0; }
.chart.power-chart .tick { font-size: 15px; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
/* guarantors in the tenant forms */
.guarantor-row { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.guarantor-row:last-of-type { border-bottom: 0; padding-bottom: 0; }

/* users & roles */
.user-row { align-items: center; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.role-form .input { min-width: 170px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; align-items: start; }
.role-grid .card-head { gap: 12px; }
.role-grid input.role-name { font-weight: 600; font-size: 1rem; flex: 1; min-width: 0; }
.role-matrix { padding: 6px 20px 4px; }
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.role-row:last-child { border-bottom: 0; }
.role-row select { width: auto; min-width: 160px; padding: 5px 10px; font-size: .88rem; }
.role-row select.lvl-none { color: var(--muted); }
.role-row select.lvl-read { background-color: #EEF3F8; }
.role-row select.lvl-write { background-color: #E7F2EA; font-weight: 600; }
.role-new { border-style: dashed; }
.input.input-sm { padding: 6px 10px; font-size: .9rem; height: auto; }

/* read-only access: actions that would change something are hidden */
.main.readonly form[method="post"]:not(.allow-readonly), .main.readonly form[method="POST"]:not(.allow-readonly), .main.readonly .write-only { display: none !important; }
.readonly-note { margin: 0 0 16px; }

/* links to pages that change a section the user may only view (or not open) */
.main[data-cannot~="dashboard"] [data-needs="dashboard"],
.main[data-cannot~="rent"] [data-needs="rent"],
.main[data-cannot~="tenants"] [data-needs="tenants"],
.main[data-cannot~="rooms"] [data-needs="rooms"],
.main[data-cannot~="bank"] [data-needs="bank"],
.main[data-cannot~="payments"] [data-needs="payments"],
.main[data-cannot~="tickets"] [data-needs="tickets"],
.main[data-cannot~="expenses"] [data-needs="expenses"],
.main[data-cannot~="stats"] [data-needs="stats"],
.main[data-cannot~="activity"] [data-needs="activity"] { display: none !important; }

/* tenant area: open the door */
.door-open-card { padding: 18px 20px; display: grid; gap: 14px; }
.door-open-head { display: flex; gap: 12px; align-items: flex-start; }
.door-open-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.door-open-buttons form { flex: 1 1 200px; }
.btn-door { width: 100%; justify-content: center; padding: 14px 18px; font-size: 1rem; }
.tenant-door-toggle { display: flex; align-items: center; gap: 14px; padding: 14px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.tenant-door-toggle > div { flex: 1 1 280px; }
