/* Cash-flow reference layout. Other finance tabs and mobile-native views stay scoped out. */
.cashflow-reference {
  --cf-ref-teal: #008f96;
  --cf-ref-ink: #14263e;
  --cf-ref-muted: #74849e;
  --cf-ref-line: #e0e8f1;
  display: grid;
  gap: 12px;
  min-width: 0;
  color: var(--cf-ref-ink);
}
.cashflow-reference *, .cashflow-reference *::before, .cashflow-reference *::after { box-sizing: border-box; }
.cashflow-reference .cashflow-page { display: grid; gap: 12px; min-width: 0; }
.cashflow-reference .cf-ref-breadcrumb { display: flex; align-items: center; gap: 9px; margin: 0 0 7px; color: var(--cf-ref-muted); font-size: 11px; font-weight: 650; }
.cashflow-reference .cf-ref-breadcrumb > span { color: #b4c1d1; }
.cashflow-reference .ops-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0; }
.cashflow-reference .ops-title-row h1 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -.7px; }
.cashflow-reference .ops-title-row p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: var(--cf-ref-muted); }
.cashflow-reference .ops-title-row .toolbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin: 0; }
.cashflow-reference .btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; min-height: 32px; padding: 6px 12px; border: 1px solid var(--cf-ref-line); border-radius: 7px; background: #fff; box-shadow: none; color: #34445b; font-size: 11px; line-height: 1.3; font-weight: 700; white-space: nowrap; cursor: pointer; }
.cashflow-reference .btn .icon, .cashflow-reference .btn .icon svg { width: 14px; height: 14px; }
.cashflow-reference .btn.primary { border-color: var(--cf-ref-teal); background: linear-gradient(135deg,#009ba1,#00898e); color: #fff; }
.cashflow-reference .btn:hover:not(:disabled) { border-color: #9bcfd3; background: #f0faf9; }
.cashflow-reference .btn.primary:hover:not(:disabled) { background: #007e85; }
.cashflow-reference button:focus-visible, .cashflow-reference input:focus-visible, .cashflow-reference select:focus-visible { outline: 2px solid #00939a; outline-offset: 3px; }
.cashflow-reference .btn:disabled { opacity: .42; cursor: default; }
.cashflow-reference .cash-flow-tabs { display: flex; flex-wrap: nowrap; gap: 0; margin: 0 0 2px; padding: 3px; overflow-x: auto; border: 1px solid var(--cf-ref-line); border-radius: 8px; background: #fff; scrollbar-width: thin; }
.cashflow-reference .cash-flow-tabs > button { flex: 0 0 auto; min-height: 33px; padding: 6px 21px; border: 0; border-radius: 5px; color: #75839a; font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cashflow-reference .cash-flow-tabs > button.active { color: #00888f; background: #e8f5f5; box-shadow: inset 0 -2px #008f96; }
.cashflow-reference .cf-ref-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; min-width: 0; }
.cashflow-reference .cf-ref-kpi { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: start; gap: 12px; min-width: 0; min-height: 112px; padding: 15px 14px; border: 1px solid var(--cf-ref-line); border-radius: 9px; background: linear-gradient(135deg,#fff 65%,#fbfdff); }
.cashflow-reference .cf-ref-kpi-income { border-left: 2px solid #169b62; }
.cashflow-reference .cf-ref-kpi-expense { border-left: 2px solid #f23b57; }
.cashflow-reference .cf-ref-kpi-sales { border-left: 2px solid #7381ff; }
.cashflow-reference .cf-ref-icon { display: inline-flex; flex: 0 0 36px; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: #eaf1ff; color: #2772ff; }
.cashflow-reference .cf-ref-icon svg { display: block; width: 22px; height: 22px; }
.cashflow-reference .cf-ref-icon-income { color: #19975c; background: #e6f7ee; }
.cashflow-reference .cf-ref-icon-expense { color: #f43656; background: #ffecef; }
.cashflow-reference .cf-ref-icon-sales { color: #4374ff; background: #edf1ff; }
.cashflow-reference .cf-ref-icon-company { color: #008f96; background: #e6f5f5; }
.cashflow-reference .cf-ref-kpi-body { min-width: 0; }
.cashflow-reference .cf-ref-kpi h2 { margin: 0 0 6px; color: #435168; font-size: 11px; line-height: 1.4; font-weight: 750; }
.cashflow-reference .cf-ref-value { display: block; font-size: clamp(19px,1.7vw,26px); line-height: 1.1; font-weight: 850; letter-spacing: -.7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cashflow-reference .cf-ref-kpi-expense .cf-ref-value { color: #ef2546; }
.cashflow-reference .cf-ref-note { margin: 8px 0 0; color: var(--cf-ref-muted); font-size: 10.5px; line-height: 1.5; overflow-wrap: anywhere; }
.cashflow-reference .cf-ref-note small { display: block; font-size: inherit; }
.cashflow-reference .cf-ref-separator { padding: 0 7px; color: #bbc6d5; }
.cashflow-reference .cf-ref-sales-lines { display: grid; gap: 10px; margin: 15px 0 0; }
.cashflow-reference .cf-ref-sales-lines > div { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; min-width: 0; }
.cashflow-reference .cf-ref-sales-lines dt { color: var(--cf-ref-muted); font-size: 10px; }
.cashflow-reference .cf-ref-sales-lines dd { margin: 0; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cashflow-reference .cf-ref-company-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; min-width: 0; }
.cashflow-reference .cf-ref-company { display: block; width: 100%; min-width: 0; padding: 15px 17px 10px; text-align: left; border: 1px solid var(--cf-ref-line); border-top: 3px solid var(--cf-ref-teal); border-radius: 9px; background: linear-gradient(140deg,#fff,#fcfdff); color: var(--cf-ref-ink); font: inherit; cursor: pointer; }
.cashflow-reference .cf-ref-company:hover { border-color: #9bcfd3; border-top-color: #007c83; }
.cashflow-reference .cf-ref-company-heading { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 13px; }
.cashflow-reference .cf-ref-company-name { display: grid; gap: 4px; min-width: 0; }
.cashflow-reference .cf-ref-company-name > strong { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.cashflow-reference .cf-ref-company-name > small { color: var(--cf-ref-muted); font-size: 10px; }
.cashflow-reference .cf-ref-company-total { margin-left: auto; text-align: right; font-size: clamp(17px,1.55vw,23px); line-height: 1.2; letter-spacing: -.65px; font-weight: 850; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cashflow-reference .cf-ref-company-details { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 11px 0; border-top: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; }
.cashflow-reference .cf-ref-company-details > span { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px; min-width: 0; font-size: 10px; color: var(--cf-ref-muted); }
.cashflow-reference .cf-ref-company-details > span + span { padding-left: 11px; border-left: 1px solid var(--cf-ref-line); }
.cashflow-reference .cf-ref-company-details strong { margin-left: auto; color: #26364e; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cashflow-reference .cf-ref-company-foreign { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; padding-top: 8px; color: var(--cf-ref-muted); font-size: 10px; line-height: 1.4; }
.cashflow-reference .cf-ref-company-foreign strong { color: #5f708a; font-weight: 700; font-variant-numeric: tabular-nums; }
.cashflow-reference .cf-ref-help { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 -2px; color: var(--cf-ref-muted); font-size: 10.5px; line-height: 1.5; }
.cashflow-reference .cf-ref-help > span { font-size: 15px; line-height: 1; }
.cashflow-reference .cf-ref-ledger.cash-flow-transactions-panel { min-width: 0; margin: 0; padding: 12px 13px 9px; border: 1px solid var(--cf-ref-line); border-radius: 10px; background: #fff; box-shadow: none; }
.cashflow-reference .cf-ref-ledger-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cashflow-reference .cf-ref-ledger-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cashflow-reference .cf-ref-ledger-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.35px; line-height: 1.3; }
.cashflow-reference .cf-ref-count { padding: 3px 10px; border-radius: 12px; background: #edf2f7; color: #40516a; font-size: 11px; font-weight: 750; }
.cashflow-reference .cf-ref-loading { color: var(--cf-ref-muted); font-size: 11px; }
.cashflow-reference .cf-ref-filters { display: grid; grid-template-columns: minmax(220px,1.7fr) auto minmax(90px,.85fr) minmax(100px,.9fr) minmax(150px,1.3fr) auto auto; align-items: center; gap: 6px; min-width: 0; margin: 0 0 10px; }
.cashflow-reference .cf-ref-filters label { display: block; min-width: 0; margin: 0; }
.cashflow-reference .cf-ref-filters input, .cashflow-reference .cf-ref-filters select, .cashflow-reference .cf-ref-pagination select { width: 100%; min-width: 0; height: 32px; min-height: 32px; margin: 0; padding: 0 9px; border: 1px solid var(--cf-ref-line); border-radius: 6px; background-color: #fff; color: #435168; font: inherit; font-size: 11px; box-shadow: none; }
.cashflow-reference .cf-ref-date-range { display: grid; grid-template-columns: auto minmax(0,1fr) 8px minmax(0,1fr); align-items: center; gap: 3px; min-width: 0; height: 32px; padding: 0 4px; border: 1px solid var(--cf-ref-line); border-radius: 6px; }
.cashflow-reference .cf-ref-date-range > button { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 6px; border: 0; border-right: 1px solid var(--cf-ref-line); background: transparent; color: #435168; font: inherit; font-size: 10px; white-space: nowrap; cursor: pointer; }
.cashflow-reference .cf-ref-date-range svg { width: 13px; height: 13px; }
.cashflow-reference .cf-ref-date-range input { height: 28px; min-height: 28px; padding: 0 2px; border: 0; border-radius: 0; background: transparent; font-size: 10px; }
.cashflow-reference .cf-ref-date-range input::-webkit-calendar-picker-indicator { width: 11px; height: 11px; margin: 0; padding: 0; opacity: .55; }
.cashflow-reference .cf-ref-date-divider { color: #8d9bb0; font-size: 10px; text-align: center; }
.cashflow-reference .cf-ref-quick-ranges { display: flex; gap: 4px; }
.cashflow-reference .cf-ref-quick-ranges .btn { padding: 5px 8px; font-size: 10px; }
.cashflow-reference .cf-ref-search { position: relative; }
.cashflow-reference .cf-ref-search > .icon { position: absolute; top: 50%; left: 9px; width: 14px; height: 14px; transform: translateY(-50%); color: #8c9bb0; pointer-events: none; }
.cashflow-reference .cf-ref-search .icon svg { width: 14px; height: 14px; }
.cashflow-reference .cf-ref-search input { padding-left: 29px; }
.cashflow-reference .cf-ref-search input::placeholder { color: #8e9bb0; }
.cashflow-reference .cf-ref-apply, .cashflow-reference .cf-ref-reset { min-width: 64px; }
.cashflow-reference .cf-ref-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cashflow-reference .cf-ref-table-wrap { width: 100%; max-width: 100%; border: 1px solid var(--cf-ref-line); border-radius: 8px; overflow-x: auto; overscroll-behavior-x: contain; }
.cashflow-reference .cf-ref-table { width: 100%; min-width: 940px; margin: 0; table-layout: fixed; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.cashflow-reference .cf-ref-table thead th { position: static; padding: 10px 8px; border: 0; background: #f5f8fc; color: #8190a7; font-size: 9px; line-height: 1.4; font-weight: 750; white-space: nowrap; text-align: left; }
.cashflow-reference .cf-ref-table td { height: 48px; padding: 7px 8px; border: 0; border-top: 1px solid #edf1f6; background: #fff; color: #33455f; font-size: 11px; line-height: 1.45; vertical-align: middle; }
.cashflow-reference .cf-ref-table tbody tr:hover td { background: #f8fcfc; }
.cashflow-reference .cf-ref-table .num { padding-right: 9px; text-align: right; font-size: 10.5px; white-space: nowrap; }
.cashflow-reference .cf-ref-table th.num { font-size: 9px; }
.cashflow-reference .cf-ref-table td.positive { color: #159460; font-weight: 700; }
.cashflow-reference .cf-ref-table td.negative { color: #f02d4d; font-weight: 700; }
.cashflow-reference .cf-ref-table .cash-flow-running-balance { color: #31435e; font-weight: 700; }
.cashflow-reference .cf-ref-table .cash-flow-order-date { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; font-size: 10px; }
.cashflow-reference .cf-ref-table .cash-flow-order-handle { flex: 0 0 13px; width: 13px; height: 26px; padding: 0; color: #91a1b9; }
.cashflow-reference .cf-ref-table .cash-flow-order-handle svg { width: 12px; height: 17px; }
.cashflow-reference .cf-ref-table .link-button { display: inline; max-width: 100%; padding: 0; color: inherit; font-size: inherit; line-height: inherit; text-align: left; vertical-align: middle; }
.cashflow-reference .cf-ref-table .cf-ref-number { display: block; width: 100%; overflow: hidden; color: #008e94; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.cashflow-reference .cf-ref-company-tag { display: inline-block; max-width: 100%; margin-top: 2px; padding: 1px 5px; overflow: hidden; border-radius: 4px; background: #e4f5f4; color: #2b9295; font-size: 9px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; vertical-align: middle; }
.cashflow-reference .cf-ref-category { display: inline-block; max-width: 100%; padding: 5px 9px; border-radius: 6px; background: #eaf0ff; color: #4c75d6; font-size: 10px; line-height: 1.2; overflow-wrap: anywhere; font-weight: 700; }
.cashflow-reference .cf-ref-category.purchase { color: #4c75d6; background: #eaf0ff; }
.cashflow-reference .cf-ref-category.income { color: #259669; background: #e4f6ee; }
.cashflow-reference .cf-ref-category.expense { color: #ec3853; background: #ffecef; }
.cashflow-reference .cf-ref-category.transfer { color: #9470dd; background: #f2eaff; }
.cashflow-reference .cf-ref-description, .cashflow-reference .cf-ref-counterparty { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cashflow-reference .cf-ref-description { color: #263a54; }
.cashflow-reference .cf-ref-counterparty { margin-top: 2px; color: #70809a; font-size: 10px; }
.cashflow-reference .cf-ref-account-line { display: flex; gap: 7px; min-width: 0; color: #8392aa; font-size: 9px; }
.cashflow-reference .cf-ref-account-line > span:first-child { flex: 0 0 auto; }
.cashflow-reference .cf-ref-account-line > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cashflow-reference .cf-ref-writer { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cashflow-reference .cf-ref-empty { padding: 22px 10px; }
.cashflow-reference .cf-ref-ledger-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.cashflow-reference .cf-ref-ledger-footer .cash-flow-order-hint { display: flex; align-items: center; gap: 7px; margin: 0; color: #8593aa; font-size: 10px; line-height: 1.4; }
.cashflow-reference .cf-ref-ledger-footer .cash-flow-order-hint > span { font-size: 14px; }
.cashflow-reference .cf-ref-pagination { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cashflow-reference .cf-ref-pagination select { width: 78px; height: 28px; min-height: 28px; font-size: 10px; }
.cashflow-reference .cf-ref-pagination .cf-ref-page-arrow { width: 24px; min-height: 26px; padding: 0; border: 0; color: #8599b3; font-size: 21px; font-weight: 400; }
.cashflow-reference .cf-ref-page-current { display: inline-flex; align-items: center; justify-content: center; width: 27px; min-height: 27px; border-radius: 7px; color: #fff; background: #008f96; font-size: 11px; }
@media (max-width: 1150px) {
  .cashflow-reference .cf-ref-filters { grid-template-columns: minmax(240px,1.8fr) auto minmax(100px,1fr) minmax(100px,1fr); }
  .cashflow-reference .cf-ref-search { grid-column: span 2; }
  .cashflow-reference .cf-ref-kpi { grid-template-columns: 30px minmax(0,1fr); gap: 9px; padding: 12px 10px; }
  .cashflow-reference .cf-ref-kpi .cf-ref-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .cashflow-reference .cf-ref-value { font-size: 19px; }
  .cashflow-reference .cf-ref-sales-lines dd { font-size: 10.5px; }
}
@media (max-width: 1000px) {
  .cashflow-reference .ops-title-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .cashflow-reference .cf-ref-kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cashflow-reference .cf-ref-company-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 800px) {
  .cashflow-reference .ops-title-row .toolbar { justify-content: flex-start; width: 100%; }
  .cashflow-reference .cf-ref-kpi-grid { gap: 9px; }
  .cashflow-reference .cf-ref-kpi { min-height: 105px; }
  .cashflow-reference .cf-ref-value { font-size: 17px; }
  .cashflow-reference .cf-ref-note { font-size: 10px; }
  .cashflow-reference .cf-ref-filters { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .cashflow-reference .cf-ref-date-range, .cashflow-reference .cf-ref-quick-ranges, .cashflow-reference .cf-ref-search { grid-column: 1 / -1; }
  .cashflow-reference .cf-ref-company-total { font-size: 18px; }
  .cashflow-reference .cf-ref-company-details { gap: 6px; }
  .cashflow-reference .cf-ref-company-details > span + span { padding-left: 6px; }
  .cashflow-reference .cf-ref-company-details strong { font-size: 10px; }
}

/* The ledger company selector filters rows, not the combined financial summary. */
.cf-ref-company-tabs{display:inline-flex;align-items:center;gap:3px;flex:0 0 auto;padding:3px;border:1px solid #dce9ed;border-radius:7px;background:#f4f8fa;white-space:nowrap}
.cf-ref-company-tabs>button{border:0;border-radius:5px;padding:6px 15px;min-height:31px;background:transparent;color:#7c8da3;font:inherit;font-size:12px;font-weight:650;line-height:1.4;cursor:pointer}
.cf-ref-company-tabs>button.active{background:#fff;color:#00898a;box-shadow:0 1px 4px #23424e15}
.cf-ref-company-tabs>button:focus-visible{outline:2px solid #008b8b;outline-offset:1px}
.cf-ref-company-tabs>button:disabled{opacity:.5;cursor:wait}
.cfd-box>header:has(.cf-ref-company-tabs){flex-wrap:wrap;gap:9px}
@media(max-width:800px){.cashflow-reference .cf-ref-ledger-heading>div{width:100%;gap:8px}.cf-ref-company-tabs>button{min-height:36px;padding:7px 13px;font-size:12px}.cf-ref-company-tabs{max-width:100%}}
