.dashboard-cashflow-watch{margin:18px 0 24px;padding:clamp(16px,3vw,24px);border:1px solid var(--er3-border,#e1e7ed);border-radius:20px;background:var(--er3-surface,#fff);box-shadow:var(--er3-shadow,0 8px 24px rgba(16,24,40,.05));min-width:0}
.dashboard-cashflow-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:14px 0}
.dashboard-cashflow-toolbar label{display:flex;flex-direction:column;gap:6px;min-width:min(100%,230px);font-weight:600;color:var(--er3-text,#243647)}
.dashboard-cashflow-toolbar input{min-height:44px;padding:9px 12px;border:1px solid var(--er3-border,#dbe3eb);border-radius:12px;background:var(--er3-surface,#fff);color:inherit}
.dashboard-cashflow-total{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 0;border-top:1px solid var(--er3-border,#e1e7ed);border-bottom:1px solid var(--er3-border,#e1e7ed)}
.dashboard-cashflow-total span{font-weight:650;color:var(--er3-text,#243647)}
.dashboard-cashflow-total strong{font-size:clamp(1.45rem,4vw,2rem);font-weight:800;letter-spacing:-.03em;color:var(--er3-accent,#087f73);text-align:right}
.dashboard-cashflow-split{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:14px 0}
.dashboard-cashflow-split>div{display:flex;flex-direction:column;gap:6px;min-width:0;padding:12px 14px;border:1px solid var(--er3-border,#e1e7ed);border-radius:12px;background:transparent}
.dashboard-cashflow-split span,.dashboard-cashflow-row small{font-size:.84rem;color:var(--er3-muted-text,#657487)}
.dashboard-cashflow-split strong{font-size:1rem;font-weight:650;color:var(--er3-muted-text,#657487)}
.dashboard-cashflow-split>div:last-child{border-color:color-mix(in srgb,var(--er3-accent,#087f73) 22%,var(--er3-border,#e1e7ed));background:color-mix(in srgb,var(--er3-accent,#087f73) 5%,transparent)}
.dashboard-cashflow-split>div:last-child strong{color:var(--er3-accent,#087f73)}
.dashboard-cashflow-list{display:grid;gap:0}
.dashboard-cashflow-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--er3-border,#e1e7ed)}
.dashboard-cashflow-row:last-child{border-bottom:0}
.dashboard-cashflow-row>span{display:grid;gap:4px;min-width:0}
.dashboard-cashflow-row>span strong{overflow-wrap:anywhere}
.dashboard-cashflow-row>strong{white-space:nowrap;text-align:right}
.dashboard-cashflow-empty{padding:16px 0;color:var(--er3-muted-text,#657487);line-height:1.5}
.project-receivables-heading{margin-top:20px;padding-top:16px;border-top:1px solid var(--er3-border,#e1e7ed)}
.project-receivables-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0 14px}
.project-receivables-toolbar .muted{max-width:460px}
.project-receivables-list{display:grid;gap:10px}
.project-receivable-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 16px;padding:14px;border:1px solid var(--er3-border,#e1e7ed);border-radius:14px;background:var(--er3-surface,#fff);min-width:0}
.project-receivable-main{display:grid;gap:5px;min-width:0}
.project-receivable-main strong{overflow-wrap:anywhere}
.project-receivable-main small,.project-receivable-amounts small{font-size:.84rem;color:var(--er3-muted-text,#657487)}
.project-receivable-amounts{display:grid;align-content:start;gap:4px;text-align:right}
.project-receivable-amounts strong{font-size:1.08rem;color:var(--er3-accent,#087f73)}
.project-receivable-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
.project-receivable-row.is-cancelled{opacity:.55}
@media(max-width:600px){.dashboard-cashflow-split{grid-template-columns:1fr}.dashboard-cashflow-total{align-items:flex-start;flex-direction:column}.dashboard-cashflow-total strong{text-align:left}.project-receivables-toolbar{align-items:stretch;flex-direction:column}.project-receivables-toolbar button{width:100%}.project-receivable-row{grid-template-columns:minmax(0,1fr)}.project-receivable-amounts{text-align:left}.project-receivable-actions{grid-column:auto}.dashboard-cashflow-row{align-items:flex-start}.dashboard-cashflow-row>strong{white-space:normal}}


/* Cashflow forecast: remove nonessential subtitle; keep date and explicit recalculation action. */
#appView #dashboardView #dashboardCashflow .section-title-line {
  grid-template-columns: minmax(0, 1fr);
}
#appView #dashboardView #dashboardCashflow .section-title-line small {
  display: none;
}
#appView #dashboardView .dashboard-cashflow-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 14px 0 18px;
}
#appView #dashboardView .dashboard-cashflow-toolbar label {
  flex: 1 1 220px;
  min-width: 0;
}
#appView #dashboardView .dashboard-cashflow-toolbar input {
  width: 100%;
  min-width: 0;
}
#appView #dashboardView .dashboard-cashflow-toolbar button {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  #appView #dashboardView .dashboard-cashflow-toolbar {
    align-items: flex-end;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }
  #appView #dashboardView .dashboard-cashflow-toolbar label {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
  }
  #appView #dashboardView .dashboard-cashflow-toolbar input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  #appView #dashboardView .dashboard-cashflow-toolbar button {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 9px;
    font-size: 13px;
    letter-spacing: -.02em;
  }
}


/* Final mobile cashflow toolbar fix: one compact row, no flex stretching or overflow. */
@media (max-width: 600px) {
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: end !important;
    justify-content: stretch !important;
    justify-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 14px 0 18px !important;
    padding: 0 !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > label {
    display: flex !important;
    flex-direction: column !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > label > input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > button[data-cashflow-refresh] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: end !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    box-sizing: border-box !important;
  }
}


/* Compact cashflow card and disclosure-first breakdown for mobile dashboard. */
#appView #dashboardView .dashboard-cashflow-watch {
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 14px;
  box-shadow: none;
}
#appView #dashboardView #dashboardCashflow .section-title-line {
  margin: 0 0 10px;
  padding: 0 0 10px;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-total {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  padding: 12px 0;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-total strong {
  font-size: clamp(1.45rem, 6vw, 1.85rem);
  text-align: left;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown {
  margin-top: 10px;
  border: 1px solid var(--er3-border, #e1e7ed);
  border-radius: 12px;
  background: var(--er3-surface, #fff);
  overflow: hidden;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 750;
  color: var(--er3-text, #243647);
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown > summary::-webkit-details-marker {
  display: none;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown > summary::after {
  content: "⌄";
  order: 2;
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  transition: transform .16s ease;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown[open] > summary::after {
  transform: rotate(180deg);
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-disclosure-count {
  margin-left: auto;
  color: var(--er3-muted-text, #657487);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown-body {
  padding: 0 12px 10px;
  border-top: 1px solid var(--er3-border, #e1e7ed);
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-split {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 8px 0;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-split > div {
  min-height: 0;
  gap: 3px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--er3-border, #e1e7ed);
  border-radius: 0;
  background: transparent;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-split > div:last-child {
  border-bottom: 0;
  background: transparent;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-split span {
  font-size: 12px;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-split strong {
  font-size: 15px;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-list {
  margin-top: 4px;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-row {
  gap: 8px;
  padding: 10px 0;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-row > span strong {
  font-size: 13px;
  line-height: 1.35;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-row small {
  font-size: 11px;
  line-height: 1.4;
}
#appView #dashboardView #dashboardCashflow .dashboard-cashflow-row > strong {
  font-size: 13px;
}
@media (max-width: 600px) {
  #appView #dashboardView .dashboard-cashflow-watch {
    padding: 12px;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-total {
    padding: 10px 0;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown > summary {
    min-height: 44px;
    padding: 10px;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-breakdown-body {
    padding: 0 10px 8px;
  }
}


/* Cashflow date/action controls: consistent compact height and aligned baseline on iPhone. */
@media (max-width: 600px) {
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: end !important;
    gap: 8px !important;
    height: auto !important;
    min-height: 0 !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > label {
    align-self: end !important;
    display: grid !important;
    grid-template-rows: auto 48px !important;
    gap: 6px !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.25 !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > label > input[type="date"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    line-height: 48px !important;
    font-size: 15px !important;
    box-sizing: border-box !important;
  }
  #appView #dashboardView #dashboardCashflow .dashboard-cashflow-toolbar > button[data-cashflow-refresh] {
    align-self: end !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
}
