.fund-page {
  min-height: 100vh;
}

.fund-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.language-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}

.language-switcher button {
  padding: 2px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.68;
}

.language-switcher button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 1;
}

.fund-file-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fund-file-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.getting-started-card,
.fund-message,
.fund-workspace {
  width: min(1280px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
}

.getting-started-card {
  margin-top: 16px;
}

.getting-started-card details {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  box-shadow: 0 14px 32px rgba(30, 64, 175, 0.09);
}

.getting-started-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: var(--blue-dark);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.getting-started-card summary::-webkit-details-marker {
  display: none;
}

.getting-started-card summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.25rem;
  line-height: 1;
}

.getting-started-card details[open] summary::after {
  content: "−";
}

.getting-started-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px 16px;
}

.getting-started-content ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.getting-started-content li + li {
  margin-top: 5px;
}

.fund-save-note {
  display: flex;
  max-width: 390px;
  gap: 4px;
  align-items: flex-end;
  flex-direction: column;
  text-align: right;
}

.backup-save-note {
  max-width: 680px;
  align-items: flex-start;
  margin-top: 14px;
  text-align: left;
}

.backup-save-note .autosave-status {
  padding-left: 0;
  background: transparent;
}

.backup-status {
  color: var(--blue-dark);
  font-size: 0.85rem;
  font-weight: 900;
}

.fund-save-note span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.fund-message {
  display: none;
  margin-top: 12px;
  margin-bottom: 0;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-weight: 800;
}

.fund-message.is-success,
.fund-message.is-error {
  display: block;
}

.fund-message.is-success {
  color: #14532d;
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
}

.fund-message.is-error {
  color: #861b1b;
  border: 1px solid #ffc9c9;
  background: #fff1f1;
}

.copy-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #14532d;
  background: #ecfdf3;
  box-shadow: 0 18px 40px rgba(18, 32, 55, 0.18);
  font-size: 0.9rem;
  font-weight: 900;
}

.copy-toast[hidden] {
  display: none;
}

.fund-workspace {
  display: grid;
  gap: 18px;
  padding: 20px 0 56px;
}

.fund-panel,
.fund-dashboard,
.monthly-report {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 16px 42px rgba(18, 32, 55, 0.08);
}

.fund-sharing-help {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.fund-sharing-help p {
  margin: 0;
}

.fund-profile-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.fund-profile-card h3,
.fund-profile-card p {
  margin: 0;
}

.fund-profile-card h3 {
  color: var(--blue-dark);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.fund-profile-card p {
  margin-top: 5px;
  color: var(--muted);
}

.fund-profile-contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.fund-profile-contact-list div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #f8fbff;
}

.fund-profile-contact-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.fund-profile-contact-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.fund-form textarea,
.fund-share-dialog textarea,
.report-copy-dialog textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  resize: vertical;
}

.fund-optional-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.field-help-details {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.field-help-details summary {
  display: inline;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.field-help-details p {
  margin: 4px 0 0;
}

.fund-optional-details > summary,
.dashboard-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--blue-dark);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.fund-optional-details > summary::-webkit-details-marker,
.dashboard-detail summary::-webkit-details-marker {
  display: none;
}

.fund-optional-details > summary::after,
.dashboard-detail summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.25rem;
  line-height: 1;
}

.fund-optional-details[open] > summary::after,
.dashboard-detail[open] summary::after {
  content: "−";
}

.optional-contact-grid {
  padding: 0 14px 14px;
}

.fund-share-dialog textarea,
.report-copy-dialog textarea {
  min-height: 260px;
  max-height: 45vh;
  margin: 12px 0 16px;
}

.fund-dashboard {
  border-color: #a8c7fa;
  background: linear-gradient(145deg, #ffffff 0%, #f3f8ff 100%);
  box-shadow: 0 20px 48px rgba(30, 64, 175, 0.13);
}

.fund-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.fund-section-heading h2,
.report-actions-panel h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.fund-section-heading p,
.borrower-heading p,
.report-actions-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.fund-kicker {
  margin: 0 0 3px !important;
  color: var(--blue) !important;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 0.82rem;
  font-weight: 900;
}

.autosave-status::before {
  content: none;
}

.metric-label {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.help-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.help-button:hover,
.help-button:focus-visible {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.help-dialog {
  width: min(420px, calc(100% - 28px));
}

.help-dialog p {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.fund-form input,
.fund-form select,
.borrower-form input,
.borrower-form select {
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #b8c3d3;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.fund-form input::placeholder,
.fund-form textarea::placeholder,
.borrower-form input::placeholder,
.borrower-form textarea::placeholder {
  color: #7c8aa3;
  opacity: 1;
}

.clearable-field {
  position: relative;
}

.clearable-field input,
.clearable-field textarea {
  padding-right: 42px;
}

.clear-field-button {
  position: absolute;
  top: 32px;
  right: 8px;
  display: none;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e2f2;
  border-radius: 50%;
  color: var(--muted);
  background: #f8fbff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.clearable-field.is-focused .clear-field-button {
  display: inline-flex;
}

.clear-field-button:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
}

.fund-form input:focus,
.fund-form select:focus,
.borrower-form input:focus,
.borrower-form select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

.fund-form input.is-invalid,
.fund-form select.is-invalid,
.borrower-form input.is-invalid,
.borrower-form select.is-invalid {
  border-color: #c2410c;
  background: #fff7ed;
}

.checkbox-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.borrower-form .checkbox-field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.checkbox-field label,
.checkbox-field small {
  display: block;
}

.checkbox-field small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.currency-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #b8c3d3;
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.currency-input:focus-within {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

.currency-input span {
  min-width: 42px;
  padding: 0 9px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.currency-input input {
  border: 0;
  border-right: 1px solid #d8e2f2;
  border-radius: 0;
}

.currency-input input:focus {
  outline: 0;
}

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

.metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.metric-card > span {
  display: block;
  min-height: 2.6em;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
}

.metric-card strong {
  display: block;
  color: var(--blue-dark);
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  line-height: 1.05;
}

.metric-primary {
  color: #fff;
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.metric-primary > span,
.metric-primary strong {
  color: #fff;
}

.metric-cash-editor label {
  display: block;
  margin: 12px 0 5px;
  color: #dbeafe;
  font-size: 0.72rem;
  font-weight: 800;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(180px, 0.65fr));
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-cash-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.7fr);
  grid-template-rows: auto auto;
  column-gap: 22px;
  align-items: center;
}

.dashboard-cash-card > span,
.dashboard-cash-card > strong {
  grid-column: 1;
}

.dashboard-cash-card > span {
  min-height: 0;
  margin-bottom: 5px;
}

.dashboard-cash-card .cash-adjustment {
  grid-column: 2;
  grid-row: 1 / 3;
}

.dashboard-cash-card .cash-adjustment label {
  margin-top: 0;
}

.dashboard-value-card {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.dashboard-value-card > span {
  min-height: 0;
  margin-bottom: 5px;
}

.dashboard-value-card small {
  margin-top: 5px;
  color: var(--muted);
}

.dashboard-groups {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
}

.dashboard-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.dashboard-group h3 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 0.9rem;
}

.dashboard-detail {
  padding: 0;
  overflow: hidden;
}

.dashboard-detail .compact-metric-grid {
  padding: 0 14px 14px;
}

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

.compact-metric-grid > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: calc(var(--radius) - 2px);
  background: #fff;
}

.compact-metric-grid span,
.compact-metric-grid strong {
  display: block;
}

.compact-metric-grid span {
  min-height: 2.4em;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
}

.compact-metric-grid strong {
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  line-height: 1.05;
}

.compact-metric-wide {
  grid-column: 1 / -1;
}

.compact-metric-highlight {
  border: 1px solid #bfdbfe;
  background: #eff6ff !important;
}

.metric-cash-editor .currency-input {
  background: #fff;
}

.metric-cash-editor .currency-input span {
  color: var(--muted);
}

.metric-cash-editor input {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.metric-cash-editor input.is-invalid {
  background: #fff7ed;
}

.platform-disclaimer {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fbff;
  text-align: center;
}

.platform-disclaimer strong {
  display: block;
  color: var(--blue-dark);
  font-size: 0.95rem;
}

.platform-disclaimer p {
  max-width: 760px;
  margin: 6px auto 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

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

.expense-summary div {
  padding: 13px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.expense-summary span,
.expense-row time,
.expense-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.expense-summary span,
.expense-summary strong {
  display: block;
}

.expense-summary strong {
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: 1.2rem;
}

.expense-history-controls {
  display: flex;
  justify-content: flex-start;
  margin: 0 0 12px;
}

.expense-entry {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.expense-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.expense-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.expense-row-meta {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(100px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.expense-row strong {
  color: var(--blue-dark);
}

.expense-row span {
  overflow-wrap: anywhere;
}

.metric-projection {
  grid-column: span 2;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.borrower-heading {
  align-items: center;
}

.section-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.records-toggle {
  min-width: 150px;
}

.borrower-empty {
  padding: 34px 20px;
  border: 1px dashed #b8c3d3;
  border-radius: var(--radius);
  background: #f8fbff;
  text-align: center;
}

.borrower-empty h3 {
  margin-bottom: 6px;
}

.borrower-empty p {
  margin: 0;
  color: var(--muted);
}

.borrower-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.borrower-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.borrower-table th,
.borrower-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.borrower-table th {
  color: var(--muted);
  background: #f8fbff;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.borrower-table tbody tr:last-child td {
  border-bottom: 0;
}

.borrower-name {
  color: var(--ink);
  font-weight: 900;
}

.borrower-subdetail {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.status-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-active {
  color: #166534;
  background: #dcfce7;
}

.status-paidOff {
  color: #1e3a8a;
  background: #dbeafe;
}

.status-delinquent {
  color: #9a3412;
  background: #ffedd5;
}

.status-inactive {
  color: #475569;
  background: #e2e8f0;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.button-small {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #d8e2f2;
  border-radius: var(--radius);
  color: var(--blue-dark);
  background: #f7faff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.button-small.button-payment {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.button-small.button-delete {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff7f7;
}

.borrower-card-list {
  display: none;
  gap: 12px;
}

.borrower-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

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

.borrower-card h3 {
  margin: 0 0 3px;
}

.borrower-card-purpose {
  margin: 0;
  color: var(--muted);
}

.optional-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.borrower-card-key-metrics,
.borrower-card-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.borrower-card-key-metrics div,
.borrower-card-details div {
  min-width: 0;
}

.borrower-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.borrower-card dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.borrower-card-key-metrics {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: #fff;
}

.borrower-card-details {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.borrower-card-details[hidden] {
  display: none;
}

.borrower-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.borrower-card-footer .row-actions {
  flex: 1 1 auto;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.borrower-details-toggle {
  flex: 0 0 auto;
}

.member-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.member-summary span {
  color: var(--muted);
  font-weight: 800;
}

.member-summary strong {
  color: var(--blue-dark);
  font-size: 1.4rem;
}

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

.member-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.member-card .borrower-card-header {
  margin-bottom: 12px;
}

.member-card h3 {
  margin: 0;
}

.member-card-key-metrics,
.member-card-additional-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.member-card-key-metrics {
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: #fff;
}

.member-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.member-card dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.member-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-card-footer .row-actions {
  flex: 1 1 auto;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.member-details-toggle {
  flex: 0 0 auto;
}

.member-card-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.member-card-details[hidden] {
  display: none;
}

.member-card-details h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.member-card-details h4:not(:first-child) {
  margin-top: 16px;
}

.member-contribution-history {
  display: grid;
  gap: 6px;
}

.member-contribution-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(90px, 0.6fr) minmax(120px, 1.4fr);
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.84rem;
}

.member-contribution-row time,
.member-contribution-row span {
  color: var(--muted);
}

.member-contribution-empty {
  margin: 0;
  color: var(--muted);
}

.report-actions-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.report-action-buttons,
.contribution-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fund-data-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #f8fbff;
}

.fund-data-section h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.fund-data-section p:not(.fund-kicker) {
  max-width: 690px;
  margin: 4px 0 0;
  color: var(--muted);
}

.report-actions-panel p:not(.fund-kicker) {
  max-width: 720px;
  margin-bottom: 0;
}

.monthly-report {
  padding: 0;
  overflow: hidden;
}

.report-dialog {
  width: min(960px, calc(100% - 24px));
  max-width: 960px;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--white);
  box-shadow: 0 28px 80px rgba(18, 32, 55, 0.28);
  overflow: hidden;
}

.report-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.report-dialog-shell {
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: #166534;
  background: #f0fdf4;
  font-weight: 900;
}

.report-toolbar .dialog-actions {
  margin: 0;
  flex-wrap: wrap;
}

.report-sheet {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
}

.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--blue-dark);
}

.report-header p,
.report-header span,
.report-fund-name span {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-header h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.report-header > div:last-child {
  text-align: right;
}

.report-fund-name {
  padding: 24px 0;
}

.report-fund-name strong {
  color: var(--ink);
  font-size: 1.4rem;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.report-metrics div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.report-metrics dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.report-metrics dd {
  margin: 6px 0 0;
  color: var(--blue-dark);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.1;
}

.report-metrics .report-projection {
  grid-column: 1 / -1;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.report-borrowers {
  margin-top: 28px;
}

.report-borrowers > h3 {
  margin-bottom: 12px;
  color: var(--blue-dark);
  font-size: 1.2rem;
}

#report-borrower-list {
  display: grid;
  gap: 10px;
}

#equity-report-member-list {
  display: grid;
  gap: 10px;
}

.equity-report-member {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) repeat(3, minmax(120px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.equity-report-member span,
.equity-report-member strong {
  display: block;
}

.equity-report-member span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.equity-report-member strong {
  margin-top: 2px;
  color: var(--ink);
}

.report-empty {
  margin: 0;
  color: var(--muted);
}

.report-borrower {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  break-inside: avoid;
}

.report-borrower-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-borrower-heading > strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.report-borrower dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.report-borrower dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-borrower dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.report-payment-history {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-payment-history ul {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.report-footer {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.borrower-dialog,
.confirm-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 28px 80px rgba(13, 27, 47, 0.32);
}

.borrower-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(13, 27, 47, 0.58);
  backdrop-filter: blur(3px);
}

.borrower-form {
  padding: clamp(18px, 4vw, 30px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog-header h2,
.confirm-dialog h2 {
  margin: 0;
  font-size: 1.65rem;
}

.dialog-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

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

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

.calculated-payment {
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.calculated-payment span,
.calculated-payment strong,
.calculated-payment small {
  display: block;
}

.calculation-note {
  grid-column: 1 / -1;
  color: var(--muted);
}

.calculated-payment span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calculated-payment strong {
  margin-top: 3px;
  color: var(--blue-dark);
  font-size: 1.55rem;
}

.calculated-payment small {
  margin-top: 4px;
  color: var(--muted);
}

.payment-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

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

.payment-summary div {
  padding: 13px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
}

.payment-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.payment-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: 1.35rem;
}

.payment-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

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

.contribution-entry-actions {
  margin-top: 10px;
}

.payment-entry .button-secondary {
  white-space: nowrap;
}

.payment-message {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: #9a3412;
  font-size: 0.88rem;
  font-weight: 800;
}

.payment-history {
  margin-top: 18px;
}

.payment-history > p {
  margin: 0;
  color: var(--muted);
}

#payment-list {
  display: grid;
  gap: 7px;
}

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.payment-row strong,
.payment-row span {
  display: block;
}

.payment-row strong {
  color: var(--ink);
}

.payment-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.dialog-message {
  display: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #ffc9c9;
  border-radius: var(--radius);
  color: #861b1b;
  background: #fff1f1;
  font-weight: 800;
}

.dialog-message:not(:empty) {
  display: block;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.button-danger {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #b91c1c;
  border-radius: var(--radius);
  color: #fff;
  background: #b91c1c;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.confirm-dialog > div {
  padding: 26px;
}

.currency-migration-dialog form {
  padding: 26px;
}

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

.confirm-dialog p {
  color: var(--muted);
}

.quick-payment-dialog {
  width: min(540px, calc(100% - 24px));
}

.quick-payment-form {
  padding: 26px;
}

.quick-payment-summary {
  margin: 5px 0 0;
  font-size: 0.9rem;
}

.quick-payment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.quick-payment-fields .field-full {
  grid-column: 1 / -1;
}

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

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

  .dashboard-cash-card {
    grid-column: 1 / -1;
  }

  .metric-projection {
    grid-column: auto;
  }

  .member-card-key-metrics,
  .member-card-additional-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .fund-hero {
    flex-direction: column;
  }

  .report-actions-panel,
  .fund-data-section {
    align-items: stretch;
    flex-direction: column;
  }

  .report-action-buttons .button-primary,
  .report-action-buttons .button-secondary {
    flex: 1 1 220px;
  }

  .fund-file-actions .button-primary,
  .fund-file-actions .button-secondary,
  .report-actions-panel .button-primary {
    flex: 1 1 auto;
  }

  .borrower-table-wrap {
    display: none;
  }

  .borrower-card-list:not([hidden]) {
    display: grid;
  }

  .dashboard-groups {
    grid-template-columns: 1fr;
  }

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

  .dashboard-groups .dashboard-group:last-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .fund-profile-contact-list {
    grid-template-columns: 1fr;
  }
  .getting-started-card,
  .fund-message,
  .fund-workspace {
    width: min(100% - 24px, 1280px);
  }

  .getting-started-content {
    flex-direction: column;
    gap: 12px;
  }

  .getting-started-content .button-small {
    width: 100%;
  }

  .fund-workspace {
    padding-top: 12px;
  }

  .fund-panel,
  .fund-dashboard {
    padding: 16px;
  }

  .report-dialog {
    width: min(100% - 16px, 960px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .report-dialog-shell {
    max-height: calc(100dvh - 16px);
  }

  .report-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .report-toolbar .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .report-sheet {
    padding: 18px;
  }

  .fund-section-heading,
  .borrower-heading,
  .report-header {
    align-items: stretch;
    flex-direction: column;
  }

  .fund-information .fund-section-heading {
    gap: 10px;
  }

  .dashboard-summary {
    gap: 8px;
  }

  .dashboard-summary .metric-card {
    padding: 12px;
  }

  .dashboard-cash-card {
    display: block;
  }

  .fund-save-note {
    max-width: none;
    align-items: flex-start;
    text-align: left;
  }

  .autosave-status {
    padding: 5px 9px;
  }

  .section-heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .borrower-heading .button-primary,
  .borrower-heading .records-toggle {
    flex: 1 1 100%;
    width: 100%;
  }

  .metric-grid,
  .member-list,
  .dialog-fields,
  .report-metrics,
  .payment-summary,
  .payment-entry,
  .expense-summary,
  .expense-entry,
  .loan-calculation-grid,
  .report-borrower dl {
    grid-template-columns: 1fr;
  }

  .expense-row {
    align-items: stretch;
    flex-direction: column;
  }

  .expense-row-meta {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .expense-row .row-actions,
  .expense-entry-actions {
    width: 100%;
  }

  .expense-row .button-small,
  .expense-entry-actions .button-secondary,
  .expense-entry-actions .button-small {
    flex: 1 1 auto;
  }

  .dashboard-cash-card {
    display: block;
  }

  .dashboard-cash-card .cash-adjustment {
    margin-top: 10px;
  }

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

  .member-summary,
  .equity-report-member {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .member-summary {
    flex-direction: column;
  }

  .member-card {
    padding: 13px;
  }

  .member-card-key-metrics,
  .member-card-additional-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
  }

  .member-card-key-metrics {
    margin-bottom: 10px;
    padding: 9px;
  }

  .member-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .member-card-footer .row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .member-card-footer .button-small {
    width: 100%;
  }

  .member-details-toggle {
    align-self: flex-start;
  }

  .member-contribution-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }

  .member-contribution-row span {
    grid-column: 1 / -1;
  }

  .contribution-entry {
    grid-template-columns: 1fr;
  }

  .quick-payment-fields {
    grid-template-columns: 1fr;
  }

  .quick-payment-fields .field-full {
    grid-column: auto;
  }

  .metric-card > span {
    min-height: 0;
  }

  .report-metrics .report-projection {
    grid-column: auto;
  }

  .calculation-note {
    grid-column: auto;
  }

  .report-header > div:last-child {
    text-align: left;
  }

  .borrower-card {
    padding: 13px;
  }

  .borrower-card-header {
    margin-bottom: 10px;
  }

  .borrower-card-key-metrics,
  .borrower-card-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
  }

  .borrower-card-key-metrics {
    margin-bottom: 10px;
    padding: 9px;
  }

  .borrower-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .borrower-card-footer .row-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }

  .borrower-card-footer .button-small {
    width: 100%;
  }

  .borrower-details-toggle {
    align-self: flex-start;
  }

  .borrower-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .fund-hero,
  .fund-message,
  .fund-information,
  .fund-dashboard,
  .member-section,
  .expense-section,
  .borrower-section,
  .fund-sharing-section,
  .report-actions-panel,
  .fund-data-section,
  .platform-disclaimer,
  .report-toolbar,
  .site-footer {
    display: none !important;
  }

  .fund-workspace {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .report-dialog {
    display: none !important;
  }

  body.print-report-dialog .report-dialog.is-print-target {
    display: block !important;
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  body.print-report-dialog .report-dialog.is-print-target::backdrop {
    display: none !important;
  }

  body.print-report-dialog .report-dialog-shell {
    max-height: none;
    overflow: visible;
  }

  body.print-report-dialog .report-toolbar {
    display: none !important;
  }

  .report-sheet {
    max-width: none;
    padding: 0;
  }

  .report-metrics div {
    break-inside: avoid;
  }
}
