:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --card: #fff;
  --text: #202632;
  --muted: #89909e;
  --border: #e9ebf1;
  --primary: #6258d9;
  --primary-hover: #5147c4;
  --primary-text: #fff;
  --danger: #d64f5c;
  --ok: #26a879;
  --warn: #d39332;
  --shadow: 0 8px 24px rgba(31, 39, 61, .045);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151d;
  --card: #1a202a;
  --text: #e8ebf1;
  --muted: #9ba5b4;
  --border: #2b3442;
  --primary: #8278f1;
  --primary-hover: #9289ff;
  --primary-text: #11131d;
  --danger: #f07883;
  --ok: #54d5a5;
  --warn: #f0ba61;
  --shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11151d;
    --card: #1a202a;
    --text: #e8ebf1;
    --muted: #9ba5b4;
    --border: #2b3442;
    --primary: #8278f1;
    --primary-hover: #9289ff;
    --primary-text: #11131d;
    --danger: #f07883;
    --ok: #54d5a5;
    --warn: #f0ba61;
    --shadow: 0 8px 24px rgba(0, 0, 0, .12);
  }
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.topbar { height: 70px; display: flex; justify-content: space-between; align-items: center; padding: 0 34px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-size: 20px; font-weight: 750; letter-spacing: -.8px; }
.brand-mark { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--primary); color: white; font-size: 18px; font-weight: 700; letter-spacing: 0; box-shadow: 0 4px 9px color-mix(in srgb, var(--primary) 28%, transparent); }
.brand-period { color: var(--primary); }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1.15px; }
.actions { display: flex; align-items: center; gap: 12px; }
.language-picker { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.language-picker > span { font-size: 14px; }
.language-picker select { width: auto; margin: 0; padding: 7px 16px 7px 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; cursor: pointer; color-scheme: light dark; }
.language-picker select option { background: var(--card); color: var(--text); }
.language-picker select:focus { box-shadow: none; }
.topbar-divider { height: 28px; border-left: 1px solid var(--border); }
.shell { max-width: 1540px; margin: 0 auto; padding: 0 34px; }
.app-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 38px; align-items: start; }
.sidebar { position: sticky; top: 70px; display: flex; flex-direction: column; min-height: calc(100vh - 70px); padding: 30px 0 20px; }
.sidebar-label, .eyebrow { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.15px; }
.sidebar-label { padding: 0 13px; margin-bottom: 12px; }
.side-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; border: 0; border-radius: 9px; background: transparent; color: #737b8b; text-align: left; font-size: 13px; font-weight: 550; transition: background .15s, color .15s; }
.nav-link:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); color: var(--primary); }
.nav-link.active { background: color-mix(in srgb, var(--primary) 11%, var(--card)); color: var(--primary); font-weight: 650; }
.nav-icon { display: inline-grid; width: 20px; place-items: center; font-size: 17px; line-height: 1; }
.nav-count { display: inline-grid; min-width: 19px; height: 19px; margin-left: auto; place-items: center; border-radius: 99px; background: #fff0f1; color: #c9505a; font-size: 9px; font-weight: 700; }
:root[data-theme="dark"] .nav-count { background: #452b33; color: #ff9aa3; }
.sidebar-note { margin-top: auto; padding: 16px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.sidebar-note-icon { display: grid; width: 27px; height: 27px; margin-bottom: 13px; place-items: center; border-radius: 8px; background: #f2efff; color: #7569df; }
:root[data-theme="dark"] .sidebar-note-icon { background: #302d4d; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 19px 4px 0; color: var(--muted); font-size: 10px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #42bd8b; box-shadow: 0 0 0 3px color-mix(in srgb, #42bd8b 15%, transparent); }
.workspace { min-width: 0; padding: 35px 0 55px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 27px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filter-bar input { flex: 1 1 280px; max-width: 420px; margin: 0; }
.filter-bar select { width: auto; min-width: 150px; margin: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 12px; }
input[readonly] { background: var(--card); color: var(--muted); cursor: default; }
h1, h2, h3, p { margin-top: 0; }
.page-heading h1 { margin: 7px 0 4px; font-size: clamp(25px, 3vw, 31px); letter-spacing: -1.1px; line-height: 1.2; font-weight: 680; }
.page-heading p { margin: 0; font-size: 12px; }
h2 { margin-bottom: 5px; font-size: 15px; letter-spacing: -.25px; }
h3 { margin: 0; font-size: 14px; letter-spacing: -.2px; }
.muted { color: var(--muted); font-size: 11px; }
.primary-action { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 0; border-radius: 8px; background: var(--primary); color: var(--primary-text); font-size: 12px; font-weight: 650; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 18%, transparent); }
.primary-action:hover, button:not(.ghost):not(.danger):not(.nav-link):not(.tab):not(.text-action):hover { background: var(--primary-hover); }
.primary-action span { font-size: 17px; line-height: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.stat, .card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.stat { min-width: 0; padding: 16px 17px 15px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 550; }
.stat-icon, .subtle-icon, .followup-icon, .deposit-icon { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 700; }
.stat-blue .stat-icon { color: #5a78dc; background: #edf1ff; }
.stat-green .stat-icon { color: #229d78; background: #e8f7f1; }
.stat-amber .stat-icon { color: #c78a2d; background: #fff5e5; }
.stat-violet .stat-icon { color: #8065cc; background: #f2edff; }
:root[data-theme="dark"] .stat-blue .stat-icon { background: #28314c; }
:root[data-theme="dark"] .stat-green .stat-icon { background: #203a35; }
:root[data-theme="dark"] .stat-amber .stat-icon { background: #453825; }
:root[data-theme="dark"] .stat-violet .stat-icon { background: #352e49; }
.num { overflow: hidden; margin: 10px 0 4px; font-size: clamp(21px, 2.3vw, 27px); font-weight: 680; letter-spacing: -.8px; text-overflow: ellipsis; white-space: nowrap; }
.stat-detail { color: var(--muted); font-size: 10px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(230px, 1fr); gap: 14px; margin-bottom: 34px; }
.card { padding: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-heading p { margin: 4px 0 0; }
.subtle-icon { color: #7770d9; background: #f2f0ff; }
:root[data-theme="dark"] .subtle-icon { background: #302d4d; }
.occupancy-summary { display: flex; align-items: center; gap: 14px; margin: 21px 0 16px; }
.occupancy-percent { color: var(--text); font-size: 30px; font-weight: 680; letter-spacing: -1px; }
.occupancy-summary strong { font-size: 12px; }
.occupancy-summary .muted { margin-top: 4px; }
.occupancy-track { overflow: hidden; height: 7px; border-radius: 99px; background: #eef0f5; }
:root[data-theme="dark"] .occupancy-track { background: #2b3340; }
.occupancy-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7669e7, #a49af9); transition: width .3s ease; }
.occupancy-legend { display: flex; gap: 25px; margin-top: 13px; }
.occupancy-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.occupancy-legend strong { color: var(--text); font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.occupied-dot { background: #796ce0; }
.vacant-dot { background: #d4d7e1; }
.deposit-icon { color: #259d78; background: #e8f7f1; }
:root[data-theme="dark"] .deposit-icon { background: #203a35; }
.deposit-total { margin: 18px 0 15px; font-size: 28px; font-weight: 680; letter-spacing: -.8px; }
.deposit-footnote { display: flex; align-items: center; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.deposit-check { color: var(--ok); font-weight: 800; }
.followups-heading { margin-bottom: 14px; }
.followups-heading h2 { margin: 6px 0 0; font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.followups-grid { align-items: start; }
.followup-card { min-height: 176px; padding: 17px 18px 12px; }
.followup-icon { width: 29px; height: 29px; font-size: 12px; }
.rent-icon { color: #299b77; background: #e9f7f2; }
.lease-icon { color: #7867ce; background: #f1edff; }
:root[data-theme="dark"] .rent-icon { background: #203a35; }
:root[data-theme="dark"] .lease-icon { background: #352e49; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.followup-person { display: flex; min-width: 0; align-items: center; gap: 9px; }
.followup-person > div { overflow: hidden; }
.followup-person strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.followup-person .muted { overflow: hidden; margin-top: 3px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; flex: 0 0 auto; width: 30px; height: 30px; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 700; }
.avatar-blue { color: #5976d3; background: #edf1ff; }
.avatar-violet { color: #7764c7; background: #f1edff; }
:root[data-theme="dark"] .avatar-blue { background: #28314c; }
:root[data-theme="dark"] .avatar-violet { background: #352e49; }
.followup-trailing { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 5px; }
.followup-amount { font-size: 11px; }
.date-chip { padding: 4px 7px; border-radius: 6px; color: #687386; background: #f3f5f8; font-size: 9px; white-space: nowrap; }
:root[data-theme="dark"] .date-chip { color: #bac2cf; background: #28303b; }
.date-overdue { color: #c9505a; background: #fff0f1; }
:root[data-theme="dark"] .date-overdue { color: #ff9aa3; background: #452b33; }
.text-action { padding: 2px 0; border: 0; background: transparent; color: var(--primary); font-size: 10px; font-weight: 650; }
.empty-state { margin: 0; padding: 21px 2px 13px; color: var(--muted); font-size: 11px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btns { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
button { padding: 9px 13px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary); color: var(--primary-text); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; transition: background .15s, border-color .15s, transform .15s; }
button:active { transform: translateY(1px); }
button.ghost { border-color: var(--border); background: transparent; color: var(--text); }
button.ghost:hover { background: var(--bg); }
button.danger { border-color: var(--danger); background: transparent; color: var(--danger); }
button.small { padding: 6px 9px; font-size: 10px; }
.icon-button { width: 34px; height: 34px; padding: 0; font-size: 17px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 650; border: 1px solid currentColor; }
.ACTIVE, .vacant-no { color: var(--ok); }
.EXPIRED { color: var(--warn); }
.ENDED, .vacant { color: var(--muted); }
label { display: block; margin: 13px 0; color: var(--muted); font-size: 11px; font-weight: 550; }
label.check { display: flex; gap: 9px; align-items: center; color: var(--text); }
input { display: block; width: 100%; margin-top: 6px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 8px; outline: none; background: var(--bg); color: var(--text); font: inherit; font-size: 12px; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent); }
input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--primary); }
.narrow { width: min(460px, 100%); margin: 55px auto; }
#authView { padding: 28px; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.auth-brand strong { font-size: 16px; }
.auth-brand .muted { margin-top: 4px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 9px; background: var(--bg); }
.tab { flex: 1; padding: 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(25, 32, 50, .09); }
.auth-submit { width: 100%; margin-top: 8px; padding: 11px; }
.settings-card { width: min(600px, 100%); padding: 22px; }
.settings-intro { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.settings-intro h2 { margin: 0; }
.settings-intro p { margin: 4px 0 0; }
.settings-hint { margin: 7px 0 18px; line-height: 1.6; }
.invite-details { display: grid; gap: 5px; margin: 0 0 18px; padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.invite-person { font-size: 14px; font-weight: 650; }
.invite-login { margin-top: 15px; }
.tenant-portal-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, 1fr); gap: 15px; margin-bottom: 18px; align-items: start; }
.tenant-due-card, .tenant-contact-card, .tenant-history-card { padding: 21px; }
.tenant-due-card .section-heading h2 { margin: 5px 0 0; font-size: 18px; }
.due-payment { margin: 21px 0 7px; padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.due-payment-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.due-amount { display: block; margin: 12px 0 5px; font-size: 29px; letter-spacing: -.7px; }
.payment-status { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 9px; font-weight: 650; white-space: nowrap; }
.payment-due, .payment-rejected { color: #be5960; background: #fff0f1; }
.payment-pending { color: #a47728; background: #fff5e5; }
.payment-approved { color: #268b6d; background: #e9f7f2; }
:root[data-theme="dark"] .payment-due, :root[data-theme="dark"] .payment-rejected { background: #452b33; color: #ff9aa3; }
:root[data-theme="dark"] .payment-pending { background: #453825; color: #f0ba61; }
:root[data-theme="dark"] .payment-approved { background: #203a35; color: #54d5a5; }
.proof-form { margin-top: 18px; }
.proof-form label { margin-bottom: 10px; }
.proof-form input[type="file"] { font-size: 10px; }
.proof-form button { width: 100%; }
.proof-form button:disabled, .proof-form input:disabled { cursor: not-allowed; opacity: .6; }
.tenant-contact-card .eyebrow { margin-bottom: 9px; }
.tenant-contact-card h2 { font-size: 17px; }
.tenant-rent-detail { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 11px; }
.tenant-rent-detail:first-of-type { margin-top: 16px; }
.tenant-rent-detail span { color: var(--muted); }
.tenant-history-card .section-heading { margin-bottom: 7px; }
.payment-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.payment-history-row:last-child { border-bottom: 0; }
.payment-history-row > div:first-child strong { font-size: 11px; }
.payment-history-row .muted { margin-top: 4px; font-size: 10px; }
.payment-history-amount { font-size: 11px; white-space: nowrap; }
.review-note { margin: 9px 0 0; color: var(--danger); font-size: 10px; line-height: 1.5; }
.review-card > .muted { margin: 8px 0 0; }
.review-details { display: flex; align-items: center; gap: 12px; margin-top: 13px; font-size: 11px; }
.account-ready { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 99px; background: #e9f7f2; color: #268b6d; font-size: 9px; font-weight: 650; }
:root[data-theme="dark"] .account-ready { background: #203a35; color: #54d5a5; }
dialog { width: min(480px, 94vw); border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--text); padding: 20px; box-shadow: 0 18px 65px rgba(16, 22, 38, .2); }
dialog h3 { margin-bottom: 18px; }
dialog::backdrop { background: rgba(14, 18, 28, .5); backdrop-filter: blur(2px); }
.doc { padding: 12px 0; border-bottom: 1px solid var(--border); }
.doc input[type="file"] { padding: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--card); padding: 11px 16px; border-radius: 9px; z-index: 20; max-width: 90vw; box-shadow: var(--shadow); font-size: 12px; }
.toast.error { background: var(--danger); color: #fff; }
.toast { margin: 0; border: 0; inset: auto auto 22px 50%; }
.toast.hidden { display: none; }
button.loading { position: relative; color: transparent !important; pointer-events: none; }
button.loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1000px) {
  .shell { padding: 0 24px; }
  .app-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar { height: 62px; padding: 0 17px; }
  .shell { padding: 0 17px; }
  .app-layout { display: block; }
  .sidebar { position: static; min-height: auto; padding: 14px 0 0; }
  .sidebar-label, .sidebar-note, .sidebar-footer { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 4px; }
  .nav-link { flex: 0 0 auto; justify-content: center; gap: 7px; width: auto; padding: 9px 11px; font-size: 11px; }
  .nav-icon { font-size: 15px; }
  .workspace { padding: 25px 0 40px; }
  .grid.two { grid-template-columns: 1fr; }
  .tenant-portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .actions { gap: 8px; }
  .language-picker { gap: 3px; padding: 0 6px; }
  .language-picker select { max-width: 88px; padding-right: 12px; font-size: 10px; }
  .page-heading { align-items: flex-start; }
  .page-actions { justify-content: flex-start; }
  .filter-bar input { max-width: none; }
  .page-heading h1 { font-size: 24px; }
  .primary-action { gap: 5px; padding: 9px 10px; font-size: 10px; }
  .stats { gap: 9px; }
  .stat { padding: 12px; }
  .stat-label { font-size: 9px; }
  .num { font-size: 21px; }
  .overview-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 26px; }
  .occupancy-summary { margin: 16px 0 13px; }
  .card { padding: 15px; }
  .followup-card { padding: 14px; }
  .payment-history-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .review-details { flex-wrap: wrap; gap: 7px 12px; }
}
