.fn-view {
  --fn-ink: #233d32;
  --fn-muted: #606c63;
  --fn-line: #dfe3d9;
  --fn-green: #234e3d;
  display: grid;
  gap: 18px;
  min-width: 0;
  color: var(--fn-ink);
  font: inherit;
}
.fn-view *, .fn-view *::before, .fn-view *::after { box-sizing: border-box; }
.fn-view h2, .fn-view h3, .fn-view p { margin: 0; }
.fn-heading, .fn-section-title, .fn-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.fn-heading h2 { font: inherit; font-size: clamp(1.22rem, 2vw, 1.65rem); font-weight: 700; line-height: 1.25; }
.fn-view .fn-overline { margin-bottom: 3px; color: var(--fn-muted); font-size: .75rem; font-weight: 600; }
.fn-button, .fn-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--fn-line);
  border-radius: 9px;
  background: #fff;
  color: var(--fn-green);
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
  cursor: pointer;
}
.fn-primary { background: var(--fn-green); border-color: var(--fn-green); color: #fff; }
.fn-primary:hover { background: #173d2e; }
.fn-icon-button { min-width: 38px; padding: 6px; }
.fn-button:disabled { opacity: .55; cursor: default; }
.fn-view :is(button, input, select, [tabindex]):focus-visible { outline: 2px solid #507f64; outline-offset: 2px; }
.fn-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fn-kpi, .fn-card { border: 1px solid var(--fn-line); background: #fff; border-radius: 15px; }
.fn-kpi { display: grid; align-content: space-between; gap: 8px; padding: clamp(12px, 2vw, 20px); }
.fn-kpi span { font-size: .83rem; color: var(--fn-muted); }
.fn-kpi strong { font-size: clamp(1.1rem, 2.2vw, 1.85rem); font-weight: 650; line-height: 1.15; letter-spacing: -.04em; white-space: nowrap; }
.fn-feature { background: #edf2e9; border-color: #cedbc7; }
.fn-card { min-width: 0; overflow: hidden; }
.fn-section-title { padding: 18px 20px 14px; align-items: flex-start; }
.fn-section-title h3 { font-size: 1.05rem; line-height: 1.3; color: var(--fn-ink); }
.fn-section-title p, .fn-form-hint { margin-top: 4px; font-size: .83rem; line-height: 1.4; color: var(--fn-muted); }
.fn-scroll { overflow-x: auto; width: 100%; }
.fn-scroll table { width: 100%; border-collapse: collapse; color: var(--fn-ink); font: inherit; font-variant-numeric: tabular-nums; }
.fn-scroll th, .fn-scroll td { padding: 12px 15px; border-top: 1px solid var(--fn-line); text-align: right; font-size: .82rem; white-space: nowrap; }
.fn-scroll thead th { background: #f5f6f0; color: var(--fn-muted); font-size: .73rem; font-weight: 650; }
.fn-scroll th:first-child { text-align: left; }
.fn-scroll tbody th { font-weight: 600; }
.fn-total { background: #edf2e9; font-weight: 700; }
.fn-profit { color: var(--fn-green); font-weight: 720; }
.fn-loss { color: #9b4235; }
.fn-scroll small { display: block; margin-top: 3px; max-width: 230px; overflow-wrap: anywhere; white-space: normal; font-size: .73rem; font-weight: 400; color: var(--fn-muted); }
.fn-scroll td small { margin-left: auto; }
.fn-empty { display: flex; align-items: center; gap: 10px; padding: 18px 20px 22px; color: var(--fn-muted); border-top: 1px solid var(--fn-line); font-size: .85rem; }
.fn-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 9px; font-size: .69rem; font-weight: 650; white-space: nowrap; }
.fn-estimate { color: #79501a; background: #f6eddc; }
.fn-confirmed { color: #2a533c; background: #e7f1e6; }
.fn-void { color: #67665f; background: #eeece8; }
.fn-link { display: inline-flex; background: transparent; border: 0; color: var(--fn-green); padding: 5px; text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: .78rem; cursor: pointer; }
.fn-muted { color: var(--fn-muted); }
.fn-dialog { position: fixed; inset: 0; margin: auto; width: min(570px, calc(100vw - 28px)); max-height: min(88vh, 780px); padding: 0; border: 1px solid var(--fn-line); border-radius: 17px; color: var(--fn-ink); background: #fdfdf9; box-shadow: 0 18px 90px #132e2340; }
.fn-dialog::backdrop { background: #172d2373; }
.fn-form { display: grid; gap: 18px; padding: clamp(16px, 3vw, 26px); }
.fn-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fn-fields label { display: grid; gap: 5px; font-size: .81rem; font-weight: 600; color: var(--fn-ink); }
.fn-fields :is(input, select) { width: 100%; min-width: 0; min-height: 41px; padding: 8px 10px; border: 1px solid #cdd5ca; border-radius: 7px; color: var(--fn-ink); background: #fff; font: inherit; font-size: .87rem; font-weight: 450; }
.fn-fields input[readonly] { background: #f0f1eb; color: var(--fn-muted); }
.fn-span { grid-column: 1 / -1; }
.fn-actions { justify-content: flex-end; }
@media (max-width: 720px) {
  .fn-kpis { gap: 7px; }
  .fn-kpi { padding: 10px; }
  .fn-kpi strong { white-space: normal; }
  .fn-heading { align-items: flex-start; }
  .fn-button { padding-inline: 10px; }
  .fn-section-title { padding: 13px; flex-wrap: wrap; gap: 8px; }
  .fn-scroll th, .fn-scroll td { padding: 11px; }
}
@media (max-width: 480px) {
  .fn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fn-feature { grid-column: 1 / -1; grid-row: 1; }
  .fn-dialog { max-height: 90dvh; }
  .fn-heading h2 { font-size: 1.13rem; }
}
@media (max-width: 380px) {
  .fn-fields { grid-template-columns: minmax(0, 1fr); }
}
