:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F6F3; --side: #FFFFFF; --surface: #FFFFFF; --surface-2: #F2F3EF;
  --border: #E3E4DF; --photo: #E9EAE4; --text: #121314; --text-2: #3A3F45;
  --muted: #5F656D; --accent: #1F5BD6; --on-accent: #FFFFFF;
  --ok: #1D6E36; --ok-bg: #E3F2E6; --warn: #8A5600; --warn-bg: #FCEFD6;
  --bad: #B3361F; --bad-bg: #FCE5E0; --reported: #5B3FB5; --reported-bg: #EEE8FB;
  --suggested: #0B6E78; --suggested-bg: #DDF2F3;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0C0E; --side: #0E0F12; --surface: #15171A; --surface-2: #1C1F23;
  --border: #262A2F; --photo: #22262B; --text: #F2F3F5; --text-2: #C4C9CF;
  --muted: #9BA1A9; --accent: #8AB4FF; --on-accent: #0B0C0E;
  --ok: #8BD49A; --ok-bg: rgba(139,212,154,.14); --warn: #F2B84B; --warn-bg: rgba(242,184,75,.16);
  --bad: #FF8A73; --bad-bg: rgba(255,138,115,.14); --reported: #C3A6FF; --reported-bg: rgba(195,166,255,.14);
  --suggested: #5FD0D9; --suggested-bg: rgba(95,208,217,.16);
}
:root { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); font-synthesis: none; text-rendering: optimizeLegibility; }
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#app { min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 248px; width: 248px; padding: 18px 13px; border-right: 1px solid var(--border); background: var(--side); display: flex; flex-direction: column; gap: 12px; transition: width .18s ease, flex-basis .18s ease, padding .18s ease; z-index: 20; }
.brand-row { min-height: 45px; display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 750; }
.brand-name { min-width: 0; font-weight: 700; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.brand-org { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.icon-button { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; display: inline-grid; place-items: center; width: 38px; height: 38px; color: var(--text-2); flex: 0 0 auto; }
.icon-button:hover, .button-secondary:hover { background: var(--surface-2); }
.sidebar-toggle { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; font-size: 20px; }
.nav-list { display: grid; gap: 3px; }
.nav-link { color: var(--text-2); text-decoration: none; min-height: 42px; border-radius: 10px; padding: 9px 10px; display: flex; align-items: center; gap: 12px; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.nav-icon { width: 22px; text-align: center; font-size: 17px; flex: 0 0 auto; }
.nav-label { flex: 1; white-space: nowrap; }
.soon-badge, .count-badge { border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; padding: 2px 7px; white-space: nowrap; }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; border-top: 1px solid var(--border); padding: 12px 5px 0; }
.preferences-compact { display: grid; grid-template-columns: 1fr; gap: 10px; }
.main-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 66px; padding: 12px clamp(16px, 2.5vw, 34px); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar-left, .topbar-actions, .month-control, .toolbar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-menu-button { display: none; }
.month-label { min-width: 116px; text-align: center; font-weight: 650; }
.button { min-height: 38px; padding: 8px 13px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { filter: brightness(.96); }
.button-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.button-quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.button-quiet:hover { background: var(--surface-2); }
.main-content { width: 100%; max-width: 1600px; min-width: 0; margin: 0 auto; padding: 26px clamp(16px, 2.5vw, 34px) 44px; }
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 31px); line-height: 1.15; letter-spacing: -.035em; font-weight: 660; }
.page-heading p { color: var(--muted); margin: 7px 0 0; }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .09em; font-weight: 700; margin: 0 0 7px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi-card { min-width: 0; padding: 15px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.kpi-label { color: var(--muted); font-size: 12px; min-height: 35px; }
.kpi-value { font-size: clamp(16px, 1.7vw, 22px); line-height: 1.15; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.025em; white-space: nowrap; }
.kpi-hint { margin-top: 7px; color: var(--muted); font-size: 11px; }
.kpi-value.ok { color: var(--ok); } .kpi-value.reported { color: var(--reported); } .kpi-value.bad { color: var(--bad); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.property-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.property-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.property-card-link { display: block; color: inherit; }
.property-card-link:hover { text-decoration: none; }
.property-cover { position: relative; height: 150px; background: var(--photo); overflow: hidden; }
.property-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder { height: 100%; display: grid; place-items: center; color: var(--muted); background: radial-gradient(circle at 75% 25%, var(--surface) 0 8%, transparent 8.5%), linear-gradient(140deg, var(--photo), var(--surface-2)); }
.photo-placeholder span { border: 1px solid var(--border); padding: 5px 10px; border-radius: 8px; background: var(--surface); font-size: 12px; }
.property-cover-label { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 8px; background: var(--surface); color: var(--text); font-size: 11px; }
.property-card-body { padding: 14px 16px 16px; }
.property-title-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.property-title-line h3 { margin: 0; font-size: 17px; }
.property-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.room-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.room-chip { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 11px; }
.room-chip-name { font-weight: 700; flex: 0 0 auto; }
.room-chip-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-chip[data-status="verified"] { background: var(--ok-bg); color: var(--ok); }
.room-chip[data-status="partial"], .room-chip[data-status="due"] { background: var(--warn-bg); color: var(--warn); }
.room-chip[data-status="overdue"] { background: var(--bad-bg); color: var(--bad); }
.room-chip[data-status="reported"] { background: var(--reported-bg); color: var(--reported); }
.room-chip[data-status="suggested"] { background: var(--suggested-bg); color: var(--suggested); }
.room-chip[data-status="vacant"] { border: 1px dashed var(--border); background: transparent; color: var(--muted); }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.filters-panel { display: none; padding: 15px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.filters-panel.is-open { display: block; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); gap: 10px; align-items: end; }
.field { min-width: 0; display: grid; gap: 5px; }
.field label, .field-label { color: var(--text-2); font-weight: 600; font-size: 12px; }
.field input, .field select, .field textarea, .select-control { width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.field textarea { min-height: 105px; resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 8px; min-height: 39px; }
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--accent); }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); scrollbar-color: var(--muted) var(--surface-2); }
.rent-table { width: 100%; min-width: 1110px; border-collapse: separate; border-spacing: 0; }
.rent-table th, .rent-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.rent-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.rent-table td { font-size: 12px; }
.rent-table tr:last-child td { border-bottom: 0; }
.rent-table tfoot td { font-weight: 700; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right !important; }
.cell-primary { color: var(--text); font-weight: 600; }
.cell-secondary { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.status-pill[data-status="verified"] { color: var(--ok); background: var(--ok-bg); }
.status-pill[data-status="partial"], .status-pill[data-status="due"] { color: var(--warn); background: var(--warn-bg); }
.status-pill[data-status="overdue"] { color: var(--bad); background: var(--bad-bg); }
.status-pill[data-status="reported"] { color: var(--reported); background: var(--reported-bg); }
.status-pill[data-status="suggested"] { color: var(--suggested); background: var(--suggested-bg); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 130px; }
.row-action { min-height: 28px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-2); font-size: 10px; white-space: nowrap; }
.row-action:hover { background: var(--surface-2); }
.inline-edit { width: 165px; min-height: 32px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.empty-state, .loading-state, .error-state { padding: 36px 16px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; background: var(--surface); }
.property-detail { display: grid; gap: 18px; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.property-detail-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; }
.property-detail-header h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
.property-detail-subtitle { margin: 5px 0 0; color: var(--muted); }
.photo-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(120px, 165px); gap: 9px; }
.photo-tile { position: relative; min-width: 0; border-radius: 15px; background: var(--photo); overflow: hidden; }
.photo-tile:first-child { grid-column: span 2; grid-row: span 2; }
.photo-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-caption { position: absolute; left: 9px; bottom: 9px; max-width: calc(100% - 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 7px; padding: 4px 7px; background: var(--surface); color: var(--text); font-size: 11px; }
.photo-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 5px; opacity: 0; transition: opacity .12s ease; }
.photo-tile:hover .photo-tools, .photo-tile:focus-within .photo-tools { opacity: 1; }
.photo-tool { border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; background: var(--surface); color: var(--text); font-size: 10px; }
.upload-tile { min-height: 125px; border: 1.5px dashed var(--muted); background: transparent; color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; padding: 12px; cursor: pointer; }
.upload-tile.is-dragging { border-color: var(--accent); background: var(--surface-2); }
.upload-tile strong { font-size: 12px; }
.upload-tile span { color: var(--muted); font-size: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; }
.detail-columns { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.4fr); gap: 14px; }
.surface-card { min-width: 0; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); padding: 18px; }
.surface-card h2 { margin: 0 0 13px; font-size: 16px; }
.property-facts { margin: 0; display: grid; grid-template-columns: minmax(100px, .6fr) 1fr; gap: 9px 14px; font-size: 12px; }
.property-facts dt { color: var(--muted); }
.property-facts dd { margin: 0; color: var(--text-2); }
.unit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.unit-photo { height: 125px; background: var(--photo); overflow: hidden; }
.unit-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.unit-info { padding: 12px; }
.unit-title-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.unit-title-line h3 { margin: 0; font-size: 14px; }
.unit-title-line strong { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-detail { color: var(--muted); font-size: 11px; margin-top: 5px; }
.unit-actions { display: flex; gap: 7px; margin-top: 11px; }
.unit-actions .button { flex: 1; min-width: 0; padding: 6px; min-height: 33px; font-size: 11px; }
.tenant-list { display: grid; gap: 9px; }
.tenant-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px 16px; }
.tenant-card h3 { margin: 0; font-size: 15px; }
.tenant-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.tenant-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.preference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.preference-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.preference-group legend { margin-bottom: 7px; padding: 0; }
.segmented { display: flex; gap: 5px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.segmented button { min-height: 36px; flex: 1; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px #0002; font-weight: 650; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: #0008; }
.modal { width: min(600px, 100%); max-height: min(90vh, 860px); overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 70px #0004; }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 19px; border-bottom: 1px solid var(--border); background: var(--surface); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-body { display: grid; gap: 13px; padding: 18px 19px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 19px 18px; }
.modal-footer .button { min-width: 105px; }
.allocation-list { display: grid; gap: 9px; }
.allocation-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr) auto; align-items: end; gap: 8px; }
.allocation-summary { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 9px; font-size: 12px; color: var(--muted); }
.alert { border-radius: 10px; padding: 10px 12px; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.toast-region { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: grid; gap: 8px; }
.toast { max-width: min(360px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px #0002; padding: 11px 14px; }
.sidebar-collapsed .sidebar { flex-basis: 74px; width: 74px; padding-inline: 9px; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-label, .sidebar-collapsed .soon-badge, .sidebar-collapsed .sidebar-footer-label { display: none; }
.sidebar-collapsed .brand-row { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .sidebar-toggle { display: none; }
.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 5px; }
.sidebar-collapsed .nav-icon { width: auto; }
.sidebar-collapsed .sidebar-footer { padding-inline: 0; }
.sidebar-collapsed .preferences-compact { grid-template-columns: 1fr; }
.review-active { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); }
@media (max-width: 1120px) {
  .sidebar { flex-basis: 220px; width: 220px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-left, .topbar-actions { width: 100%; justify-content: space-between; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 -290px; width: 280px; max-width: calc(100vw - 56px); transition: left .2s ease; box-shadow: 12px 0 32px #0002; }
  .mobile-nav-open .sidebar { left: 0; }
  .mobile-scrim { display: none; position: fixed; inset: 0; z-index: 19; background: #0007; }
  .mobile-nav-open .mobile-scrim { display: block; }
  .mobile-menu-button { display: inline-grid; }
  .main-column { width: 100%; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar-left { justify-content: flex-start; }
  .topbar-actions { width: 100%; max-width: 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-start; padding: 1px 1px 4px; }
  .topbar-actions .button { flex: 0 0 auto; min-height: 35px; padding: 7px 10px; font-size: 12px; }
  .month-label { min-width: 100px; font-size: 12px; }
  .main-content { padding: 19px 12px 34px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-card { padding: 12px; border-radius: 13px; }
  .kpi-label { min-height: 28px; font-size: 11px; }
  .kpi-hint { font-size: 10px; }
  .property-grid { grid-template-columns: 1fr; }
  .property-cover { height: 135px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid .filter-wide { grid-column: 1 / -1; }
  .toolbar-row { align-items: stretch; }
  .toolbar-row > * { flex: 1 1 auto; }
  .rent-table { min-width: 1040px; }
  .table-scroll { border-radius: 12px; }
  .photo-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 125px; gap: 7px; }
  .photo-tile:first-child { grid-column: span 2; grid-row: span 2; }
  .photo-tools { opacity: 1; }
  .detail-columns { grid-template-columns: 1fr; }
  .unit-grid { grid-template-columns: 1fr; }
  .unit-photo { height: 150px; }
  .tenant-detail-grid { grid-template-columns: 1fr; }
  .preference-grid { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: end; padding: 8px; }
  .modal { max-height: 92vh; border-radius: 18px 18px 12px 12px; }
  .allocation-row { grid-template-columns: minmax(0, 1fr) minmax(90px, .5fr) auto; }
}
@media (max-width: 380px) {
  .room-list { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-grid .filter-wide { grid-column: auto; }
  .month-label { min-width: 82px; }
  .button { padding-inline: 9px; }
  .property-detail-header .button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
