:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --panel: #fffdf8;
  --ink: #101927;
  --muted: #6f756f;
  --line: #d8d1c5;
  --brand: #071b31;
  --brand-2: #7a4f2d;
  --accent: #b88a44;
  --danger: #a84c45;
  --good: #2f5d50;
  --shadow: 0 16px 38px rgba(7, 27, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
}

.auth-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.auth-head {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(7, 27, 49, 0.18);
}

.auth-head p:not(.eyebrow),
.auth-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.auth-option-grid {
  display: grid;
  gap: 8px;
}

.auth-check {
  display: grid !important;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px !important;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
  color: var(--ink) !important;
}

.auth-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.auth-check span {
  display: grid;
  gap: 2px;
}

.auth-check b {
  color: var(--brand);
  font-size: 13px;
}

.auth-check small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-secondary-actions .text-button {
  min-height: 40px;
  padding: 0 10px;
}

.auth-status {
  min-height: 20px;
}

.auth-security-note {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, var(--bg) 78%, rgba(244, 247, 244, 0));
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(7, 27, 49, 0.14);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.08;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-button,
.language-switch,
.text-button,
.primary-icon,
.primary-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
}

.ghost-button {
  padding: 0 12px;
  background: var(--panel);
  color: var(--brand);
  border: 1px solid var(--line);
  font-weight: 800;
}

.language-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  width: 86px;
  padding: 3px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
}

.language-switch::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: calc(50% - 3px);
  border-radius: 6px;
  background: var(--brand);
  transition: transform 160ms ease;
}

.language-switch span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
}

body[data-lang="zh"] .language-switch span:first-child,
body[data-lang="en"] .language-switch span:last-child {
  color: #fff;
}

body[data-lang="en"] .language-switch::before {
  transform: translateX(100%);
}

.primary-icon {
  width: 42px;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.primary-button {
  width: 100%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.text-button {
  padding: 0 6px;
  background: transparent;
  color: var(--brand-2);
  font-weight: 800;
}

.compact-button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-panel {
  padding: 18px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
}

.summary-panel .summary-headline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
}

.summary-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.cashflow-panel {
  margin-top: 14px;
  background: #1f3346;
}

.summary-panel span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.summary-panel strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-grid article,
.summary-action {
  min-height: 78px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  text-align: left;
}

.summary-grid strong,
.summary-action strong {
  margin-top: 8px;
  font-size: 18px;
}

.summary-action {
  cursor: pointer;
}

.summary-action:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}

.alert-list,
.property-list,
.ledger-list,
.ledger-category-grid,
.people-list,
.reminder-list,
.report-grid,
.report-category-grid,
.monthly-ledger-grid,
.owner-yield-grid,
.my-profit-grid,
.settlement-list {
  display: grid;
  gap: 10px;
}
.my-profit-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.my-profit-metrics4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  .my-profit-metrics4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.export-owner-list {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
}
.export-period-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  max-height: 30vh;
  overflow-y: auto;
}
.export-split {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.export-split-title {
  margin: 0 0 2px;
}
.export-split-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.export-split-opt input {
  flex: none;
  width: auto;
  margin: 0;
}
.export-q-year {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.export-q-year > b {
  min-width: 48px;
  font-size: 13px;
}
.export-q-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.export-q-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 13px;
}
.export-q-chip:has(input:checked) {
  background: var(--brand-2, #1f6fb2);
  color: #fff;
  border-color: var(--brand-2, #1f6fb2);
}
.export-owner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 14px;
}
.export-owner-list .export-owner-row:last-child {
  border-bottom: none;
}
.export-owner-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
.export-owner-all {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f4f2ec;
}
.export-group-head {
  background: #eef0ee;
  font-weight: 700;
}

/* 云同步状态 */
.view-only-banner {
  display: none;
  text-align: center;
  background: #2a2620;
  color: #f3ecd8;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  letter-spacing: 0.02em;
}
body.is-readonly .view-only-banner {
  display: block;
}
body.is-readonly #openAddModal {
  display: none;
}
body.is-readonly #addPropertyFromDashboard,
body.is-readonly #addPropertyButton,
body.is-readonly #ledgerAddRecord,
body.is-readonly #addSettlementBtn,
body.is-readonly #addSettleOwnerBtn,
body.is-readonly #addSaleBtn,
body.is-readonly #settingsSeedData,
body.is-readonly #settingsImportBackup,
body.is-readonly #settingsExportBackup,
body.is-readonly #exportBackup,
body.is-readonly #backupNowBtn,
body.is-readonly #backupLaterBtn,
body.is-readonly #deleteLocalAccount,
body.is-readonly .alert-dismiss,
body.is-readonly .alert-restore,
body.is-readonly .property-status-control,
body.is-readonly .edit-property-btn,
body.is-readonly .move-out-btn,
body.is-readonly .new-lease-btn,
body.is-readonly .record-lease-btn,
body.is-readonly .restore-period-btn,
body.is-readonly .clear-lease-btn,
body.is-readonly .sale-detail-btn,
body.is-readonly .quick-expenses,
body.is-readonly .settlement-edit-action,
body.is-readonly .lease-card-actions,
body.is-readonly .edit-refund-btn {
  display: none !important;
}
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.sync-status {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: default;
}
.sync-status.ok {
  color: var(--good);
  border-color: rgba(47, 93, 80, 0.3);
  background: #eef4f0;
}
.sync-status.syncing,
.sync-status.local {
  color: var(--muted);
}
.sync-status.error {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  cursor: pointer;
}

/* 备份提醒横幅 */
.backup-reminder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbf3e4;
  border: 1px solid var(--brand-2);
  border-left: 5px solid var(--brand-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.backup-reminder-text {
  flex: 1 1 220px;
  min-width: 0;
}
.backup-reminder-text strong {
  display: block;
  color: var(--brand-2);
  font-size: 14px;
  margin-bottom: 2px;
}
.backup-reminder-text span {
  color: var(--brand);
  font-size: 13px;
  line-height: 1.5;
}
.backup-reminder-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.backup-reminder-actions .primary-button {
  padding: 8px 16px;
  font-size: 13px;
}
.backup-reminder-actions .ghost-button {
  padding: 8px 12px;
  font-size: 13px;
}
.export-unit-row {
  padding-left: 30px;
}
.export-unit-row span {
  color: var(--muted);
  font-size: 13px;
}

.summary-headline.clickable-headline {
  cursor: pointer;
  border-radius: 8px;
  margin: -4px;
  padding: 4px;
  transition: background 0.15s ease;
}
.summary-headline.clickable-headline:hover,
.summary-headline.clickable-headline:active {
  background: rgba(255, 255, 255, 0.08);
}

/* 业主对账单 */
.owner-card-actions .statement-btn {
  color: var(--brand);
  font-weight: 800;
}
.statement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.statement-head strong {
  font-size: 17px;
  font-weight: 800;
  display: block;
}
.statement-head span {
  color: var(--muted);
  font-size: 12px;
}
.statement-export {
  padding: 8px 14px;
  font-size: 13px;
}
.statement-share-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.statement-h {
  margin: 16px 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
}
.statement-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.statement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.statement-table th,
.statement-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.statement-table th:first-child,
.statement-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
}
.statement-table thead th {
  background: #e8dccb;
  color: var(--brand);
  font-weight: 800;
  position: sticky;
  top: 0;
}
.statement-table thead th:first-child {
  background: #e8dccb;
}
.statement-table tbody tr.statement-row {
  cursor: pointer;
}
.statement-table tbody tr.statement-row:hover td {
  background: #f3ede2;
}
.statement-table tbody tr.statement-row:hover td:first-child {
  background: #f3ede2;
}
.statement-table tfoot td {
  background: #f2f6f4;
  font-weight: 800;
  border-top: 2px solid var(--line);
}
.statement-pos {
  color: var(--good);
  font-weight: 700;
}
.statement-neg {
  color: var(--danger);
  font-weight: 700;
}

.cheque-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ledger-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.ledger-summary article {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}
.ledger-summary article.calc-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ledger-summary article.calc-clickable:hover,
.ledger-summary article.calc-clickable:active {
  border-color: var(--brand-2);
  background: #f3ede2;
}
.ledger-summary article.calc-clickable span {
  color: var(--brand-2);
}

.ledger-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ledger-summary .negative strong {
  color: var(--danger);
}

.ledger-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.ledger-tools label {
  display: grid;
  gap: 6px;
}

.ledger-tools label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-tools .text-button {
  min-height: 44px;
  padding: 0 14px;
}

.ledger-category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ledger-category-card {
  width: 100%;
  min-height: 94px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}

.ledger-category-card.expense {
  border-left-color: var(--danger);
}

.ledger-category-card.active {
  border-color: var(--brand-2);
  box-shadow: 0 8px 24px rgba(129, 83, 43, 0.16);
}

.ledger-category-card span,
.ledger-category-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ledger-category-card strong,
.ledger-category-card b {
  display: block;
  margin-top: 5px;
}

.ledger-category-card strong {
  font-size: 15px;
}

.ledger-category-card b {
  color: var(--ink);
  font-size: 18px;
}

.alert-card,
.property-card,
.ledger-card,
.person-card,
.reminder-card,
.report-card,
.settlement-card,
.cheque-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}

.alert-card {
  border-left: 5px solid var(--accent);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.alert-card.danger {
  border-left-color: var(--danger);
}

.alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.alert-body.alert-clickable {
  cursor: pointer;
}
.alert-body.alert-clickable:hover strong {
  text-decoration: underline;
}

.alert-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--ink-2, #6b6354);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}
.alert-dismiss:hover {
  background: #f0ece3;
  color: #b4232a;
}
.alert-restore {
  display: block;
  margin: 4px auto 0;
  font-size: 12px;
}

.cheque-summary-card {
  min-height: 72px;
  border-left: 4px solid var(--line);
}

.cheque-summary-card.warning {
  border-left-color: var(--accent);
}

.cheque-summary-card.danger {
  border-left-color: var(--danger);
}

button.cheque-summary-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
}

button.cheque-summary-card:hover {
  box-shadow: 0 10px 26px rgba(7, 27, 49, 0.14);
}

button.cheque-summary-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.alert-card strong,
.ledger-card strong,
.person-card strong,
.reminder-card strong,
.report-card strong,
.settlement-card strong,
.cheque-summary-card strong {
  display: block;
  font-size: 15px;
}

.alert-card span,
.ledger-card span,
.person-card span,
.reminder-card span,
.report-card span,
.settlement-card span,
.cheque-summary-card span,
.property-card p,
.meta-grid span,
.metric-row span {
  color: var(--muted);
  font-size: 12px;
}

.cheque-summary-card strong {
  margin-top: 6px;
  font-size: 20px;
}

.cheque-reminder-hint {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.cheque-date-card {
  border-left: 5px solid var(--line);
}

.cheque-date-card.warning {
  border-left-color: var(--accent);
}

.cheque-date-card.danger {
  border-left-color: var(--danger);
}

.cheque-date-card.settled {
  opacity: 0.74;
}

.cheque-date-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cheque-date-top b {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1e8dd;
  color: var(--brand-2);
  font-size: 11px;
}

.cheque-date-card.warning .cheque-date-top b {
  background: #f6ead9;
  color: #9a681e;
}

.cheque-date-card.danger .cheque-date-top b {
  background: #f5e4df;
  color: var(--danger);
}

.cheque-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.cheque-date-grid div {
  min-height: 56px;
  padding: 9px;
  border-radius: 8px;
  background: #faf8f2;
}

.cheque-date-grid strong {
  margin-top: 4px;
}

.cheque-date-actions,
.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.modal-actions .primary-button,
.modal-actions .ghost-button {
  width: 100%;
  min-height: 42px;
}

.modal-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reminder-modal-list {
  display: grid;
  gap: 8px;
}

.reminder-modal-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.reminder-modal-card.danger {
  border-left-color: var(--danger);
}

.reminder-modal-card span,
.reminder-modal-card b {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reminder-modal-card b {
  color: var(--brand-2);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #efe6dc;
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.vacant {
  background: #f6ead9;
  color: #9a681e;
}

.status-pill.maintenance {
  background: #f5e4df;
  color: var(--danger);
}

.status-pill.movedOut {
  background: #ecebea;
  color: #58625f;
}

.status-pill.sold {
  background: #e9edf4;
  color: #36547d;
}

.status-pill.litigation {
  background: #f3e2ea;
  color: #9a2a52;
}

.card-period-tag {
  font-size: 12px;
  font-weight: 800;
  color: #0b7d70;
  background: rgba(14, 159, 142, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  cursor: pointer;
}
.card-period-tag:hover {
  background: rgba(14, 159, 142, 0.16);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 12px;
}

.metric-row div {
  min-height: 60px;
  padding: 10px;
  border-radius: 8px;
  background: #faf8f2;
}

.metric-row b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.meta-grid b {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.property-status-control {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.property-status-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vacancy-reason-control {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.ledger-add-record {
  width: 100%;
  margin: 6px 0 10px;
}

.card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.card-action {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-2);
  font-weight: 900;
}

.quick-expenses {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.quick-expenses > span,
.file-list > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-expenses div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 6px;
}

.quick-expenses button {
  min-height: 38px;
  padding: 6px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.file-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #faf8f2;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

.restricted-file {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7f1ea;
  color: var(--muted);
  font-size: 12px;
}

.file-list a b {
  color: var(--brand-2);
  font-size: 11px;
}

.file-list a small,
.restricted-file small {
  color: var(--muted);
}

.restricted-file b {
  color: var(--danger);
  font-size: 11px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 118px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-button {
  align-self: end;
  padding-inline: 14px;
  white-space: nowrap;
}

.search,
dialog label {
  display: grid;
  gap: 6px;
}

.search span,
dialog label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dialog label small {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 44px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 11px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eaf0ec;
}

.segmented button {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 6px 16px rgba(7, 27, 49, 0.10);
}

.report-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.report-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
  gap: 10px;
  margin-bottom: 14px;
}

.report-meta > div,
.owner-filter {
  display: grid;
  gap: 6px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.report-meta span,
.owner-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-meta strong {
  font-size: 15px;
  line-height: 1.25;
}

.report-period-filter strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-action,
.report-category-card,
.monthly-ledger-card {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
}

.report-action:focus-visible,
.report-category-card:focus-visible,
.monthly-ledger-card:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.report-category-grid,
.monthly-ledger-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-category-card {
  min-height: 92px;
  padding: 13px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}

.report-category-card.income {
  border-left: 5px solid var(--good);
}

.report-category-card.expense {
  border-left: 5px solid var(--danger);
}

.report-category-card span,
.report-category-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-category-card strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 18px;
}

.monthly-ledger-card {
  display: grid;
  gap: 10px;
  min-height: 158px;
  padding: 13px;
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}

.monthly-ledger-card.negative {
  border-left-color: var(--danger);
}

.monthly-ledger-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.monthly-ledger-top strong {
  font-size: 18px;
}

.monthly-ledger-top span,
.monthly-ledger-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monthly-ledger-card small {
  display: block;
}

.monthly-ledger-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.monthly-ledger-metrics div {
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: #faf8f2;
}

.monthly-ledger-metrics span,
.monthly-breakdown-card span,
.monthly-breakdown-card small,
.monthly-property-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.monthly-ledger-metrics b,
.monthly-breakdown-card strong,
.monthly-property-row b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.monthly-detail-section {
  display: grid;
  gap: 8px;
}

.monthly-detail-section h3 {
  font-size: 14px;
}

.monthly-breakdown-grid,
.monthly-property-list,
.monthly-transaction-list {
  display: grid;
  gap: 8px;
}

.monthly-breakdown-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monthly-breakdown-card {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.monthly-breakdown-card.income {
  border-left-color: var(--good);
}

.monthly-breakdown-card.expense {
  border-left-color: var(--danger);
}

.monthly-property-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(82px, 0.75fr));
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: #fff;
}

.monthly-property-row.negative {
  border-left-color: var(--danger);
}

.monthly-property-row > div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #faf8f2;
}

.owner-yield-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 27, 49, 0.06);
}

.owner-yield-card.negative {
  border-left-color: var(--danger);
}

.owner-yield-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.owner-yield-top strong {
  font-size: 17px;
}

.owner-yield-top span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.owner-yield-top b {
  flex: 0 0 auto;
  color: var(--good);
  font-size: 20px;
}

.owner-yield-card.negative .owner-yield-top b {
  color: var(--danger);
}

.owner-yield-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.owner-yield-metrics div,
.owner-property-yield > div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #faf8f2;
}

.owner-yield-metrics span,
.owner-property-yield span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.owner-yield-metrics strong,
.owner-property-yield b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.owner-property-yield-list {
  display: grid;
  gap: 8px;
}

.owner-property-yield {
  display: grid;
  grid-template-columns: minmax(58px, 0.82fr) repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--good);
  border-radius: 8px;
  background: #fff;
}

/* 给业主 = 关键数字(强调);我的利润 = 我的钱不是业主的(单独配色,放最后) */
.owner-yield-metrics .opy-toowner strong,
.owner-property-yield .opy-toowner b {
  color: var(--good);
  font-weight: 900;
}
.owner-yield-card.negative .owner-yield-metrics .opy-toowner strong,
.owner-property-yield.negative .opy-toowner b {
  color: var(--danger);
}
.owner-yield-metrics .opy-mine,
.owner-property-yield .opy-mine {
  background: #eef3fa;
}
.owner-yield-metrics .opy-mine span,
.owner-property-yield .opy-mine span {
  color: #5b7089;
}
.owner-property-yield .opy-unit {
  background: transparent;
  padding-left: 0;
}
.owner-property-yield .opy-unit strong {
  font-size: 15px;
}

.owner-property-yield.negative {
  border-left-color: var(--danger);
}

.settlement-card .settlement-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settlement-card .settlement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settlement-card .settlement-grid div {
  min-height: 58px;
  padding: 10px;
  border-radius: 8px;
  background: #faf8f2;
}

.settlement-card b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.settlement-detail-list {
  display: grid;
  gap: 7px;
}

.settlement-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.settlement-line.income {
  border-left-color: var(--good);
  background: #faf8f2;
}

.settlement-line.expense {
  border-left-color: var(--danger);
}

.settlement-line.vacancy {
  border-left-color: var(--muted);
  background: #f1efe9;
  opacity: 0.85;
}

.settlement-total .settlement-received b {
  color: var(--good);
}
.settlement-total .settlement-payable b {
  color: var(--brand);
  font-weight: 800;
}

.settlement-line.vacancy strong,
.settlement-line.vacancy b {
  color: var(--muted);
}

.settlement-line strong {
  font-size: 14px;
}

.settlement-line span {
  display: block;
  margin-top: 3px;
}

.settlement-line b {
  margin: 0;
  white-space: nowrap;
}

.settlement-line.income b {
  color: var(--good);
}

.settlement-line.expense b {
  color: var(--danger);
}

.settlement-empty {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.settlement-total {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.settlement-total div {
  min-height: 58px;
  padding: 10px;
  border-radius: 8px;
  background: #faf8f2;
}
.settlement-total div.calc-clickable {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.settlement-total div.calc-clickable:hover,
.settlement-total div.calc-clickable:active {
  border-color: var(--brand-2);
  background: #f3ede2;
}
.settlement-total div.calc-clickable span {
  color: var(--brand-2);
}

.detail-modal > .modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compact-head {
  margin-top: 8px;
}

.detail-summary,
.expense-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.expense-breakdown {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-summary article,
.expense-breakdown article {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
}

.detail-summary span,
.expense-breakdown span,
.expense-detail-card span {
  color: var(--muted);
  font-size: 12px;
}

.detail-summary strong,
.expense-breakdown strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.expense-detail-list {
  display: grid;
  gap: 8px;
}

.detail-record-list {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.expense-detail-card,
.detail-record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.expense-detail-card > strong {
  color: var(--danger);
}

.detail-record-card.income {
  border-left-color: var(--good);
}

.detail-record-card.expense {
  border-left-color: var(--danger);
}

.detail-record-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-record-card b {
  white-space: nowrap;
}

.detail-record-card.income b {
  color: var(--good);
}

.detail-record-card.expense b {
  color: var(--danger);
}

.detail-profit-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: #fff;
}

.detail-profit-card.negative {
  border-left-color: var(--danger);
}

.detail-profit-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-profit-top span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.detail-profit-top b {
  flex: 0 0 auto;
  color: var(--good);
  font-size: 16px;
}

.detail-profit-card.negative .detail-profit-top b {
  color: var(--danger);
}

.detail-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-mini-grid div {
  min-height: 58px;
  padding: 9px;
  border-radius: 8px;
  background: #faf8f2;
}

.detail-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-mini-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.detail-mini-grid div.calc-clickable {
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.detail-mini-grid div.calc-clickable:hover,
.detail-mini-grid div.calc-clickable:active {
  border-color: var(--brand-2);
  background: #f3ede2;
}
.detail-mini-grid div.calc-clickable span {
  color: var(--brand-2);
}

.detail-formula-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f3ec;
  border: 1px dashed var(--c-border, #d9d2c4);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2, #6b6354);
}

/* 计算明细(怎么算的) */
.calc-explain {
  background: #eef2ee;
  border-left: 3px solid var(--good);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--brand);
}
.calc-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.calc-step.vacant {
  background: #f1efe9;
  border-style: dashed;
  opacity: 0.92;
}
.calc-step-head {
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 8px;
  color: var(--brand);
}
.calc-formula {
  display: grid;
  gap: 5px;
  font-size: 14px;
  line-height: 1.5;
}
.calc-formula span {
  display: block;
}
.calc-formula b {
  font-weight: 800;
}
.calc-formula small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.calc-formula .calc-link {
  cursor: pointer;
  color: var(--brand-2);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.calc-formula .calc-link:hover {
  color: var(--brand);
}
.calc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
}
.calc-total span {
  font-weight: 700;
}
.calc-total b {
  font-weight: 800;
  font-size: 17px;
}
.calc-refund-head {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}
.calc-explain-muted {
  background: #f1efe9;
  border-left-color: var(--muted);
  color: var(--muted);
}
.calc-refund-head ~ .detail-record-card,
.calc-refund-head ~ .calc-flag {
  opacity: 0.78;
}
.calc-warn {
  background: #fbf3e4;
  border-left: 3px solid var(--brand-2);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--brand-2);
}
.calc-flag {
  margin: -4px 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-2);
}
.expense-detail-card.refund {
  opacity: 0.72;
}
/* 业主收益率卡片里可点的数字 */
.owner-yield-metrics div.calc-clickable,
.owner-property-yield div.calc-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.owner-yield-metrics div.calc-clickable:hover,
.owner-yield-metrics div.calc-clickable:active,
.owner-property-yield div.calc-clickable:hover,
.owner-property-yield div.calc-clickable:active {
  background: #eef2ee;
}
.owner-yield-metrics div.calc-clickable span,
.owner-property-yield div.calc-clickable span {
  color: var(--brand-2);
}
.calc-clickable-inline {
  cursor: pointer;
}
.calc-step.calc-clickable-step {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.calc-step.calc-clickable-step:hover,
.calc-step.calc-clickable-step:active {
  border-color: var(--brand-2);
  background: #f3ede2;
}
.calc-step.calc-clickable-step .calc-step-head {
  color: var(--brand-2);
}

.cheque-profit-list {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cheque-profit-list > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cheque-profit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(92px, 0.8fr));
  gap: 8px;
  align-items: stretch;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: #fff;
}

.cheque-profit-row.negative {
  border-left-color: var(--danger);
}

.cheque-profit-row > div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #faf8f2;
}

.cheque-profit-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cheque-profit-row b {
  display: block;
  margin-top: 4px;
}

.cheque-profit-row > div:last-child b {
  color: var(--good);
}

.cheque-profit-row.negative > div:last-child b {
  color: var(--danger);
}

#propertyStatusModal {
  width: min(94vw, 760px);
}

.property-status-list {
  display: grid;
  gap: 8px;
  max-height: min(68vh, 640px);
  overflow: auto;
  padding-right: 2px;
}

.property-status-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.35fr) minmax(112px, 0.95fr) minmax(112px, 0.95fr) minmax(98px, 0.9fr) minmax(98px, 0.9fr) minmax(110px, 0.95fr) minmax(105px, 0.9fr) minmax(105px, 0.9fr);
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 8px;
  background: #fff;
}

.property-status-row.vacant {
  border-left-color: var(--accent);
}

.property-status-row.maintenance {
  border-left-color: var(--danger);
}

.property-status-row.movedOut {
  border-left-color: #8b9691;
}

.property-status-row.sold {
  border-left-color: #36547d;
}

.property-status-row > div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #faf8f2;
}

.property-status-main {
  background: #f1e8dd !important;
}

.property-status-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.property-status-row strong,
.property-status-row b {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.cheque-count-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.cheque-rows {
  display: grid;
  gap: 10px;
}

/* 支票编辑:表格式 —— 列名在最上面出现一次,每张支票一整排,横向放不下就滑动 */
.cheque-grid {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
  padding: 6px 10px 10px;
}

.cheque-grid-head,
.cheque-row {
  display: grid;
  grid-template-columns: 34px 104px 138px 138px 112px 112px 100px 40px;
  gap: 8px;
  align-items: center;
  min-width: 760px;
}
.cheque-remove {
  border: 1px solid var(--line);
  background: #fff;
  color: #b4232a;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.cheque-remove:hover {
  background: #fdecec;
  border-color: #e7a9ac;
}
.cheque-add {
  margin-top: 10px;
}
.cheque-owner-note {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ink-2, #6b6354);
  background: #f6f3ec;
  border-radius: 8px;
  padding: 7px 10px;
}

.cheque-grid-head {
  padding: 4px 0 8px;
}

.cheque-grid-head span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.cheque-row {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.cheque-row > strong {
  color: var(--brand-2);
  font-weight: 800;
}

.cheque-row select,
.cheque-row input {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 560px) {
  #app {
    padding-inline: 14px;
  }

  .topbar {
    display: grid;
    align-items: start;
    gap: 12px;
  }

  .brand-lockup {
    width: 100%;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: 23px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) minmax(0, 1fr) 42px;
    gap: 7px;
    width: 100%;
    max-width: none;
  }

  .top-actions .compact-button {
    min-width: 0;
    padding-inline: 6px;
  }

  .section-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .inline-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .inline-actions .text-button {
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-button {
    width: 100%;
  }

  .report-meta {
    grid-template-columns: 1fr;
  }

  .property-status-row {
    grid-template-columns: 1fr;
  }

  .settlement-line,
  .settlement-total {
    grid-template-columns: 1fr;
  }

  .settlement-line b {
    justify-self: start;
  }

  .cheque-date-grid,
  .modal-actions,
  .settings-actions,
  .security-status-grid,
  .settings-row,
  .report-category-grid,
  .ledger-category-grid,
  .monthly-ledger-grid,
  .monthly-breakdown-grid,
  .monthly-property-row,
  .owner-yield-metrics,
  .owner-property-yield,
  .cheque-profit-row,
  .detail-summary,
  .expense-breakdown,
  .detail-mini-grid {
    grid-template-columns: 1fr;
  }

  /* 业主收益率:手机上用紧凑 2 列(房号占整行做标题),不要一格一行拉得太长 */
  .owner-property-yield {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .owner-property-yield .opy-unit {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .owner-yield-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    padding-inline: 6px;
  }

  .bottom-nav button {
    min-height: 58px;
    gap: 4px;
    font-size: 10px;
  }

  .bottom-nav b {
    display: block;
    max-width: 66px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.1;
  }

  .cheque-date-top {
    display: grid;
  }

  .ledger-tools {
    grid-template-columns: 1fr;
  }

  .cheque-date-top b {
    justify-self: start;
  }

  .cheque-row > strong {
    padding-bottom: 0;
  }
}

@media (min-width: 700px) {
  .ledger-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ledger-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 5px;
}

.tag-row em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1e8dd;
  color: var(--brand-2);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.amount-income {
  color: var(--good);
}

.amount-expense {
  color: var(--danger);
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(520px, 100%);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  transform: translateX(50%);
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bottom-nav b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button span {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 2px solid currentColor;
}

.bottom-nav button.active {
  background: #efe6dc;
  color: var(--brand);
}

@media (max-width: 560px) {
  .bottom-nav {
    padding-inline: 6px;
  }

  .bottom-nav button {
    min-height: 58px;
    gap: 4px;
    font-size: 10px;
  }

  .bottom-nav b {
    display: block;
    max-width: 66px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.1;
  }
}

dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(19, 32, 31, 0.45);
}

.modal-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-modal {
  max-height: min(82vh, 720px);
  overflow: auto;
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-section {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
}

.settings-section h3 {
  color: var(--brand);
}

.settings-section p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}

.settings-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-row strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-actions .ghost-button {
  width: 100%;
}

.settings-actions .danger-button {
  grid-column: 1 / -1;
}

.settings-danger-hint {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.legal-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.danger-button {
  border-color: rgba(168, 76, 69, 0.35);
  color: var(--danger);
}

.danger-button:hover {
  border-color: rgba(168, 76, 69, 0.55);
  background: rgba(168, 76, 69, 0.08);
}

.legal-info-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.legal-info-card p {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.security-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.security-status-grid article {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
}

.security-status-grid span,
.security-status-grid strong {
  display: block;
}

.security-status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.security-status-grid strong {
  margin-top: 5px;
  color: var(--brand);
  font-size: 13px;
}

.role-matrix,
.audit-log-list {
  display: grid;
  gap: 8px;
}

.role-card,
.audit-log-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-card.active {
  border-left-color: var(--brand-2);
}

.role-card strong,
.audit-log-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.role-card span,
.role-card small,
.audit-log-card span,
.audit-log-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-action {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.empty-action strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-action span {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-action .primary-button {
  width: min(100%, 220px);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 80;
  width: min(460px, calc(100% - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(184, 138, 68, 0.48);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  transform: translateX(50%);
}

@media (min-width: 760px) {
  #app {
    max-width: 1040px;
  }

  .view.active {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    gap: 18px;
    align-items: start;
  }

  #dashboardView.active .summary-panel,
  #dashboardView.active .section-head:first-of-type,
  #dashboardView.active #attentionList {
    grid-column: 1;
  }

  #dashboardView.active .section-head:last-of-type,
  #dashboardView.active #dashboardProperties {
    grid-column: 2;
  }

  .property-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-nav {
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
  }
}

/* 流水账 / Cashbook (running ledger, Excel-style table) */
.view.cashbook-active #ledgerSummary,
.view.cashbook-active #ledgerList {
  grid-column: 1 / -1;
}
.cashbook-opening {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cashbook-opening input {
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
  background: transparent;
  color: inherit;
}
.cashbook-hint {
  font-size: 12px;
  opacity: 0.6;
  margin: 4px 2px 10px;
}
.cashbook-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cashbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 480px;
}
.cheque-overview-table tbody tr {
  cursor: pointer;
}
.cheque-overview-table tbody tr:hover {
  background: rgba(14, 159, 142, 0.08);
}
.cheque-overview-table .cstat {
  font-weight: 700;
}
.cheque-overview-table .cstat.ok {
  color: #0b7d70;
}
.cheque-overview-table .cstat.pending {
  color: #9a681e;
}
.cheque-overview-table .cstat.bad {
  color: var(--danger);
}
.settlement-line.clickable-line {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.settlement-line.clickable-line:hover {
  background: rgba(14, 159, 142, 0.08);
}

.cheque-pending-note {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 6px 0 10px;
}
.cheque-pending-note.has-pending {
  color: #9a681e;
}

.cheque-amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}
.cheque-amt-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.cheque-amt-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.cheque-amt-card strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}
.cheque-amt-card.ok {
  border-left-color: var(--good);
}
.cheque-amt-card.bad {
  border-left-color: var(--danger);
}
.cheque-amt-card.pending {
  border-left-color: var(--accent);
}
button.cheque-amt-card {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.12s;
}
button.cheque-amt-card:hover {
  box-shadow: 0 10px 26px rgba(7, 27, 49, 0.14);
}
.cheque-detail-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.cheque-detail-card:hover {
  background: rgba(14, 159, 142, 0.08);
}
.cheque-detail-card strong {
  display: block;
  font-size: 14px;
}
.cheque-detail-card span {
  color: var(--muted);
  font-size: 12px;
}
.cheque-detail-card .cheque-detail-right {
  text-align: right;
}
.cheque-detail-card b {
  display: block;
  font-weight: 800;
}

.cheque-overview-block {
  margin-bottom: 14px;
}
.cheque-overview-head {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
}
.cheque-overview-table .overdue-row {
  background: rgba(192, 70, 50, 0.06);
}
.cashbook-table th,
.cashbook-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cashbook-table thead th {
  position: sticky;
  top: 0;
  background: #ffffff;
  font-size: 12px;
  opacity: 0.78;
  z-index: 1;
}
.cashbook-table .cb-c-date {
  font-size: 12px;
  opacity: 0.7;
}
.cashbook-table .cb-c-desc {
  white-space: normal;
  min-width: 170px;
}
.cashbook-table .cb-c-in,
.cashbook-table .cb-c-out,
.cashbook-table .cb-c-bal {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cashbook-table td.cb-c-in {
  color: #1f9d55;
}
.cashbook-table td.cb-c-out {
  color: #c0392b;
}
.cashbook-table td.cb-c-bal {
  font-weight: 600;
}
.cashbook-table td.cb-c-bal.neg {
  color: #c0392b;
}
.cashbook-table .cb-opening-row td {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
}
.cashbook-table tbody tr[data-rid] {
  cursor: pointer;
}
.cashbook-table tbody tr[data-rid]:hover {
  background: rgba(14, 159, 142, 0.08);
}
.edit-property-btn,
.clear-lease-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}
.clear-lease-btn {
  color: #b06a00;
}
.meta-note {
  grid-column: 1 / -1;
}
.meta-note b {
  font-weight: 500;
  white-space: normal;
}
.metric-row [data-edit],
.meta-grid [data-edit] {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.metric-row [data-edit]:hover,
.meta-grid [data-edit]:hover {
  background: rgba(14, 159, 142, 0.1);
}
.clickable-records .detail-record-card {
  cursor: pointer;
  transition: background 0.12s;
}
.clickable-records .detail-record-card:hover {
  background: rgba(14, 159, 142, 0.08);
}
.lease-history-btn,
.new-lease-btn,
.move-out-btn,
.record-lease-btn,
.restore-period-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}
.restore-period-btn {
  color: #0b6cad;
  font-weight: 700;
  background: #eaf4fc;
  border-radius: 8px;
  padding: 6px;
}
.new-lease-btn,
.record-lease-btn {
  color: #0b7d70;
  font-weight: 600;
}
.move-out-btn {
  color: #b04632;
  font-weight: 600;
}
.owner-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.owner-card-actions .text-button {
  flex: 1 1 auto;
  text-align: center;
}
.settle-add-btn {
  color: #0b7d70;
  font-weight: 600;
}
.settle-log-btn {
  color: #36547d;
  font-weight: 600;
}
.settlement-quarter {
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 6px;
  letter-spacing: 0.04em;
}
.settlement-log-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.settlement-log-card:hover {
  background: rgba(14, 159, 142, 0.06);
}
.settlement-log-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.settlement-log-head b {
  font-weight: 800;
}
.settlement-log-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.settlement-log-card .no-receipt {
  color: #b06a00;
}
.settlement-owner-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 0 4px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--line);
  font-size: 15px;
}
.settlement-owner-head strong {
  font-weight: 800;
}
.settlement-owner-head b {
  font-weight: 800;
  color: var(--good);
}
.add-settle-owner {
  margin: 0 0 12px;
  color: var(--brand-2);
  font-weight: 700;
}
.sales-list {
  display: grid;
  gap: 12px;
}
.sale-card {
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}
.sale-card:hover {
  box-shadow: 0 4px 14px rgba(7, 27, 49, 0.08);
}
.sale-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sale-card-head strong {
  font-weight: 800;
  display: block;
}
.sale-card-head span {
  color: var(--muted);
  font-size: 13px;
}
.sale-card-head .sale-date {
  white-space: nowrap;
  color: var(--brand-2);
  font-weight: 700;
}
.sale-breakdown {
  display: grid;
  gap: 4px;
}
.sale-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.sale-row span {
  color: var(--muted);
}
.sale-row b {
  font-weight: 700;
}
.sale-row-spread b {
  color: var(--brand-2);
}
.sale-row-cost b {
  color: var(--danger);
}
.sale-net-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--line);
  font-size: 15px;
}
.sale-net-row span {
  font-weight: 700;
}
.sale-net-row b {
  font-weight: 800;
  font-size: 17px;
}
.sale-net-row.good b {
  color: var(--good);
}
.sale-net-row.bad b {
  color: var(--danger);
}
.sale-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.sale-preview {
  display: grid;
  gap: 4px;
  background: #f4f2ec;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 4px 0;
}
.sale-preview div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.sale-preview div span {
  color: var(--muted);
}
.sale-preview div b {
  font-weight: 700;
}
.sale-preview-net b {
  font-size: 16px;
  font-weight: 800;
}
.sale-preview-net.good b {
  color: var(--good);
}
.sale-preview-net.bad b {
  color: var(--danger);
}
.view-intro {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
  line-height: 1.5;
}

.lease-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.lease-card.active {
  border-color: #13293d;
  background: rgba(19, 41, 61, 0.03);
}
.lease-card.vacant-card {
  border-style: dashed;
  border-color: #c4ccd4;
  background: repeating-linear-gradient(135deg, #f7f8fa, #f7f8fa 8px, #f1f3f6 8px, #f1f3f6 16px);
  color: var(--muted);
}
.lease-card.vacant-card .lease-head strong {
  color: #8a97a3;
}

/* 业主支出明细:每业主一卡(物业费 + 其它房子支出),可点开看每套每笔 */
.owner-expense-grid {
  display: grid;
  gap: 8px;
}
.owner-expense-card {
  border: 1px solid var(--line);
  border-left: 4px solid #c98a2b;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffdf8;
  cursor: pointer;
}
.owner-expense-card:hover {
  background: #fff7ea;
}
.owner-expense-card .oe-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.owner-expense-card .oe-head strong {
  font-size: 15px;
}
.owner-expense-card .oe-head b {
  color: #a8651a;
  font-size: 16px;
  font-weight: 900;
}
.owner-expense-card .oe-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.owner-expense-card .oe-metrics div {
  background: #faf8f2;
  border-radius: 8px;
  padding: 7px 9px;
}
.owner-expense-card .oe-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.owner-expense-card .oe-metrics b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

/* 收益率卡片上的空置小标签:看每套收入支出时一眼看到空置 */
.opy-vacancy {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff3e0;
  color: #b4690e;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.opy-vacancy:hover,
.opy-vacancy:active {
  background: #ffe2b8;
}
.edit-refund-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  color: #b04632;
  font-weight: 600;
}
.lease-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.reactivate-btn {
  color: #0b6cad;
  font-weight: 700;
}
.add-historical-lease-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px dashed #0b7d70;
  border-radius: 8px;
  color: #0b7d70;
  font-weight: 700;
  background: #f0faf8;
}
.lease-card-actions .text-button {
  flex: 1;
  text-align: center;
  margin-top: 0;
  font-weight: 600;
}
.lease-card-actions .edit-refund-btn {
  width: auto;
}
.lease-delete-btn {
  color: #c0392b;
}
.lease-delete-btn:hover,
.lease-delete-btn:active {
  color: #e74c3c;
}
.lease-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.lease-clickable:hover {
  background: rgba(14, 159, 142, 0.1);
}
.lease-clickable span {
  color: #0b7d70;
}
.lease-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.lease-head span {
  font-size: 12px;
  opacity: 0.7;
}
.lease-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.lease-meta > div {
  display: flex;
  flex-direction: column;
}
.lease-meta span {
  font-size: 12px;
  opacity: 0.6;
}
.lease-meta b {
  font-weight: 600;
}

/* 记租金时实时显示「给业主/你的利润」 */
.rent-split-preview {
  margin: -2px 0 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f1f8f3;
  border: 1px solid #cfe6d8;
  color: #20324b;
  font-size: 13px;
  line-height: 1.55;
}
.rent-split-preview b {
  color: #20324b;
  font-weight: 700;
}
.rent-split-preview small {
  color: #6b7a86;
}

/* 本季记账板块 */
.quarter-board-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 10px;
}
.quarter-board-head strong {
  font-size: 17px;
  color: #20324b;
  min-width: 160px;
  text-align: center;
}
.quarter-nav-btn {
  padding: 4px 12px;
  font-size: 15px;
}
.quarter-summary .qsum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.quarter-summary .qsum-grid > div {
  background: #f7f9fb;
  border: 1px solid #e6ecf1;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.quarter-summary .qsum-grid span {
  font-size: 11px;
  color: #6b7a86;
}
.quarter-summary .qsum-grid strong {
  font-size: 16px;
  color: #20324b;
}
.quarter-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.quarter-actions .primary-button {
  flex: 1;
}
.qu-section-label {
  font-size: 12px;
  color: #8a97a3;
  margin: 12px 2px 6px;
  font-weight: 600;
}
.quarter-unit {
  background: #fff;
  border: 1px solid #e6ecf1;
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 9px;
}
.quarter-unit.idle {
  opacity: 0.62;
}
.qu-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.qu-head strong {
  font-size: 15px;
  color: #20324b;
}
.qu-head span {
  font-size: 12px;
  color: #6b7a86;
}
.qu-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
}
.qu-nums > div {
  flex: 1 1 60px;
  min-width: 54px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qu-nums .qu-mine b {
  color: #1e7a46;
}
.qu-nums span {
  font-size: 10.5px;
  color: #8a97a3;
}
.qu-nums b {
  font-size: 13.5px;
  color: #20324b;
}
.qu-nums .qu-neg {
  color: #c0392b;
}
.qu-warn {
  margin-top: 7px;
  font-size: 11.5px;
  color: #c98a2b;
}
.qu-actions {
  display: flex;
  gap: 14px;
  margin-top: 9px;
  border-top: 1px solid #f0f3f6;
  padding-top: 8px;
}
.qu-actions .text-button {
  font-weight: 600;
}
.qu-actions [data-q-rent] {
  color: #1e7a46;
}
.qu-actions [data-q-exp] {
  color: #c0392b;
}
.note-preset-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.note-preset-chips.hidden {
  display: none;
}
.note-chip-hint {
  font-size: 12px;
  color: var(--muted);
}
.note-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.note-chip:hover {
  border-color: var(--brand);
}
.note-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.note-chip.active::before {
  content: "✓ ";
}
@media (max-width: 560px) {
  .quarter-summary .qsum-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.qu-click {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}
.qu-click:hover {
  background: #eef4f8;
}
.qu-click span {
  color: #8a97a3;
}
.quarter-export-btn {
  display: inline-block;
  margin: -4px 0 14px;
  color: #20324b;
  font-weight: 600;
}

/* 押金统计 */
.deposit-summary .deposit-sum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.deposit-summary .deposit-sum-grid > div {
  background: #f7f9fb;
  border: 1px solid #e6ecf1;
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deposit-summary .deposit-sum-grid span {
  font-size: 12px;
  color: #6b7a86;
}
.deposit-summary .deposit-sum-grid strong {
  font-size: 18px;
  color: #20324b;
}
.deposit-summary .ds-held {
  background: #eef7f1;
  border-color: #cfe6d8;
}
.deposit-summary .ds-held strong {
  color: #1e7a46;
}
.deposit-table {
  width: 100%;
}
.deposit-table .dep-row {
  cursor: pointer;
}
.deposit-table .dep-row:hover {
  background: #eef4f8;
}
.deposit-table .deposit-total {
  background: #f7f9fb;
  font-weight: 700;
}

.qu-through {
  margin-left: auto;
  font-size: 11px;
  color: #c98a2b;
  font-weight: 600;
  background: #fdf4e6;
  border: 1px solid #f0dcc0;
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
  cursor: pointer;
}
.qu-through:hover {
  border-color: #c98a2b;
  background: #fbeacb;
}
.qu-through-empty {
  color: #9aa3ab;
  background: #f4f6f8;
  border: 1px dashed #cdd5dc;
  font-weight: 500;
}
.qu-through-empty:hover {
  border-color: #9aa3ab;
  background: #eef1f4;
}
.qu-through-manual {
  color: #1f5fa8;
  background: #eaf2fc;
  border-color: #c3dbf5;
}
.qu-through-manual:hover {
  border-color: #1f5fa8;
  background: #dcebfb;
}
.qu-lease {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: 0.02em;
}
.qu-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 2px;
}
.qu-note span {
  font-size: 11px;
  color: #7a6a3a;
  background: #fbf6ea;
  border: 1px solid #ece0c6;
  border-radius: 6px;
  padding: 2px 8px;
  max-width: 100%;
  word-break: break-word;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.qu-note span:hover {
  background: #f5ecd8;
  border-color: #d9c79c;
}

/* ===== 桌面网页版:宽屏用满空间(她只在电脑上用)===== */
@media (min-width: 1180px) {
  #app {
    max-width: 1360px;
  }
  /* 列表型视图占满整宽(不再挤成两小列,不浪费两侧空白) */
  #quarterView.active,
  #propertiesView.active,
  #reportsView.active,
  #ledgerView.active,
  #ownerSettlementView.active,
  #salesView.active,
  #remindersView.active,
  #peopleView.active,
  #depositView.active {
    display: block;
  }
  /* 各列表多列排布 */
  .property-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quarter-unit-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .owner-expense-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sales-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  /* 仪表盘保持左右两栏,但更宽 */
  #dashboardView.active {
    grid-template-columns: minmax(360px, 1fr) minmax(560px, 1.5fr);
  }
  /* 底部导航:桌面上做成整条通栏(不再是中间一小块),9个入口一排 */
  .bottom-nav {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(9, 1fr);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 8px 4vw calc(8px + env(safe-area-inset-bottom));
  }
}
