.portfolio-panel {
  margin-bottom: 20px;
}

/* Portfolio ledger: keep payment and the running amount due prominent. */
.portfolio-table {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.portfolio-table table {
  min-width: 1200px;
}
.portfolio-due {
  font-weight: 700;
  color: #354238 !important;
  font-variant-numeric: tabular-nums;
}
.portfolio-mobile-due {
  display: none;
}
.portfolio-mobile-payment-heading {
  display: none;
}
@media (max-width: 760px) {
  .portfolio-table {
    box-sizing: border-box;
    width: calc(100% + 30px);
    margin-inline: -15px;
    border-radius: 0;
    border-inline: 0;
  }
  .portfolio-table table {
    width: 182vw;
    min-width: 182vw;
    table-layout: fixed;
  }
  .portfolio-table th,
  .portfolio-table td {
    box-sizing: border-box;
    padding-block: 8px;
    padding-inline: 0;
  }
  .portfolio-table th {
    font-size: 8px;
    letter-spacing: 0.45px;
  }
  .portfolio-table td {
    font-size: 10px;
  }
  .portfolio-table th:nth-child(1),
  .portfolio-table td:nth-child(1) {
    position: sticky;
    left: 0;
    width: 10.5vw;
    min-width: 10.5vw;
    max-width: 10.5vw;
    z-index: 2;
    background: #fff;
    text-align: center;
    padding-right: 0;
    padding-left: 0;
  }
  .portfolio-table th:nth-child(1) {
    z-index: 4;
    background: #fafbf9;
  }
  .portfolio-table th:nth-child(2),
  .portfolio-table td:nth-child(2) {
    display: none;
  }
  .portfolio-table tbody tr:hover td:nth-child(1) {
    background: #fbfcfa;
  }
  .portfolio-table .portfolio-payment-action {
    margin-inline: auto;
  }
  .portfolio-mobile-payment-heading {
    display: inline;
  }
  .portfolio-desktop-payment-heading {
    display: none;
  }
  .portfolio-table .portfolio-mobile-due {
    display: block;
    margin: 0 0 4px;
    color: var(--green);
    font-size: clamp(8px, 2.1vw, 9px);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .portfolio-mobile-due small {
    font-size: 8px;
    font-weight: 500;
  }
  .portfolio-table .table-subtext {
    display: none;
  }
  .portfolio-table th,
  .portfolio-table td {
    padding-inline: 0;
  }
  .portfolio-table th:nth-child(3),
  .portfolio-table td:nth-child(3) {
    width: 43vw;
    min-width: 43vw;
    max-width: 43vw;
    overflow-wrap: anywhere;
  }
  .portfolio-table th:nth-child(4),
  .portfolio-table td:nth-child(4),
  .portfolio-table th:nth-child(5),
  .portfolio-table td:nth-child(5) {
    width: 5.25vw;
    min-width: 5.25vw;
    max-width: 5.25vw;
    font-size: 7px;
    letter-spacing: 0.2px;
  }
  .portfolio-table th:nth-child(6),
  .portfolio-table td:nth-child(6) {
    width: 36vw;
    min-width: 36vw;
    max-width: 36vw;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .portfolio-table td:nth-child(3) .table-action {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    vertical-align: middle;
  }
  .portfolio-table .property-row-note {
    display: none;
  }
  .portfolio-table td.portfolio-contact-action {
    width: 5.25vw;
    min-width: 5.25vw;
    max-width: 5.25vw;
    padding-right: 0;
    padding-left: 0;
  }
  .portfolio-table th:nth-child(7),
  .portfolio-table td:nth-child(7),
  .portfolio-table th:nth-child(8),
  .portfolio-table td:nth-child(8) {
    width: 41vw;
    min-width: 41vw;
    max-width: 41vw;
  }
  .portfolio-table .portfolio-icon-action {
    width: 5vw;
    min-width: 5vw;
    height: 5vw;
  }
  .portfolio-table .portfolio-payment-action {
    width: 16px;
    min-width: 16px;
  }
  .portfolio-table .portfolio-payment-action svg {
    width: 13px;
    height: 13px;
  }
  .portfolio-table .portfolio-icon-action svg {
    width: 13px;
    height: 13px;
  }
}
@media (max-width: 360px) {
  .portfolio-table th:nth-child(1),
  .portfolio-table td:nth-child(1) {
    width: 11.5vw;
    min-width: 11.5vw;
    max-width: 11.5vw;
  }
  .portfolio-table th:nth-child(3),
  .portfolio-table td:nth-child(3) {
    width: 42vw;
    min-width: 42vw;
    max-width: 42vw;
  }
  .portfolio-table th:nth-child(4),
  .portfolio-table td:nth-child(4),
  .portfolio-table th:nth-child(5),
  .portfolio-table td:nth-child(5) {
    width: 5vw;
    min-width: 5vw;
    max-width: 5vw;
  }
  .portfolio-table td.portfolio-contact-action {
    width: 5vw;
    min-width: 5vw;
    max-width: 5vw;
  }
  .portfolio-table th:nth-child(6),
  .portfolio-table td:nth-child(6) {
    width: 36.5vw;
    min-width: 36.5vw;
    max-width: 36.5vw;
  }
  .portfolio-table .portfolio-icon-action {
    width: 16px;
    min-width: 16px;
    height: 16px;
  }
  .portfolio-table .portfolio-icon-action svg {
    width: 12px;
    height: 12px;
  }
  .portfolio-table tfoot td:nth-child(1) {
    width: 11.5vw;
  }
}

.portfolio-table tfoot tr {
  border-top: 2px solid var(--line);
  background: var(--canvas);
}
.portfolio-contact-action {
  width: 48px;
  min-width: 48px;
  text-align: center;
}

.portfolio-template-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  cursor: pointer;
}

.portfolio-template-action:hover {
  color: var(--green);
}

.template-edit-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}
.portfolio-icon-action {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
}
.portfolio-icon-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.portfolio-icon-action:hover {
  background: var(--surface);
}
.portfolio-payment-action {
  display: flex;
  width: 32px;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.portfolio-payment-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.portfolio-icon-action.unavailable {
  opacity: 0.38;
}
.property-party-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.portfolio-table tfoot td {
  font-weight: 700;
  white-space: nowrap;
}
.portfolio-table tfoot td:nth-child(1) {
  position: sticky;
  z-index: 2;
  background: var(--canvas);
}
.portfolio-table tfoot td:nth-child(1) {
  left: 0;
}
.portfolio-table tfoot .table-subtext {
  display: block;
}

.portfolio-table tbody td.payment-received-this-month {
  background: #e7f3eb;
}
.portfolio-table tbody tr:hover td.payment-received-this-month {
  background: #dceee2;
}
.portfolio-table tbody td.payment-paid-in-full-this-month {
  background: #b8d9c3;
}
.portfolio-table tbody tr:hover td.payment-paid-in-full-this-month {
  background: #a6cfb4;
}
.portfolio-table tbody td.payment-not-received-this-month {
  background: #fbe9e9;
}
.portfolio-table tbody tr:hover td.payment-not-received-this-month {
  background: #f6dddd;
}
.portfolio-table {
  overflow: auto;
}
.portfolio-row-actions {
  display: flex;
  gap: 6px;
}
.property-row-name {
  font-size: 12px;
}
.property-row-note {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 2px;
  padding: 1px 0;
  border: 0;
  background: transparent;
  color: #8a968d;
  font-size: 10px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}
.property-row-note em {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  font-style: italic;
}
.property-row-note:not(.has-note) {
  color: #9aa49c;
}
.property-row-note:hover {
  color: var(--green);
  text-decoration: underline;
}
html[data-theme="dark"] .portfolio-table th:nth-child(1) {
  background: #2c4033;
}
html[data-theme="dark"] .portfolio-table td:nth-child(1) {
  background: #24352b;
}
html[data-theme="dark"] .portfolio-table tbody tr:hover td:nth-child(1) {
  background: #304838;
}
@media (max-width: 760px) {
  .portfolio-table tfoot td:nth-child(1) {
    left: 0;
    width: 13vw;
  }
  .portfolio-table tfoot td:nth-child(2) {
    display: none;
  }
}
html[data-theme="dark"] .portfolio-table tbody td.payment-received-this-month {
  background: #315f40;
}
html[data-theme="dark"]
  .portfolio-table
  tbody
  tr:hover
  td.payment-received-this-month {
  background: #3b704c;
}
html[data-theme="dark"]
  .portfolio-table
  tbody
  td.payment-paid-in-full-this-month {
  background: #428b5a;
}
html[data-theme="dark"]
  .portfolio-table
  tbody
  tr:hover
  td.payment-paid-in-full-this-month {
  background: #4b9a65;
}
html[data-theme="dark"]
  .portfolio-table
  tbody
  td.payment-not-received-this-month {
  background: #74434c;
}
html[data-theme="dark"]
  .portfolio-table
  tbody
  tr:hover
  td.payment-not-received-this-month {
  background: #86505b;
}
html[data-theme="dark"] .portfolio-table .table-action,
html[data-theme="dark"] .portfolio-table .property-party-name {
  color: #83e2a8;
}
html[data-theme="dark"] .portfolio-table .property-row-name,
html[data-theme="dark"] .portfolio-table .property-party-name {
  color: #f1f7f2;
}
html[data-theme="dark"] .property-row-note {
  color: #a7b3aa;
}
html[data-theme="dark"] .portfolio-table td.portfolio-due {
  color: #b8f0cd !important;
}
