html,
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

.rent-dashboard-shell {
  box-sizing: border-box;
  margin: 30px auto;
  margin-top: 80px;
  max-width: 1200px;
  padding: 28px;
}

.rent-dashboard-header h1 {
  font-size: 2.35rem;
  margin: 0;
}

.dashboard-subtitle {
  color: var(--exec-muted, #5d6b7c);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 8px 0 0;
  max-width: 680px;
}

.dashboard-header-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rent-metrics-grid {
  background: transparent !important;
  border: 0 !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 0 !important;
  box-shadow: none !important;
}

.rent-metrics-grid .metric-card {
  border-radius: 8px;
  min-height: 92px;
  padding: 16px;
}

.rent-metrics-grid .metric-card span {
  display: block;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.rent-metrics-grid .metric-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.15;
}

.rent-metrics-grid .metric-card.is-positive strong {
  color: var(--exec-teal, #176b4d);
}

.rent-metrics-grid .metric-card.is-warning strong {
  color: var(--exec-gold, #9a650f);
}

.rent-metrics-grid .metric-card.is-negative strong {
  color: var(--exec-red, #a83232);
}

.rent-insights-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.rent-insight-card {
  background: linear-gradient(180deg, rgba(15, 36, 55, 0.92), rgba(8, 23, 38, 0.95));
  border: 1px solid rgba(143, 171, 201, 0.22);
  border-left: 4px solid rgba(75, 163, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 16px;
}

.rent-insight-card span {
  color: #9fb2c8;
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.rent-insight-card strong {
  color: #f7fbff;
  font-size: 1.3rem;
  line-height: 1.12;
}

.rent-insight-card small {
  color: #b7c8da;
  line-height: 1.4;
}

.rent-insight-card.is-positive {
  border-left-color: #2fc7a1;
}

.rent-insight-card.is-positive strong {
  color: #a9f5df;
}

.rent-insight-card.is-warning {
  border-left-color: #f4c95d;
}

.rent-insight-card.is-warning strong {
  color: #ffe3a3;
}

.rent-insight-card.is-negative {
  border-left-color: #ff7a6e;
}

.rent-insight-card.is-negative strong {
  color: #ffb7ae;
}

.rent-reconciliation-panel {
  background: linear-gradient(180deg, rgba(12, 31, 51, 0.82), rgba(7, 20, 34, 0.94));
  border: 1px solid rgba(143, 171, 201, 0.2);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 14px;
}

.rent-reconciliation-panel .section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rent-reconciliation-panel h2 {
  color: #f7fbff;
  font-size: 1.18rem;
  margin: 0;
}

.rent-reconciliation-status {
  background: rgba(47, 199, 161, 0.12);
  border: 1px solid rgba(47, 199, 161, 0.3);
  border-radius: 999px;
  color: #dffcf7;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.rent-reconciliation-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rent-reconciliation-card {
  background: rgba(8, 20, 34, 0.78);
  border: 1px solid rgba(143, 171, 201, 0.18);
  border-top: 3px solid rgba(75, 163, 255, 0.72);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.rent-reconciliation-card span {
  color: #9fb2c8;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.rent-reconciliation-card strong {
  color: #f7fbff;
  font-size: 1.18rem;
  line-height: 1.15;
}

.rent-reconciliation-card small {
  color: #b7c8da;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.rent-reconciliation-card.is-positive {
  border-top-color: #2fc7a1;
}

.rent-reconciliation-card.is-positive strong {
  color: #a9f5df;
}

.rent-reconciliation-card.is-warning {
  border-top-color: #f4c95d;
}

.rent-reconciliation-card.is-warning strong {
  color: #ffe3a3;
}

.rent-reconciliation-card.is-negative {
  border-top-color: #ff7a6e;
}

.rent-reconciliation-card.is-negative strong {
  color: #ffb7ae;
}

.lease-readiness-panel {
  background: linear-gradient(180deg, rgba(12, 31, 51, 0.82), rgba(7, 20, 34, 0.94));
  border: 1px solid rgba(143, 171, 201, 0.2);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 14px;
}

.lease-readiness-panel .section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lease-readiness-panel h2 {
  color: #f7fbff;
  font-size: 1.18rem;
  margin: 0;
}

.lease-readiness-status {
  background: rgba(75, 163, 255, 0.12);
  border: 1px solid rgba(75, 163, 255, 0.32);
  border-radius: 999px;
  color: #d9ecff;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.lease-readiness-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lease-readiness-card {
  background: rgba(8, 20, 34, 0.78);
  border: 1px solid rgba(143, 171, 201, 0.18);
  border-left: 4px solid rgba(75, 163, 255, 0.72);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.lease-readiness-card.is-positive {
  border-left-color: #2fc7a1;
}

.lease-readiness-card.is-warning {
  border-left-color: #f4c95d;
}

.lease-readiness-card-heading {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lease-readiness-card-heading span {
  color: #9fb2c8;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.lease-readiness-card-heading strong {
  color: #f7fbff;
  font-size: 1.28rem;
  line-height: 1;
}

.lease-readiness-card.is-positive .lease-readiness-card-heading strong {
  color: #a9f5df;
}

.lease-readiness-card.is-warning .lease-readiness-card-heading strong {
  color: #ffe3a3;
}

.lease-readiness-card p {
  color: #b7c8da;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.lease-readiness-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lease-readiness-action {
  align-items: center;
  background: rgba(107, 214, 198, 0.12);
  border: 1px solid rgba(107, 214, 198, 0.34);
  border-radius: 999px;
  color: #dffcf7;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  text-decoration: none;
}

.lease-readiness-action:hover,
.lease-readiness-action:focus-visible {
  background: linear-gradient(135deg, #2fc7a1, #4ba3ff);
  color: #03101c;
  outline: none;
}

.rent-followup-panel {
  background: linear-gradient(180deg, rgba(16, 38, 61, 0.82), rgba(10, 24, 39, 0.9));
  border: 1px solid rgba(143, 171, 201, 0.2);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 14px;
}

.rent-followup-panel .section-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rent-followup-panel h2 {
  color: #f7fbff;
  font-size: 1.18rem;
  margin: 0;
}

.rent-followup-status {
  background: rgba(75, 163, 255, 0.12);
  border: 1px solid rgba(75, 163, 255, 0.32);
  border-radius: 999px;
  color: #d9ecff;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.rent-followup-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rent-followup-item,
.rent-followup-empty {
  background: rgba(8, 20, 34, 0.78);
  border: 1px solid rgba(143, 171, 201, 0.18);
  border-left: 4px solid #4ba3ff;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.rent-followup-item[data-state="late"] {
  background: rgba(74, 42, 25, 0.52);
  border-color: rgba(244, 201, 93, 0.3);
  border-left-color: #f4c95d;
}

.rent-followup-content {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rent-followup-content strong {
  color: #f7fbff;
  overflow-wrap: anywhere;
}

.rent-followup-content span,
.rent-followup-content small,
.rent-followup-empty {
  color: #b7c8da;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.rent-followup-content small {
  color: #ffe3a3;
  font-weight: 850;
}

.rent-followup-action {
  align-items: center;
  background: rgba(107, 214, 198, 0.12);
  border: 1px solid rgba(107, 214, 198, 0.34);
  border-radius: 999px;
  color: #dffcf7;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: center;
  margin-top: 10px;
  min-height: 30px;
  padding: 0 10px;
  text-decoration: none;
  width: fit-content;
}

.rent-followup-action:hover,
.rent-followup-action:focus-visible {
  background: linear-gradient(135deg, #2fc7a1, #4ba3ff);
  color: #03101c;
  outline: none;
}

.rent-control-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
}

.compact-filter-bar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.25fr) minmax(160px, 1.05fr) repeat(4, minmax(120px, 0.8fr));
  padding: 0;
}

.filter-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-group label {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.filter-group input,
.filter-group select {
  box-sizing: border-box;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.rent-quick-filter-bar {
  margin: 0;
}

.rent-quick-filter-bar button {
  min-height: 36px;
  padding: 8px 12px;
}

.rent-table-panel {
  background: rgba(9, 22, 36, 0.72);
  border: 1px solid rgba(172, 196, 219, 0.2);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

#rentTable {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  min-width: 1160px;
  width: 100%;
}

#rentTable th,
#rentTable td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

#rentTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.rent-cell-primary {
  color: inherit;
  display: block;
  font-weight: 750;
}

.rent-cell-subtext {
  color: var(--exec-muted, #5d6b7c);
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 4px;
}

.rent-payment-reference {
  color: #d9ecff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
}

.rent-status-badge,
.rent-source-badge,
.rent-autopay-badge {
  align-items: center;
  border: 1px solid rgba(172, 196, 219, 0.28);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  min-height: 28px;
  padding: 7px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-paid,
.source-stripe,
.autopay-enabled {
  background: rgba(47, 199, 161, 0.16);
  border-color: rgba(47, 199, 161, 0.34);
  color: #95f2dc;
}

.status-due,
.autopay-invited {
  background: rgba(244, 201, 93, 0.16);
  border-color: rgba(244, 201, 93, 0.36);
  color: #ffe39b;
}

.status-late {
  background: rgba(255, 122, 110, 0.16);
  border-color: rgba(255, 122, 110, 0.36);
  color: #ffb7ae;
}

.status-upcoming,
.source-awaiting,
.autopay-manual {
  background: rgba(159, 178, 200, 0.14);
  border-color: rgba(159, 178, 200, 0.26);
  color: #cbd8e7;
}

.source-manual {
  background: rgba(75, 163, 255, 0.14);
  border-color: rgba(75, 163, 255, 0.32);
  color: #abd6ff;
}

.rent-balance-cell .rent-cell-primary {
  font-variant-numeric: tabular-nums;
}

.rent-balance-cell.has-balance .rent-cell-primary {
  color: #ffb7ae;
}

.rent-balance-cell.is-clear .rent-cell-primary {
  color: #95f2dc;
}

.rent-action-btn {
  align-items: center;
  background: rgba(47, 199, 161, 0.16);
  border: 1px solid rgba(47, 199, 161, 0.34);
  border-radius: 6px;
  color: #eafff8;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}

.rent-action-btn:hover,
.rent-action-btn:focus-visible {
  background: rgba(47, 199, 161, 0.28);
  outline: none;
}

.rent-action-btn:disabled,
.rent-recorded-pill {
  background: rgba(159, 178, 200, 0.12);
  border: 1px solid rgba(159, 178, 200, 0.22);
  border-radius: 6px;
  color: #9fb2c8;
  cursor: default;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}

.rent-empty-row td {
  color: var(--exec-muted, #5d6b7c);
  font-weight: 700;
  padding: 24px;
  text-align: center;
}

.is-auth-checking #navbar-container,
.is-auth-checking .rent-dashboard-shell,
.is-auth-checking .modal {
  display: none;
}

.modal {
  align-items: center;
  background: rgba(1, 8, 15, 0.78);
  box-sizing: border-box;
  display: none;
  inset: 0;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  position: fixed;
  z-index: 2500;
}

.modal.is-visible {
  display: flex;
}

.modal-content {
  background: linear-gradient(180deg, rgba(9, 26, 45, 0.98), rgba(6, 20, 35, 0.98));
  border: 1px solid rgba(137, 169, 202, 0.32);
  border-radius: 10px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
  box-sizing: border-box;
  color: #f7fbff;
  margin: auto;
  max-width: 540px;
  max-height: min(90vh, 720px);
  overflow-y: auto;
  padding: 22px;
  position: relative;
  width: min(92vw, 540px);
}

.modal-content h2 {
  margin-top: 0;
}

.close {
  align-items: center;
  background: rgba(159, 178, 200, 0.12);
  border: 1px solid rgba(159, 178, 200, 0.24);
  border-radius: 999px;
  color: #f7fbff;
  cursor: pointer;
  display: inline-flex;
  float: none;
  font-size: 28px;
  font-weight: bold;
  height: 36px;
  justify-content: center;
  line-height: 1;
  min-height: 36px;
  padding: 0;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
}

.close:hover,
.close:focus-visible {
  background: rgba(75, 163, 255, 0.2);
  outline: 2px solid rgba(75, 163, 255, 0.35);
  outline-offset: 2px;
}

.modal-content label {
  color: #d9e7f6;
  display: block;
  font-weight: 750;
  margin-bottom: 10px;
}

.modal-content input,
.modal-content select {
  background: rgba(5, 18, 31, 0.94);
  border: 1px solid rgba(137, 169, 202, 0.34);
  border-radius: 8px;
  box-sizing: border-box;
  caret-color: #f7fbff;
  color: #f7fbff;
  margin: 4px 0 12px;
  min-height: 40px;
  padding: 8px;
  width: 100%;
}

.modal-content input::placeholder {
  color: #8ea3bb;
}

.modal-content input:focus,
.modal-content select:focus {
  border-color: rgba(75, 163, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(75, 163, 255, 0.16);
  outline: none;
}

.modal-content button {
  min-height: 40px;
  padding: 8px 16px;
}

#submitLeaseButton {
  background: linear-gradient(135deg, #2fc7a1, #4ba3ff);
  border: 0;
  border-radius: 8px;
  color: #02101d;
  cursor: pointer;
  font-weight: 900;
  width: 100%;
}

#submitLeaseButton:disabled {
  cursor: wait;
  filter: grayscale(0.5);
  opacity: 0.68;
}

.lease-form-status {
  background: rgba(75, 163, 255, 0.1);
  border: 1px solid rgba(75, 163, 255, 0.24);
  border-radius: 8px;
  color: #cfe2f4;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
  margin: -2px 0 12px;
  padding: 10px 12px;
}

.lease-form-status[data-tone="success"] {
  background: rgba(47, 199, 161, 0.12);
  border-color: rgba(47, 199, 161, 0.3);
  color: #a9f5df;
}

.lease-form-status[data-tone="warning"] {
  background: rgba(244, 201, 93, 0.12);
  border-color: rgba(244, 201, 93, 0.32);
  color: #ffe3a3;
}

.lease-form-status[data-tone="danger"] {
  background: rgba(255, 122, 110, 0.12);
  border-color: rgba(255, 122, 110, 0.32);
  color: #ffb7ae;
}

.modal-checkbox-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-checkbox-row label {
  margin: 0;
}

.modal-checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  width: 16px;
}

.metric-banner {
  display: none;
}

@media (max-width: 1100px) {
  .rent-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rent-insights-grid,
  .rent-reconciliation-grid,
  .lease-readiness-grid,
  .rent-followup-list,
  .compact-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .rent-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rent-insights-grid,
  .rent-reconciliation-grid,
  .lease-readiness-grid,
  .rent-followup-list,
  .compact-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .rent-dashboard-shell {
    margin: 18px 12px;
    margin-top: 78px;
    padding: 18px;
  }

  .dashboard-header-actions {
    align-items: stretch;
  }

  .rent-metrics-grid,
  .rent-insights-grid,
  .rent-reconciliation-grid,
  .lease-readiness-grid,
  .rent-followup-list,
  .compact-filter-bar {
    grid-template-columns: 1fr;
  }

  .rent-followup-panel .section-heading,
  .lease-readiness-panel .section-heading,
  .rent-reconciliation-panel .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .rent-dashboard-header h1 {
    font-size: 1.85rem;
  }

  .rent-table-panel {
    margin-inline: -4px;
  }

  #rentTable {
    min-width: 1040px;
  }
}
