/* Financial Breakdown grid (assets/js/financialGrid.js). */
.fg { --fg-bg: #1f1f1f; --fg-head: #2a2a2a; --fg-line: rgba(255, 255, 255, .09); --fg-sel: rgba(59, 130, 246, .22); --fg-accent: #3b82f6; }
.light-theme .fg { --fg-bg: #fff; --fg-head: #f3f4f6; --fg-line: #e5e7eb; --fg-sel: rgba(59, 130, 246, .15); }
.fg { position: relative; }
.fg-typer { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; overflow: hidden; pointer-events: none; }
.fg:focus-within .fg-scroll { border-color: var(--fg-accent); }
.fg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.fg-totals { font-size: 13px; margin-left: 4px; }
.fg-gap { color: #e9a948; }
.fg-match { color: #10b981; }
.fg-save-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.fg-dirty { font-size: 12px; color: #e9a948; }
.fg-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--fg-line); border-radius: 6px; font-size: 13px; }
.fg-panel label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.fg-panel .form-select, .fg-panel .form-control { width: auto; min-width: 90px; }
.fg-panel .fg-p-count { width: 80px; min-width: 0; }
.fg-scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--fg-line); border-radius: 6px; outline: none; }
.fg-table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
.fg-table th, .fg-table td { border-right: 1px solid var(--fg-line); border-bottom: 1px solid var(--fg-line); padding: 0; height: 30px; background: var(--fg-bg); white-space: nowrap; }
.fg-table thead th { position: sticky; top: 0; background: var(--fg-head); font-weight: 600; text-align: center; padding: 4px 6px; z-index: 2; }
.fg-table thead tr:nth-child(2) th { top: 29px; }
.fg-table .fg-sticky { position: sticky; z-index: 1; }
.fg-table thead .fg-sticky { z-index: 3; }
.fg-c-product { left: 0; min-width: 190px; max-width: 190px; }
.fg-c-label { left: 190px; min-width: 190px; max-width: 190px; }
.fg-c-total { left: 380px; min-width: 100px; text-align: right; padding: 0 8px !important; font-weight: 600; box-shadow: 2px 0 0 var(--fg-line); }
.fg-c-actions { text-align: center; padding: 0 4px !important; min-width: 64px; }
.fg-table td.fg-c-product, .fg-table td.fg-c-label { padding: 2px 4px; }
.fg-table td.fg-c-product .form-select, .fg-table td.fg-c-label .form-control { font-size: 13px; padding: 2px 6px; height: 26px; min-height: 0; }
.fg-table td.fg-c-product .form-select { padding-right: 22px; }
.fg-year { border-left: 2px solid var(--fg-line); }
.fg-year-total { font-weight: 400; opacity: .7; margin-left: 6px; }
.fg-year-start { border-left: 2px solid var(--fg-line) !important; }
.fg-month { min-width: 78px; }
.fg-cell { min-width: 78px; text-align: right; padding: 0 6px !important; cursor: cell; position: relative; user-select: none; font-variant-numeric: tabular-nums; }
.fg-cell.fg-neg { color: #ef4444; }
.fg-cell.fg-sel { background: var(--fg-sel); }
.fg-cell.fg-active { box-shadow: inset 0 0 0 2px var(--fg-accent); }
.fg-cell.fg-fill { box-shadow: inset 0 0 0 1px dashed var(--fg-accent); background: rgba(59, 130, 246, .1); }
.fg-cell.fg-editing { padding: 0 !important; }
.fg-input { width: 100%; height: 28px; border: 0; outline: 2px solid var(--fg-accent); background: var(--fg-bg); color: inherit; text-align: right; padding: 0 6px; font: inherit; }
.fg-input.is-invalid { outline-color: #ef4444; }
.fg-handle { position: absolute; right: -4px; bottom: -4px; width: 8px; height: 8px; background: var(--fg-accent); border: 1px solid var(--fg-bg); cursor: crosshair; z-index: 1; }
.fg-removed td { opacity: .45; text-decoration: line-through; }
.fg-removed td.fg-c-actions { opacity: 1; text-decoration: none; }
.fg-foot th, .fg-foot td { background: var(--fg-head) !important; font-weight: 600; text-align: right; padding: 0 6px !important; }
.fg-foot th.fg-c-product { text-align: left; }
.fg-weighted th, .fg-weighted td { font-weight: 400; opacity: .85; }
.fg-empty { padding: 16px !important; text-align: left; opacity: .8; }
.fg-help { font-size: 12px; opacity: .7; margin-top: 6px; }
