/* Cash flow shares the approved charcoal/coral tokens with the payment calendar. */
.app-view-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 24px;
}
.app-view-tabs button {
  padding: 12px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
}
.app-view-tabs button[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
#paymentView[hidden],
#cashFlowView[hidden],
#cfContent[hidden],
#cfLoadStatus[hidden],
#cfRetry[hidden],
#cfClear[hidden] {
  display: none;
}
.cf-heading,
.cf-toolbar,
.cf-panel-head,
.cf-list-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.cf-heading {
  align-items: end;
  margin-bottom: 26px;
}
.cf-toolbar {
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cf-toolbar h2 {
  min-width: 165px;
  text-align: center;
}
.cf-segments {
  display: flex;
  gap: 3px;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 13px;
  background: var(--control);
}
.cf-segments button {
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  border: 0;
  border-radius: 10px;
}
.cf-segments button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.cf-scope {
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 16px;
}
.cf-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.cf-metric {
  padding: 22px;
  border-radius: 18px;
}
.cf-metric-label {
  font-size: 12px;
  color: var(--muted);
}
.cf-metric-value {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: -0.8px;
  margin: 12px 0 8px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.cf-metric small {
  color: var(--muted);
  font-size: 11px;
}
.cf-positive {
  color: #9dd5ba;
}
.cf-negative {
  color: #ff9c88;
}
.cf-accent {
  color: var(--accent);
}
:root.light .cf-positive {
  color: #286343;
}
:root.light .cf-negative {
  color: #a43e2b;
}
.cf-panel {
  padding: 22px;
  min-width: 0;
}
.cf-panel-head {
  align-items: start;
  margin-bottom: 19px;
}
.cf-panel-head p {
  color: var(--muted);
  font-size: 11px;
  margin: 5px 0 0;
}
.cf-text-button {
  background: transparent;
  color: var(--accent);
  border: 0;
  font-size: 11px;
  padding: 4px;
}
.cf-category {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--ink);
  text-align: left;
  padding: 10px 0;
  border-radius: 6px;
}
.cf-category:hover {
  background: var(--control);
}
.cf-category[aria-pressed="true"] {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}
.cf-category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.cf-category-label i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 3px;
  background: var(--cf-color);
}
.cf-category-label > span {
  overflow-wrap: anywhere;
}
.cf-category-label strong {
  margin-left: auto;
  font-weight: 500;
}
.cf-category-label small {
  width: 34px;
  text-align: right;
  font-size: 10px;
  color: var(--muted);
  flex: none;
}
.cf-track {
  display: block;
  height: 4px;
  border-radius: 4px;
  background: var(--field);
  margin-top: 9px;
  overflow: hidden;
}
.cf-track > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--cf-color);
}
.cf-insight {
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 20px 0 0;
}
.cf-legend {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}
.cf-legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.cf-legend i {
  height: 7px;
  width: 7px;
  border-radius: 2px;
}
.cf-in-dot {
  background: #9dd5ba;
}
.cf-out-dot {
  background: #f65923;
}
.cf-chart {
  display: flex;
  gap: 6px;
  height: 205px;
  padding-top: 17px;
  border-bottom: 1px solid var(--line);
}
.cf-chart-month {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  padding: 8px 3px 0;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
}
.cf-chart-month[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.cf-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  gap: 7px;
  height: 160px;
}
.cf-bar {
  width: 26px;
  max-width: 40%;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
}
.cf-in {
  background: linear-gradient(#b2dfc9, #6ea68b);
}
.cf-out {
  background: var(--gradient);
}
.cf-chart-month small {
  font-size: 10px;
  padding: 8px 0;
}
.cf-count {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 5px;
  vertical-align: middle;
  margin-left: 5px;
}
.cf-list-tools {
  margin-bottom: 12px;
}
.cf-list-tools .search {
  max-width: 330px;
  flex: 1;
  min-width: 0;
}
.cf-list-tools > span {
  font-size: 10px;
  color: var(--muted);
}
.cf-transaction {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 90px 130px 32px;
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.cf-transaction:has(details[open]) {
  z-index: 5;
}
.cf-direction {
  width: 34px;
  height: 34px;
  background: var(--control);
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.cf-direction .material-symbols-outlined {
  font-size: 17px;
}
.cf-transaction-copy {
  min-width: 0;
}
.cf-transaction-copy > strong {
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cf-transaction-copy > small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}
.cf-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.cf-account i {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--account-color);
}
.cf-account i.cf-monogram {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  font-size: 9px;
  font-style: normal;
  color: #fff;
  border: 1px solid #b7bdc3;
  border-radius: 4px;
}
.cf-status {
  font-size: 10px;
  color: var(--muted);
}
.cf-status.cf-expected {
  color: var(--accent);
}
.cf-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.cf-menu .payment-actions button[data-cf-action="delete"] {
  color: var(--today);
}
.cf-empty {
  color: var(--muted);
  text-align: center;
  padding: 26px 10px;
  font-size: 12px;
}
#cfLoadStatus {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
}
#cfRetry {
  margin-left: 12px;
}
.cf-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  background: var(--modal);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 22px;
  padding: 25px;
}
.cf-dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(6px);
}
.cf-dialog .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cf-dialog label {
  min-width: 0;
}
.cf-dialog input,
.cf-dialog select {
  width: 100%;
  min-width: 0;
}
.cf-wide {
  grid-column: 1/-1;
}
.cf-form-note {
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 18px;
}
.cf-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--field);
}
.cf-error {
  color: var(--today);
  font-size: 12px;
}
.cf-dialog .form-actions {
  position: static;
  margin: 18px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
}
@media (max-width: 850px) {
  .cf-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .cf-heading {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }
  .cf-heading .intro {
    font-size: 12px;
  }
  .cf-toolbar {
    gap: 14px;
  }
  .cf-toolbar h2 {
    min-width: 150px;
  }
  .cf-metrics {
    gap: 10px;
  }
  .cf-metric {
    padding: 15px;
  }
  .cf-metric-value {
    font-size: 23px;
  }
  .cf-metric small {
    font-size: 10px;
  }
  .cf-panel {
    padding: 16px;
  }
  .cf-panel-head {
    gap: 10px;
    flex-wrap: wrap;
  }
  .cf-panel-head h2 {
    font-size: 15px;
  }
  .cf-category-label {
    font-size: 11px;
    gap: 6px;
  }
  .cf-category-label small {
    width: 29px;
  }
  .cf-list-tools > span {
    display: none;
  }
  .cf-transaction {
    grid-template-columns: 28px minmax(0, 1fr) 84px 28px;
    gap: 9px;
  }
  .cf-direction {
    grid-column: 1;
    grid-row: 1;
    width: 27px;
    height: 30px;
  }
  .cf-transaction-copy {
    grid-column: 2;
    grid-row: 1;
  }
  .cf-transaction-copy > strong {
    font-size: 12px;
  }
  .cf-amount {
    grid-column: 3;
    grid-row: 1;
    font-size: 12px;
  }
  .cf-menu {
    grid-column: 4;
    grid-row: 1;
  }
  .cf-status {
    grid-column: 2/4;
    grid-row: 2;
    margin-top: -4px;
  }
  .cf-chart {
    gap: 8px;
  }
}
