/* Navegación mensual: una fila por mes y selector de año centrado. */
.month-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 8px;
  padding: 0;
}

.year-switch {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  align-items: center;
  justify-content: end;
  gap: 0;
}

.year-switch a,
.year-switch .year-arrow {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  font-size: 21px;
}

.year-switch .disabled {
  color: rgb(168 193 181 / 35%);
  cursor: not-allowed;
}

.year-switch strong {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.month-nav {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.month-nav a {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
}

/* El lateral conserva cabecera y usuario; sólo los meses se desplazan. */
.sidebar {
  overflow: hidden;
}

.sidebar > .brand,
.primary-nav,
.month-heading,
.sidebar-user {
  flex: 0 0 auto;
}

.month-section {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.month-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgb(168 193 181 / 55%) transparent;
  scrollbar-width: thin;
  padding-right: 6px;
}

.month-nav::-webkit-scrollbar {
  width: 5px;
}

.month-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(168 193 181 / 55%);
}

.sidebar-user {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--sidebar);
}

.property-card .rent {
  margin-bottom: 0;
}

.shared-charge-card {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(480px, 1.7fr);
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  border-color: #cadbd1;
  background: #f1f7f3;
}

.shared-charge-intro h2 {
  margin: 5px 0 5px;
}

.shared-charge-intro p {
  max-width: 50ch;
  margin: 0;
  font-size: 14px;
}

.shared-charge-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.shared-charge-entry { min-width: 0; }

.shared-service-link {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  color: #263329;
  font-size: 13px;
  font-weight: 720;
  text-decoration-color: #9bb5a6;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.shared-service-link:hover { color: var(--green); text-decoration-color: currentColor; }
.shared-service-link svg { flex: 0 0 auto; }
.shared-receipt-control { display: flex; min-height: 26px; align-items: center; gap: 7px; margin-top: 5px; }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.receipt-upload { display: grid; flex: 0 0 auto; width: 26px; height: 26px; place-items: center; padding: 0; border: 1px solid #cadbd1; border-radius: 7px; color: var(--green); background: white; cursor: pointer; }
.receipt-upload:hover { border-color: #9fb9aa; background: var(--green-soft); }
.shared-receipt-control .receipt-link { font-size: 10px; white-space: nowrap; }
.shared-file-name { min-width: 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.shared-file-name.upload-error { color: var(--red); }
.shared-receipt-control { flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.receipt-kind-label { flex-basis: 100%; font-size: 11px; font-weight: 600; }
.receipt-upload-text { display: inline-flex; width: auto; min-height: 32px; height: auto; padding: 6px 10px; font-size: 11px; }
.receipt-paste { width: 100%; padding: 10px; border: 1px dashed #9fb9aa; border-radius: 7px; background: var(--green-soft); color: var(--green); font: inherit; font-size: 11px; cursor: pointer; }
.receipt-paste:focus-visible, .shared-receipt-control input:focus-visible + label { outline: 2px solid var(--green); outline-offset: 3px; }
.receipt-paste:disabled { opacity: .6; cursor: wait; }
.shared-receipt-control .shared-file-name { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
.receipt-size-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.receipt-disclosure { margin-top: 6px; }
.receipt-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; color: var(--green); font-size: 11px; font-weight: 600; cursor: pointer; list-style: none; }
.receipt-disclosure > summary::-webkit-details-marker { display: none; }
.receipt-disclosure[open] > summary svg { transform: rotate(180deg); }
.receipt-disclosure > summary:focus-visible, .receipt-collapse:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.receipt-disclosure-body { margin-top: 4px; padding: 12px; border: 1px solid #cadbd1; border-radius: 9px; background: #fff; }
.receipt-intro, .receipt-retention-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.receipt-method { flex-basis: 100%; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.receipt-method-title { display: block; font-size: 12px; line-height: 1.4; }
.receipt-method p { margin: 5px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.receipt-disclosure .shared-receipt-control { margin-top: 0; }
.receipt-retention-hint { margin-top: 8px; }
.receipt-collapse { margin-top: 12px; padding: 7px 10px; border: 1px solid #cadbd1; border-radius: 7px; background: white; color: var(--green); font: inherit; font-size: 11px; cursor: pointer; }
.receipt-quick-links { display: flex; flex-wrap: wrap; align-items: start; min-height: 28px; gap: 6px 12px; }
.receipt-quick-links .receipt-link { margin-top: 6px; font-size: 11px; }
.receipt-options { display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: start; gap: 8px; padding: 8px; }
.receipt-option-list .shared-receipt-control { display: grid; gap: 4px; min-height: 0; }
.receipt-option-list .shared-receipt-control + .shared-receipt-control { margin-top: 4px; }
.receipt-option { display: block; width: 100%; margin: 0; padding: 6px 8px; border: 0; border-radius: 5px; background: var(--green-soft); color: var(--green); font: inherit; font-size: 12px; line-height: 1.4; text-align: left; cursor: pointer; }
.receipt-option:hover { background: #e1eee6; }
.receipt-option:disabled { opacity: .6; cursor: wait; }
.receipt-option:focus-visible, .receipt-help:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.receipt-option-list .shared-file-name:empty { display: none; }
.receipt-help { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid #cadbd1; border-radius: 50%; background: white; color: var(--green); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.receipt-help-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; }
.receipt-help-dialog::backdrop { background: rgb(15 35 25 / 45%); }
.receipt-help-dialog h2 { margin: 0 0 14px; font-size: 20px; }
.receipt-help-dialog p, .receipt-help-dialog li { font-size: 13px; line-height: 1.6; }
.receipt-help-dialog ol { padding-left: 20px; }
.receipt-help-dialog li + li { margin-top: 8px; }
.receipt-help-dialog > .btn { margin-top: 8px; }

.rent-breakdown span,
.total-rent span {
  color: var(--muted);
  font-size: 12px;
}

.rent-breakdown b {
  display: block;
  font-variant-numeric: tabular-nums;
}

.rent-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rent-breakdown div,
.total-rent {
  display: flex;
  flex-direction: column;
}

.total-rent {
  gap: 2px;
  margin-top: 13px;
}

.property-card .card-head {
  flex-wrap: wrap;
}

.property-card.is-paid {
  position: relative;
  overflow: hidden;
  border-color: #8fbea6;
  background: #edf7f1;
  box-shadow: 0 10px 28px rgb(36 88 68 / 10%);
}

.property-card.is-paid::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2f7a59;
  content: "";
}

.property-card.is-paid .status.paid {
  color: #174b35;
  background: #cfe8da;
}

.property-card.is-paid .rent-breakdown {
  border-color: #c9dfd2;
}

.additional-collection-add { display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 12px; border-style: dashed; color: var(--green); text-align: left; cursor: pointer; }
.additional-collection-add:hover { border-color: #9fb9aa; background: var(--green-soft); }
.additional-collection-add > span:last-child { display: flex; flex-direction: column; }
.additional-collection-add strong { font-size: 14px; }
.additional-collection-add small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.additional-collection-plus { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 25px; font-weight: 400; }

.card-head-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 6px;
  margin-left: auto;
}

.payment-trigger {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid #d7e1da;
  border-radius: 999px;
  color: var(--green);
  background: #f5f8f6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.payment-trigger:hover {
  border-color: #b9ccc0;
  background: var(--green-soft);
}

.mobile-property-toggle,
.mobile-payment-trigger { display: none; }

.rent-value,
.share-value,
.rent-edit-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rent-edit-row { justify-content: flex-start; }

.rent-edit {
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--green);
  background: transparent;
  cursor: pointer;
}

.rent-edit:hover { border-color: #cbdad1; background: var(--green-soft); }
.rent-edit svg { pointer-events: none; }

.payment-dialog {
  width: min(390px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 20px 60px rgb(18 35 26 / 18%);
}

.payment-dialog::backdrop {
  background: rgb(15 31 23 / 46%);
  backdrop-filter: blur(1px);
}

.payment-dialog form {
  position: relative;
  padding: 24px;
}

.payment-dialog h2 {
  margin: 12px 38px 4px 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.015em;
}

.payment-dialog p { margin: 0; font-size: 13px; }
.payment-dialog p strong { color: var(--ink); }

.dialog-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  color: var(--green);
  background: var(--green-soft);
}

.dialog-icon svg { width: 21px; height: 21px; }

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.dialog-close:hover { color: var(--ink); background: var(--paper); }

.payment-question-actions,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.payment-dialog .btn {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}

.payment-dialog .btn.danger {
  border-color: #b9473f;
  color: white;
  background: #b9473f;
}

.payment-dialog .btn.danger:hover { background: #9f3933; }

.rent-dialog-field { margin-top: 18px; }

.shares-dialog-fields {
  margin-top: 18px;
  gap: 12px;
}

.property-directory {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}

.property-summary-card {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease,box-shadow 150ms ease,transform 150ms ease;
}

.property-summary-card h2 { font-size: 17px; }
.property-summary-card:hover { border-color: #b5c9bc; box-shadow: 0 12px 30px rgb(24 34 28/9%); transform: translateY(-1px); }
.property-add-card { gap: 9px; color: var(--green); border-style: dashed; background: #f9fbf9; }
.property-add-card>span { font-size: 22px; font-weight: 400; }
.property-add-card>strong { font-size: 14px; }

.property-dialog {
  width: min(720px,calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 24px 70px rgb(18 35 26/20%);
}

.property-dialog::backdrop { background: rgb(15 31 23/46%); backdrop-filter: blur(1px); }
.property-dialog form { padding: 24px; }
.property-dialog-header { position: relative; padding-right: 48px; }
.property-dialog-header h2 { margin: 4px 0 0; font-size: 21px; }
.property-dialog-header .dialog-close { top: -8px; right: -8px; }
.property-month-state { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid #dbe4de; border-radius: 10px; background: #dbe4de; }
.property-month-state>div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: #f5f8f6; }
.property-month-state span { color: var(--muted); font-size: 11px; }
.property-month-state strong { font-size: 13px; }
.property-form-grid { gap: 12px; }
.property-form-grid .field { gap: 4px; }
.property-form-grid input,.property-form-grid textarea { min-height: 40px; padding: 8px 10px; }
.property-form-grid textarea { min-height: 72px; }
.property-active { display: inline-flex; grid-column: 1/-1; align-items: center; gap: 8px; width: fit-content; }
.property-active input { width: 18px; min-height: 18px; }

.payment-cancel-link {
  display: block;
  margin: 14px auto 0;
  padding: 5px 7px;
  border: 0;
  color: #a33d36;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.payment-cancel-link:hover { color: #852f2a; }
.payment-cancel-link[hidden] { display: none; }
.payment-cancel-step { margin-top: 22px; }
.payment-cancel-step p + p { margin-top: 5px; line-height: 1.45; }

.payment-form-fields { display: grid; gap: 16px; margin-top: 20px; }
.payment-form-fields .payment-expected-card { margin: 0; }
.payment-form-fields > .dialog-actions { margin-top: 2px; }

.payment-expected-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid #bad9cc;
  border-radius: 14px;
  background: #edf7f2;
  text-align: center;
}
.payment-expected-card span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.payment-expected-card strong { color: var(--green); font-size: clamp(24px, 5vw, 32px); line-height: 1.1; }
.payment-receiver-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.payment-receiver-fieldset legend { margin-bottom: 10px; color: var(--ink); font-size: 14px; font-weight: 720; }
.payment-receiver-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.payment-receiver-options label { position: relative; cursor: pointer; }
.payment-receiver-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.payment-receiver-options span { display: grid; min-height: 48px; place-items: center; padding: 9px 12px; border: 1px solid #cadbd1; border-radius: 10px; color: var(--green); background: white; font-size: 13px; font-weight: 700; }
.payment-receiver-options label:hover span { border-color: #9fb9aa; background: var(--green-soft); }
.payment-receiver-options input:checked + span { border-color: var(--green); color: white; background: var(--green); }
.payment-receiver-options input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.payment-dialog .payment-receiver-help { margin-top: 10px; line-height: 1.45; }
.additional-dialog { width: min(430px,calc(100% - 28px)); }
.additional-form-fields { display: grid; gap: 14px; margin-top: 20px; }
.additional-dialog .optional { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }

.monthly-expenses-section { scroll-margin-top: 24px; }
.expenses-heading { margin-bottom: 13px; }
.expenses-heading p { margin: 4px 0 0; font-size: 14px; }
.expense-ledgers { display: grid; gap: 14px; }

.expense-ledger { display: flex; padding: 0; flex-direction: column; overflow: hidden; }
.ledger-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; }
.ledger-header h3 { margin: 3px 0 1px; font-size: 18px; letter-spacing: -.015em; }
.ledger-header .muted { font-size: 13px; }
.ledger-add { flex: 0 0 auto; }
.ledger-title-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.additional-collection-ledger { border-color: #c8d9cf; }

.ledger-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbf9; }
.ledger-summary>div { padding: 14px 20px; border-right: 1px solid var(--line); }
.ledger-summary>div:last-child { border-right: 0; }
.ledger-summary span,.ledger-summary strong { display: block; }
.ledger-summary span { color: var(--muted); font-size: 11px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.ledger-summary strong { margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
.ledger-balance { color: var(--green); background: var(--green-soft); }
.ledger-balance.negative { color: var(--red); background: #fdf1ef; }
.ledger-income,.ledger-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line); background: #fafbf9; }
.ledger-income span,.ledger-footer span { color: var(--muted); font-size: 11px; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.ledger-income strong,.ledger-footer strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.ledger-footer { margin-top: auto; color: var(--green); border-top: 1px solid #cadbd1; background: var(--green-soft); }
.ledger-footer.negative { color: var(--red); border-top-color: #efd0cc; background: #fdf1ef; }

.ledger-list { padding: 4px 20px; }
.ledger-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 16px; min-height: 58px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: 0; }
.ledger-detail { display: flex; min-width: 0; flex-direction: column; }
.ledger-detail strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ledger-detail span { color: var(--muted); font-size: 12px; }
.ledger-detail a,.receipt-link { color: var(--green); font-weight: 680; text-underline-offset: 2px; }
.receipt-link { display: inline; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; text-decoration: underline; }
.receipt-link[hidden] { display: none; }
.ledger-amount { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-edit { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: white; cursor: pointer; font-size: 12px; font-weight: 700; }
.ledger-edit:hover { border-color: #b9ccc0; background: var(--green-soft); }
.ledger-empty { margin: 0; padding: 18px 20px; color: var(--muted); font-size: 13px; }
.ledger-empty-state { display: flex; align-items: center; gap: 13px; color: var(--green); }
.ledger-empty-state div { display: flex; flex-direction: column; }
.ledger-empty-state span { color: var(--muted); font-size: 13px; }

.expense-dialog { width: min(430px,calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; overscroll-behavior: contain; }
.expense-form-grid { display: grid; gap: 13px; margin-top: 20px; }
.expense-dialog .optional { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 500; }
.expense-dialog .field>.muted { font-size: 11px; }
.expense-receipt-label { color: var(--ink); font-size: 12px; font-weight: 700; }
.expense-receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.expense-receipt-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 10px; border: 1px solid #cadbd1; border-radius: 9px; color: var(--green); background: white; font: inherit; font-size: 12px; font-weight: 680; text-align: center; cursor: pointer; }
.expense-receipt-action:hover { border-color: #9fb9aa; background: var(--green-soft); }
.expense-receipt-action:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.expense-receipt-status { min-height: 17px; overflow-wrap: anywhere; }
.expense-receipt-status.upload-error { color: var(--red); }
.expense-receipt-preview { display: block; width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 9px; background: #f5f7f5; object-fit: contain; }
.expense-receipt-preview[hidden] { display: none; }
.expense-dialog-actions { grid-template-columns: auto 1fr 1fr; }
.expense-delete-trigger { margin-right: auto; }
.expense-delete-confirm { margin-top: 18px; }
.expense-delete-confirm p { margin: 0; color: var(--muted); }

@media (max-width: 460px) {
  .expense-receipt-actions { grid-template-columns: 1fr; }
  .expense-dialog-actions { grid-template-columns: 1fr; }
  .expense-dialog-actions .btn { width: 100%; }
}

.receipt-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 32px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.receipt-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.receipt-viewer::backdrop { background: rgb(10 18 14 / 78%); backdrop-filter: blur(2px); }
.receipt-image-viewport { overflow: auto; min-width: 0; min-height: 0; width: 100%; height: 100%; border-radius: 8px; }
.receipt-viewer img { display: block; max-width: none; max-height: none; margin: auto; border-radius: 8px; background: white; object-fit: contain; }
.receipt-zoom-toolbar { display: flex; align-items: center; justify-self: center; gap: 8px; margin-right: 42px; padding: 5px 8px; border-radius: 9px; color: white; background: #12271c; }
.receipt-zoom-toolbar button { min-width: 30px; height: 32px; padding: 4px 8px; border: 1px solid #678373; border-radius: 5px; background: transparent; color: white; font: inherit; font-size: 13px; cursor: pointer; }
.receipt-zoom-toolbar button:disabled { opacity: .4; cursor: default; }
.receipt-zoom-toolbar output { min-width: 42px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.receipt-zoom-toolbar button:focus-visible, .receipt-image-viewport:focus-visible { outline: 2px solid white; outline-offset: 2px; }
@media (max-width: 480px) { .receipt-viewer { padding: 14px; } .receipt-zoom-toolbar { gap: 4px; padding: 4px; } }
.receipt-close { position: fixed; top: 18px; right: 18px; display: grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 20%); border-radius: 50%; color: white; background: rgb(18 31 24 / 78%); cursor: pointer; }
.receipt-close:hover { background: rgb(18 31 24 / 95%); }

/* Panel mensual: escala equilibrada para pantallas de trabajo de 15 pulgadas. */
.dashboard-page .main-content {
  max-width: 1600px;
  padding: 22px clamp(20px, 2vw, 32px) 40px;
}

.dashboard-page .hero { margin: 0 0 18px; }
.dashboard-page .hero h1 { margin: 5px 0 3px; font-size: clamp(27px, 2.4vw, 32px); letter-spacing: -.03em; }
.dashboard-page .hero p { font-size: 13px; }
.dashboard-page .eyebrow { font-size: 10px; letter-spacing: .085em; }

.dashboard-page .grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.dashboard-page .stat { padding: 11px 13px; border-radius: 10px; box-shadow: none; }
.dashboard-page .stat .muted { font-size: 11px; }
.dashboard-page .stat .value { margin-top: 2px; font-size: 18px; letter-spacing: -.015em; }
.dashboard-page .stat:before { width: 2px; }

.dashboard-page .shared-charge-card {
  grid-template-columns: minmax(240px,.8fr) minmax(480px,1.5fr);
  gap: 20px;
  margin-top: 10px;
  padding: 15px 16px;
  border-radius: 11px;
  box-shadow: none;
}
.dashboard-page .shared-charge-intro h2 { margin: 3px 0; font-size: 15px; }
.dashboard-page .shared-charge-intro p { max-width: 58ch; font-size: 12px; line-height: 1.45; }
.dashboard-page .shared-charge-form { gap: 8px; }
.dashboard-page .shared-charge-form { align-items: start; }
.dashboard-page .shared-charge-form>.btn { margin-top: 18px; }
.dashboard-page .shared-charge-form .field { gap: 3px; }
.dashboard-page .shared-charge-form label,.dashboard-page .shared-service-link { font-size: 12px; }
.dashboard-page .shared-charge-form input { min-height: 37px; padding: 7px 9px; border-radius: 8px; font-size: 14px; }
.dashboard-page .shared-charge-form .btn { min-height: 36px; padding: 7px 12px; border-radius: 8px; font-size: 12px; }

.dashboard-page .section-head { margin: 24px 0 9px; }
.dashboard-page .section-head h2 { font-size: 16px; }
.dashboard-page .section-head a,.dashboard-page .section-head p { font-size: 12px; }
.dashboard-page .section-head p { margin: 3px 0 0; line-height: 1.4; }

.dashboard-page .properties { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.dashboard-page .expense-ledgers { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.dashboard-page .property-card { padding: 14px; border-radius: 11px; box-shadow: none; }
.dashboard-page .property-card .card-head { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
.dashboard-page .property-card .card-head>div:first-child { width: 100%; }
.dashboard-page .property-card .card-head h2 { margin-top: 2px; font-size: 16px; line-height: 1.3; overflow-wrap: break-word; word-break: normal; }
.dashboard-page .property-card .card-head .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dashboard-page .card-head-actions { flex-wrap: wrap; justify-content: flex-start; width: 100%; margin: 0; gap: 6px; }
.dashboard-page .card-head-actions .status { max-width: 100%; white-space: normal; }
.dashboard-page .status,.dashboard-page .payment-trigger { min-height: 26px; padding: 3px 7px; font-size: 10.5px; }
.dashboard-page .payment-trigger { gap: 3px; }
.dashboard-page .payment-trigger svg { width: 11px; height: 11px; }
.dashboard-page .rent-breakdown { grid-template-columns: 1fr; gap: 4px; margin-top: 11px; padding: 9px 0; }
.dashboard-page .rent-breakdown div { align-items: center; justify-content: space-between; flex-direction: row; gap: 7px; }
.dashboard-page .rent-breakdown span,.dashboard-page .total-rent span { font-size: 12px; }
.dashboard-page .rent-breakdown b { font-size: 12px; white-space: nowrap; }
.dashboard-page .rent-breakdown .rent-value b { font-size: 15px; font-weight: 760; font-variant-numeric: tabular-nums; }
.dashboard-page .rent-breakdown .rent-value { gap: 5px; }
.dashboard-page .rent-breakdown .rent-edit { width: 32px; min-width: 32px; height: 32px; }
.dashboard-page .rent-breakdown .rent-edit svg { width: 14px; height: 14px; }
.dashboard-page .total-rent { align-items: end; justify-content: space-between; flex-direction: row; gap: 8px; margin-top: 9px; font-size: 17px; }
.dashboard-page .property-card>.rent { margin: 14px 0 0; font-size: 19px; }

.dashboard-page .monthly-expenses-section { margin-top: 2px; }
.dashboard-page .expense-ledger { border-radius: 10px; box-shadow: none; }
.dashboard-page .ledger-header { display: block; padding: 11px; }
.dashboard-page .ledger-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.dashboard-page .ledger-header h3 { margin: 1px 0; font-size: 14px; }
.dashboard-page .ledger-header .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.dashboard-page .ledger-add { flex: 0 0 auto; }
.dashboard-page .ledger-income,.dashboard-page .ledger-footer { padding: 7px 10px; }
.dashboard-page .ledger-income span,.dashboard-page .ledger-footer span { font-size: 10px; }
.dashboard-page .ledger-income strong,.dashboard-page .ledger-footer strong { font-size: 12px; }
.dashboard-page .ledger-list { padding: 2px 10px; }
.dashboard-page .ledger-row { grid-template-columns: minmax(0,1fr) 27px auto; gap: 5px; min-height: 43px; padding: 5px 0; }
.dashboard-page .ledger-detail strong,.dashboard-page .ledger-amount { font-size: 12px; }
.dashboard-page .ledger-detail span { font-size: 10px; }
.dashboard-page .ledger-edit { display: grid; width: 27px; min-height: 27px; place-items: center; padding: 0; border-radius: 6px; }
.dashboard-page .ledger-empty { padding: 12px 10px; font-size: 11px; }

.distribution-card { display: grid; grid-template-columns: 1.1fr 1fr 1fr; padding: 0; overflow: hidden; box-shadow: none; }
.distribution-card>div { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: 14px 18px; border-right: 1px solid var(--line); }
.distribution-card>div:last-child { border-right: 0; }
.distribution-card span { color: var(--muted); font-size: 11px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.distribution-card strong { margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.distribution-card small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.distribution-total { color: white; background: var(--green); }
.distribution-total span { color: #c9ded3; }
.distribution-total strong { font-size: 20px; }
.distribution-person { background: white; }

.holdings-card { display: grid; grid-template-columns: minmax(220px,.75fr) minmax(480px,1.45fr); align-items: center; gap: 18px; margin-top: 8px; padding: 14px 16px; box-shadow: none; }
.automatic-holdings { grid-template-columns: minmax(210px,.75fr) minmax(260px,1fr); }
.holding-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.holding-balances>div { display: flex; min-width: 0; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbf9; }
.holding-balances span { color: var(--muted); font-size: 11px; }
.holding-balances strong { margin-top: 2px; font-size: 15px; font-variant-numeric: tabular-nums; }
.automatic-holdings .holding-result { grid-column: 1/-1; }
.holding-warning { color: #805813; border-color: #ead5a5; background: #fff8e8; }
.holding-warning span { color: #735f39; }
.holdings-intro h3 { margin: 3px 0; font-size: 15px; }
.holdings-intro p { max-width: 52ch; margin: 0; font-size: 12px; line-height: 1.45; }
.holdings-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; gap: 8px; }
.holdings-form .field { gap: 3px; }
.holdings-form label { font-size: 12px; }
.holdings-form input { min-height: 37px; padding: 7px 9px; border-radius: 8px; font-size: 14px; }
.holdings-form .btn { min-height: 36px; padding: 7px 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.holding-result { display: flex; grid-column: 1/-1; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #cadbd1; border-radius: 8px; color: var(--green); background: var(--green-soft); }
.holding-result svg { flex: 0 0 auto; }
.holding-result div { display: flex; flex-direction: column; }
.holding-result strong { font-size: 13px; }
.holding-result span { color: var(--muted); font-size: 11px; }

@media (min-width: 1251px) and (max-width: 1500px) {
  .dashboard-page .main-content { padding-right: 24px; padding-left: 24px; }
  .dashboard-page .expense-ledgers { gap: 7px; }
}

@media (max-width: 1350px) {
  .dashboard-page .properties { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1250px) {
  .dashboard-page .expense-ledgers { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dashboard-page .shared-charge-card { grid-template-columns: 1fr; }
  .holdings-card { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dashboard-page .properties,
  .dashboard-page .expense-ledgers { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1100px) {
  .shared-charge-card { grid-template-columns: 1fr; }
  .property-directory { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .shared-charge-form { grid-template-columns: 1fr 1fr; }
  .ledger-header { align-items: stretch; flex-direction: column; }
  .ledger-add { align-self: flex-start; }
  .additional-collection-ledger .ledger-title-row { align-items: flex-start; flex-direction: column; }
  .additional-collection-ledger .ledger-title-actions { flex-wrap: wrap; }
  .dashboard-page .main-content { padding: 0 12px 36px; }
  .dashboard-page .hero { margin-bottom: 13px; }
  .dashboard-page .grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-page .properties { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .dashboard-page .expense-ledgers { grid-template-columns: 1fr; }
  .dashboard-page article.property-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-flow: dense; align-content: start; gap: 6px; padding: 11px; border-color: #dce3de; border-radius: 12px; background: #fff; box-shadow: none; }
  .dashboard-page article.property-card.is-paid { border-color: #b9d2c3; background: #fff; }
  .dashboard-page article.property-card.is-paid::before { width: 3px; }
  .dashboard-page article.property-card .card-head,
  .dashboard-page article.property-card .card-head-actions { display: contents; }
  .dashboard-page article.property-card .card-head>div:first-child { grid-column: 1/-1; order: 1; min-width: 0; }
  .dashboard-page article.property-card .card-head h2 { margin: 2px 0 1px; font-size: 14px; line-height: 1.25; }
  .dashboard-page article.property-card .card-head .eyebrow,
  .dashboard-page article.property-card .card-head .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-page article.property-card .card-head .muted { font-size: 11px; }
  .dashboard-page article.property-card .status { grid-column: 1/-1; order: 2; justify-content: flex-start; min-height: 0; padding: 2px 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 10px; line-height: 1.35; white-space: normal; }
  .dashboard-page article.property-card.is-paid .status.paid { color: var(--green); background: transparent; }
  .dashboard-page article.property-card .total-rent { grid-column: 1/-1; order: 3; align-items: flex-start; flex-direction: column; gap: 1px; margin: 6px 0 2px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
  .dashboard-page article.property-card .total-rent span { font-size: 10px; letter-spacing: .025em; text-transform: uppercase; }
  .dashboard-page article.property-card .mobile-payment-trigger,
  .dashboard-page article.property-card .mobile-property-toggle { order: 5; min-width: 0; min-height: 44px; padding: 6px; border: 1px solid #d7e1da; border-radius: 9px; font-size: 11px; font-weight: 700; }
  .dashboard-page article.property-card .desktop-payment-trigger { display: none; }
  .dashboard-page article.property-card .mobile-payment-trigger { display: inline-flex; grid-column: 1/-1; width: 100%; }
  .dashboard-page article.property-card:has(.mobile-property-toggle) .mobile-payment-trigger { grid-column: 2; }
  .dashboard-page article.property-card .mobile-property-toggle { display: inline-flex; grid-column: 1; align-items: center; justify-content: center; gap: 4px; color: var(--muted); background: #fff; cursor: pointer; }
  .dashboard-page article.property-card .mobile-property-toggle svg { transition: transform 160ms ease; }
  .dashboard-page article.property-card .mobile-property-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .dashboard-page article.property-card .round-locked { grid-column: 1/-1; order: 5; }
  .dashboard-page article.property-card .rent-breakdown { display: none; grid-column: 1/-1; order: 6; gap: 7px; margin-top: 4px; padding: 10px 0 0; border-top: 1px solid var(--line); border-bottom: 0; }
  .dashboard-page article.property-card.details-open .rent-breakdown { display: grid; }
  .dashboard-page article.property-card .rent-breakdown div { align-items: flex-start; flex-direction: column; gap: 2px; }
  .dashboard-page article.property-card .rent-breakdown .rent-value,
  .dashboard-page article.property-card .rent-breakdown .share-value { justify-content: space-between; width: 100%; }
  .dashboard-page article.property-card .rent-breakdown b { font-size: 12px; overflow-wrap: anywhere; }
  .dashboard-page article.property-card>.rent:not(.total-rent) { grid-column: 1/-1; order: 3; margin: 8px 0 2px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 17px; overflow-wrap: anywhere; }
  .distribution-card { grid-template-columns: 1fr; }
  .distribution-card>div { border-right: 0; border-bottom: 1px solid var(--line); }
  .distribution-card>div:last-child { border-bottom: 0; }
  .holdings-form { grid-template-columns: 1fr; }
  .property-directory { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .property-summary-card { min-height: 76px; padding: 12px; }
  .property-summary-card h2 { overflow-wrap: anywhere; font-size: 15px; }
  .property-dialog form { padding: 20px; }
  .property-month-state { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .shared-charge-form { grid-template-columns: 1fr; }
  .shared-charge-form .btn { width: 100%; }
  .dashboard-page .shared-charge-form>.btn { margin-top: 0; }
  .payment-question-actions .btn,
  .dialog-actions .btn { width: 100%; }
  .payment-dialog form { padding: 22px; }
  .ledger-summary { grid-template-columns: 1fr; }
  .ledger-summary>div { border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger-summary>div:last-child { border-bottom: 0; }
  .ledger-row { grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .ledger-edit { grid-column: 1/-1; justify-self: start; }
}

@media (max-width: 360px) {
  .payment-question-actions,
  .dialog-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .property-summary-card { transition: none; }
  .property-summary-card:hover { transform: none; }
}
