/* The Financials frame (D207 board B): what the rebuilt Financials tabs share - the table with boxes in the row, the reports
   band, the detail panel, the report note, Connected. Moved here from IncomePage.razor.css and AccountsPage.razor.css at the
   swap (2026-11-14, R9), where it was word for word the same. A page's own columns and fields stay in its .razor.css. Every
   rule sits under the page's root .fin; the look is the design system's (.ks-tbl, .ks-detail, .ks-ctrl, .ks-btn). */

/* The client's name 30px under the top bar, as on every page (DESIGN.md §11, .page-wrap in MainForm), and 80px - two and a
   half times the standard 32px - to the table, for breathing room (Chad 2026-11-05: few households fill the table). */
.fin { display: flex; flex-direction: column; gap: 80px; margin-top: 30px; padding: 0 38px 24px; outline: none; min-height: 0; }

.fin__top { position: relative; }

/* The table and the panel are one height, ending 10% above the window's bottom (Chad 2026-11-05: "start" there, he may
   refine it). --fin-top is how far down the window the two start - the menu bar and the client's name.
   The rows scroll inside the table, the panel's body inside the panel (the canvas is zoomed by --ks-scale, D171). */
.fin__work { --fin-top: 230px; display: flex; align-items: stretch; min-width: 0;
             height: calc(90vh / var(--ks-scale, 1) - var(--fin-top)); min-height: 420px; }

.fin__tbl { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* A row's pop-up (Starts, Ends, Split, the report note) widens the scroll area rather than being cut off at its edge. */
.fin .fin__scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; }

.fin .fin__tbl .ks-tbl__head { position: sticky; top: 0; z-index: 4; border-radius: 0; }

.fin__empty { padding: 18px 16px; color: var(--ks-hint); font-size: 15px; }

.fin .ks-tbl__cell { padding: 0 5px; min-width: 0; display: flex; align-items: center; }

.fin .ks-tbl__cell.num { justify-content: flex-end; }

.fin .ks-tbl__row { min-height: 44px; }

.fin .rpt-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px; border-bottom: 1px solid #CCCCCC; background: #fff; }

.fin .rpt-bar__name { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ks-ink-soft); padding: 0 4px; white-space: nowrap; }

.fin .ks-tbl__head > .rpt-h { background: var(--ks-green-deep); justify-content: center; padding: 0; cursor: help; }

.fin .ks-tbl__head > div { padding: 0 10px; }

.fin .ks-tbl__head > .fin__hnum { justify-content: flex-end; }

.fin .rpt-c { justify-content: center; padding: 0; background: #F3F9F0; align-self: stretch; }

.fin .ks-tbl__row:hover .rpt-c { background: #E9F4E4; }

.fin .ks-tbl__row--selected .rpt-c { background: var(--ks-sky-100); }

.fin .ks-tbl__row--past .rpt-c { background: #F1F3F5; }

.fin .ks-tbl__row--past:hover .rpt-c { background: #E8ECEF; }

.fin .ks-tbl__row--past.ks-tbl__row--selected .rpt-c { background: var(--ks-sky-100); }

/* A box in the row looks like text until it is pointed at (KSDaysBox's Bare) */
.fin .cin { width: 100%; height: 32px; box-sizing: border-box; border: 1px solid transparent; border-radius: 5px; background: transparent; font: inherit; color: inherit; padding: 0 6px; min-width: 0; }

.fin .cin--num { text-align: right; font-variant-numeric: tabular-nums; }

.fin select.cin { appearance: none; -webkit-appearance: none; cursor: pointer; }

.fin .ks-tbl__row:hover .cin { border-color: var(--ks-line-strong); background: #fff; }

.fin .cin:focus { outline: none; border-color: var(--ks-blue); background: #fff; box-shadow: 0 0 0 3px rgba(12, 59, 93, 0.22); }

.fin .cin--date { font-variant-numeric: tabular-nums; padding-right: 4px; }

/* The calendar mark comes in by an em, as on .ks-ctrl (global.css hides it), and shows when the row is pointed at. */
.fin .cin--date::-webkit-calendar-picker-indicator { margin-inline-start: -1em; padding: 2px; cursor: pointer; }

.fin .ks-tbl__row:hover .cin--date::-webkit-calendar-picker-indicator, .fin .cin--date:focus::-webkit-calendar-picker-indicator { opacity: 1; }

.fin .split-grid__label { font-size: 14px; color: var(--ks-ink-soft); }

.fin .split-grid__box { text-align: right; font-variant-numeric: tabular-nums; }

/* The description opens the panel; the report note's mark sits at its right */
.fin .desc-cell { overflow: visible; position: relative; }

/* The box is 275px - about as long as a description should be (Chad 2026-11-05) - the launch mark sits right after it
   and the report note keeps the column's right edge. */
.fin .desc-in { flex: 0 1 275px; text-overflow: ellipsis; }

.fin .desc-cell > .note { margin-left: auto; }

/* The launch mark: there when the row is pointed at, opens the panel */
.fin .row-open { flex-shrink: 0; width: 30px; height: 30px; margin-left: 2px; border: none; border-radius: 6px; background: transparent; color: var(--ks-hint); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; opacity: 0; }

.fin .ks-tbl__row:hover .row-open, .fin .row-open:focus-visible { opacity: 1; }

.fin .row-open:hover { background: var(--ks-sky-50); color: var(--ks-blue); }

.fin .note { position: relative; flex-shrink: 0; display: flex; }

.fin .note__btn { width: 30px; height: 30px; border: none; border-radius: 6px; background: transparent; color: var(--ks-hint); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; opacity: 0; }

.fin .ks-tbl__row:hover .note__btn, .fin .note__btn:focus-visible, .fin .note--editing .note__btn { opacity: 1; }

.fin .note__btn:hover { background: var(--ks-sky-50); color: var(--ks-blue); }

.fin .note--has .note__btn { opacity: 1; color: var(--ks-blue); }

.fin .note__tip { display: none; position: absolute; right: 0; top: 34px; z-index: 6; width: 300px; background: #FFFDF2; border: 1px solid #E8DFB8; border-radius: 8px; box-shadow: var(--ks-shadow-lg); padding: 10px 12px; font-size: 14px; line-height: 1.45; color: var(--ks-ink); white-space: normal; flex-direction: column; gap: 4px; }

.fin .note:hover .note__tip { display: flex; }

.fin .note__tiphead { font-family: var(--ks-font-label); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #004369; }

.fin .note__pop { --pop-point: 8px; position: absolute; right: 0; top: 40px; z-index: 7; width: 360px; background: #fff; border: 1px solid var(--ks-line-strong); border-radius: 10px; box-shadow: var(--ks-shadow-xl); padding: 12px; display: flex; flex-direction: column; gap: 8px; cursor: default; white-space: normal; }

.fin .note__text { height: auto; min-height: 84px; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.45; resize: vertical; }

/* The report note is a few words: two lines, no drag bar (Chad 2026-11-04) */
.fin textarea.note__text--short { min-height: 0; height: calc(2 * 1.45em + 22px); resize: none; }

.fin .note__acts { display: flex; justify-content: flex-end; gap: 8px; }

.fin .note__remove { margin-right: auto; }

.fin .who { font-family: var(--ks-font-body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ks-ink-light); }

/* Add Row under the last row (DESIGN.md §10); the foot holds the totals - NOW only */
.fin .fin__addrow { padding: 10px 14px; }

.fin__foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--ks-line); background: #fff; }

.fin__totals { display: flex; gap: 22px; font-size: 15px; color: var(--ks-ink-soft); font-variant-numeric: tabular-nums; }

.fin__totals b { color: var(--ks-ink); margin-left: 6px; }

/* The detail panel, beside the table */
.fin__panel { flex: 0 0 600px; margin-left: 20px; min-height: 0; animation: fin-panel-in 0.16s ease-out; }

@keyframes fin-panel-in { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Open as the page arrives (pinned): no slide - the table and the panel draw together (Chad 2026-11-18) */
.fin__panel--still { animation: none; }

.fin__panelhead { display: flex; align-items: center; gap: 12px; }

.fin .acts { display: flex; gap: 2px; flex-shrink: 0; }

/* The pin while pinned (D227) */
.fin .pin--on { color: var(--ks-blue); }

.fin__up { display: inline-flex; transform: rotate(180deg); }

.fin .meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ks-ink-light); }

.fin .drawer__title { flex: 1 1 auto; min-width: 0; font-size: 20px; font-weight: 700; color: var(--ks-blue); border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -7px; box-sizing: border-box; font-family: inherit; background: transparent; }

.fin .drawer__title:hover { border-color: var(--ks-line-strong); }

.fin .drawer__title:focus { outline: none; border-color: var(--ks-blue); box-shadow: 0 0 0 3px rgba(12, 59, 93, 0.22); }

.fin .drawer__foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 26px 14px 29px; border-top: 1px solid var(--ks-line); }

.fin .sec { padding: 18px 0; border-bottom: 1px solid var(--ks-line); display: flex; flex-direction: column; gap: 12px; }

.fin .sec:first-child { padding-top: 0; }

.fin .sec:last-child { border-bottom: none; }

.fin .sec__head { display: flex; align-items: center; gap: 10px; }

.fin__notes { min-height: calc(3 * 1.45em + 22px); }

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

.fin .fld { display: flex; flex-direction: column; gap: 6px; }

.fin__tick { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ks-ink); cursor: pointer; }

/* The design system's green box (.ks-check, Chad 2026-11-17: "The green box works for me, let's swap them all out"):
   drawn over a real checkbox kept for the keyboard and screen readers, which the label still ticks */
.fin__tick { position: relative; }
.fin__tick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fin__tick .ks-check { flex-shrink: 0; margin-top: 2px; }
.fin__tick input:focus-visible + .ks-check { outline: 2px solid var(--ks-blue); outline-offset: 2px; }

.fin .conn { display: flex; flex-direction: column; }

.fin .conn__row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; height: 40px; border-bottom: 1px solid var(--ks-line); }

.fin .conn__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fin .conn__fig { font-variant-numeric: tabular-nums; color: var(--ks-ink-soft); }

.fin .conn__empty { font-size: 15px; color: var(--ks-hint); padding: 2px 0; }

.fin .conn__unlink { width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--ks-mute); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; opacity: 0; }

/* A Connected row opens its item on a double-click (FinancialsJump) */
.fin .conn__row { cursor: pointer; border-radius: 6px; }

.fin .conn__row:hover { background: var(--ks-sky-50); }

.fin .conn__row:hover .conn__unlink, .fin .conn__unlink:focus-visible { opacity: 1; }

.fin .conn__unlink:hover { color: var(--ks-danger); background: var(--ks-danger-bg); }

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

/* As on the board: the tick, the report's chip, its name - from the left (a global button rule centered them) */
.fin .rpt-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--ks-line); border-radius: 6px; background: #fff; font: inherit; font-size: 15px; color: var(--ks-ink); cursor: pointer; text-align: left; }

.fin .rpt-row:hover { background: var(--ks-sky-50); }

/* --- Side panel sections (D232, Chad 2026-11-16) - Income, Accounts, Liabilities -------------------------------------
   The notes group stays open at the top; below it, KSPanelSection's collapsible sections, one open at a time. A plain
   #CBD3DA line between groups (no line between fields inside one). Closed: a 40px title bar - the blue label, its
   count, a red dot when something inside needs filling in, the chevron; hover is the main table's row hover. Open: the
   title a black 17px heading (letters spaced a touch, 0.045em), the contents indented 12px under it, and a soft eased
   shading inside the line above and the line below. The 31 design rounds behind it: history/DESIGN.md
   §Side panel sections. */
.fin .fin-group { display: flex; flex-direction: column; gap: 20px; padding: 30px 0 28px; border-bottom: 1px solid #CBD3DA; }
.fin .fin-group:first-child { padding-top: 0; padding-bottom: 28px; }
.fin .fin-group:last-child { border-bottom: none; }
.fin .fin-group .sec { padding: 0; border-bottom: none; }

.fin .fin-group.acc { padding: 6px 0; gap: 14px; }
.fin .fin-group.acc--open { padding-bottom: 28px; }
.fin .acc__head { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px; margin: 0 -6px; width: calc(100% + 12px);
  background: none; border: 0; border-radius: var(--ks-radius-md); cursor: pointer; text-align: left; font: inherit; }
.fin .acc__head:hover { background: var(--ks-sky-50); }
.fin .acc__head:focus-visible { outline: 2px solid var(--ks-blue); outline-offset: 1px; }
.fin .acc__chev { margin-left: auto; display: inline-flex; color: var(--ks-ink-soft); transition: transform .15s ease; transform: rotate(-90deg); }
.fin .acc--open .acc__chev { transform: none; }
.fin .acc__need { width: 8px; height: 8px; border-radius: 50%; background: var(--ks-danger); flex-shrink: 0; }
.fin .acc--open > .acc__head .ks-label { color: var(--ks-ink); text-transform: none; letter-spacing: 0.045em; font-size: 17px; font-weight: 700; }
.fin .acc__body { display: flex; flex-direction: column; gap: 20px; }
.fin .acc--open > .acc__body { padding-left: 12px; }
/* The shading: two 10px eased strips inside the open group, not an inset box-shadow (its darkest edge blurred into the
   bottom line at the app's zoom). The bottom one is half the top's strength and sits 1px off its line, which stays
   the absolute bottom (the line lands on a part pixel at the zoom). */
.fin .fin-group.acc--open { position: relative; }
.fin .fin-group.acc--open::before, .fin .fin-group.acc--open::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; pointer-events: none; }
.fin .fin-group.acc--open::before { top: 0; background: linear-gradient(to bottom, rgba(12,59,93,.11) 0%, rgba(12,59,93,.06) 22%, rgba(12,59,93,.03) 45%, rgba(12,59,93,.01) 70%, rgba(12,59,93,0) 100%); }
.fin .fin-group.acc--open::after { bottom: 1px; background: linear-gradient(to top, rgba(12,59,93,.06) 0%, rgba(12,59,93,.035) 22%, rgba(12,59,93,.018) 45%, rgba(12,59,93,.006) 70%, rgba(12,59,93,0) 100%); }
.fin .fin-group.acc--open:last-child::after { display: none; }
