/* Finance workbench: reuses the platform shell, controls and theme tokens. */
.rf { --rf-blue: #2457c5; --rf-yellow: #e4b600; --rf-teal: #0f766e; color: var(--ink); font-size: 13px; }
.rf-osvc { --supplier-color: var(--rf-blue); }
.rf-prodocum { --supplier-color: var(--rf-yellow); }
.rf-profibo { --supplier-color: var(--rf-teal); }
:root[data-theme="dark"] .rf { --rf-blue: #8cafff; --rf-yellow: #f2cc3e; --rf-teal: #70c9bb; }
.rf ::selection { background: var(--accent-soft); color: var(--ink); }
.rf :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rf input, .rf textarea { caret-color: var(--accent); }
.rf strong, .rf time, .rf-numeric { font-variant-numeric: tabular-nums; }
.rf h2, .rf h3, .rf p { margin: 0; }
.rf h2 { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.rf h3 { font-size: 15px; font-weight: 650; }
.rf-nav { display: flex; gap: 24px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.rf-nav a { padding: 8px 0 10px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; }
.rf-nav a[aria-current] { color: var(--accent-ink); border-color: var(--accent); }
.rf-suppliers { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0 0 18px; }
.rf-suppliers legend { float: left; margin: 0 16px 0 0; padding: 10px 0; font-weight: 600; }
.rf-supplier { display: flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 650; }
.rf-supplier:has(:checked) { border-color: var(--supplier-color); background: color-mix(in srgb, var(--supplier-color) 7%, var(--surface)); }
.rf-supplier:hover { background: var(--surface-soft); }
.rf-supplier input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.rf-supplier small { color: var(--muted); font-weight: 400; }
.rf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--supplier-color); flex-shrink: 0; }
.rf-overview { display: grid; grid-template-columns: minmax(205px, .85fr) minmax(310px, 1.6fr) minmax(210px, 1fr); gap: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 22px; }
.rf-balance { padding-right: 22px; }
.rf-total { display: block; font-size: clamp(24px, 2.25vw, 34px); font-weight: 700; line-height: 1.2; margin: 12px 0 9px; letter-spacing: -.03em; white-space: nowrap; }
.rf-total > span { font-size: 13px; letter-spacing: 0; color: var(--muted); }
.rf-balance > p { color: var(--muted); line-height: 1.5; }
.rf-future { display: grid; gap: 5px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.rf-future > span, .rf-future small { color: var(--muted); }
.rf-future strong { font-size: 16px; }
.rf-future small { font-size: 11px; }
.rf-currency { display: grid; margin-top: 15px; gap: 4px; font-size: 12px; }
.rf-aging, .rf-shares { margin: 0; min-width: 0; padding-left: 24px; border-left: 1px solid var(--line-soft); }
.rf-aging { padding-right: 24px; }
.rf figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.rf figcaption > span { color: var(--muted); font-size: 11px; }
.rf-age-row { display: grid; grid-template-columns: 108px minmax(28px, 1fr) auto; gap: 10px; align-items: center; min-height: 27px; font-size: 12px; }
.rf-age-row--future { margin-bottom: 5px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.rf-track { display: flex; min-width: 0; height: 10px; border-radius: 3px; background: var(--surface-soft); }
.rf-segment { width: var(--segment-width); height: 100%; background: var(--supplier-color); position: relative; border-right: 1px solid var(--surface); }
.rf-tooltip { display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; background: var(--ink); color: var(--surface); border-radius: 7px; padding: 7px 10px; box-shadow: var(--shadow-popover); }
.rf-segment:hover .rf-tooltip, .rf-segment:focus .rf-tooltip { display: block; }
.rf-age-row strong { min-width: 74px; text-align: right; white-space: nowrap; font-size: 12px; font-weight: 550; }
.rf-share { padding: 0 0 17px; }
.rf-share:last-child { padding-bottom: 0; }
.rf-share > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rf-share > div span { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.rf-share small { color: var(--muted); font-size: 11px; font-weight: 400; }
.rf-share > strong { display: block; margin: 6px 0; font-size: 17px; white-space: nowrap; }
.rf-share-track { height: 5px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.rf-share-track > span { display: block; width: var(--segment-width); height: 100%; background: var(--supplier-color); }
.rf-register { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: clip; }
.rf-toolbar { position: sticky; top: 0; z-index: 3; background: var(--surface); display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.rf-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-soft); border-radius: 10px; margin-right: auto; }
.rf-tabs a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.rf-tabs a[aria-current] { background: var(--surface); color: var(--accent-ink); }
.rf-tabs span { font-size: 11px; background: var(--pill); color: var(--ink); border-radius: 4px; padding: 1px 5px; }
.rf-search { width: min(270px, 30%); }
.rf-search label, .rf-age-filter label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.rf input:not([type='checkbox']), .rf select, .rf textarea { background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); border-radius: 8px; min-height: 36px; padding: 7px 10px; font: inherit; width: 100%; }
.rf input::placeholder, .rf textarea::placeholder { color: var(--muted); }
.rf-table-scroll { max-height: min(620px, 65vh); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; }
.rf-table { width: 100%; border-collapse: collapse; }
.rf-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: none; padding: 12px 14px; white-space: nowrap; }
.rf-table th:first-child, .rf-table td:first-child { padding-left: 20px; }
.rf-table td { border-top: 1px solid var(--line-soft); padding: 13px 14px; vertical-align: middle; }
.rf-table tr:hover td, .rf-table tr.is-selected td { background: var(--accent-soft); }
.rf-table tr.rf-case--attention:not(.is-selected) td { background: color-mix(in srgb, var(--warning) 7%, var(--surface)); }
.rf-table tr.rf-case--attention:not(.is-selected):hover td { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); }
.rf-attention-label { display: inline-block; color: var(--ink); font-size: 11px; white-space: nowrap; }
.rf-detail-section p.rf-attention-label { display: block; white-space: normal; padding: 10px 12px; margin-block: 12px; background: color-mix(in srgb, var(--warning) 7%, var(--surface)); border-radius: 7px; }
.rf-switch:disabled { cursor: default; opacity: .65; }
.rf-table tr.is-selected .rf-case-link strong { color: var(--accent-ink); }
.rf-case-link { display: grid; gap: 5px; text-decoration: none; color: var(--ink); min-width: 175px; }
.rf-case-link strong { font-size: 13px; font-weight: 600; }
.rf-case-link span { color: var(--muted); font-size: 11px; }
.rf-numeric { text-align: right; white-space: nowrap; }
.rf-numeric strong { font-size: 14px; font-weight: 600; }
.rf-numeric small { font-size: 11px; color: var(--muted); }
.rf-centered { text-align: center; }
.rf-entity { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.rf-count { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); }
.rf .ui-icon { width: 17px; height: 17px; flex-shrink: 0; }
.rf-action-count { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); width: 29px; height: 29px; border-radius: 50%; color: var(--ink); text-decoration: none; }
.rf-action-count:hover { border-color: var(--accent); color: var(--accent-ink); }
.rf-partial { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 10px; color: var(--accent-ink); margin-top: 5px; }
.rf-partial .ui-icon { width: 13px; height: 13px; }
.rf-age { display: inline-block; color: var(--muted); white-space: nowrap; font-size: 12px; }
.rf-age--late { color: var(--danger); }
.rf-paused { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.rf-paused span { max-width: 86px; }
.rf-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.rf-pagination > div { display: flex; align-items: center; gap: 10px; }
.rf-empty { padding: 52px 20px !important; text-align: center; }
.rf-empty strong { display: block; font-size: 17px; margin-bottom: 8px; }
.rf-empty p, .rf-muted { color: var(--muted); line-height: 1.55; }
.rf-warning { background: var(--warning-soft); color: var(--warning); border-radius: 8px; padding: 12px 15px; margin-bottom: 15px !important; }
.rf-detail { position: fixed; top: 12px; bottom: 12px; right: 12px; width: min(560px, calc(100vw - 24px)); z-index: 75; background: var(--surface); box-shadow: -12px 8px 44px -12px rgb(0 0 0 / 26%); border-radius: 16px; display: flex; flex-direction: column; animation: rf-panel-in .22s cubic-bezier(.16,1,.3,1); }
:root[data-theme="dark"] .rf-detail { box-shadow: -12px 8px 44px -12px rgb(0 0 0 / 70%); }
@keyframes rf-panel-in { from { transform: translateX(20px); } to { transform: translateX(0); } }
.rf-detail-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 23px 24px 17px; border-bottom: 1px solid var(--line); gap: 12px; }
.rf-detail-header h2 { font-size: 22px; margin-top: 10px; overflow-wrap: anywhere; }
.rf-close { display: flex; padding: 8px; min-width: 34px; }
.rf-detail-body { overflow: auto; overscroll-behavior: contain; padding: 0 24px 20px; scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; }
.rf-detail-body p { font-size: 12px; line-height: 1.6; }
.rf-detail-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; }
.rf-detail-controls form small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.rf-detail-controls > div { display: grid; justify-items: end; gap: 7px; }
.rf-text-link { color: var(--accent-ink); font-size: 11px; text-underline-offset: 3px; }
.rf-switch { display: flex; align-items: center; gap: 8px; background: none; padding: 4px 0; border: 0; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.rf-switch > span { width: 32px; height: 19px; border-radius: 12px; background: var(--control-line); position: relative; }
.rf-switch > span::after { content: ''; position: absolute; top: 3px; left: 3px; background: var(--surface); border-radius: 50%; width: 13px; height: 13px; transition: transform .16s ease-out; }
.rf-switch[aria-checked='true'] > span { background: var(--accent); }
.rf-switch[aria-checked='true'] > span::after { transform: translateX(13px); }
.rf-detail-section { padding: 20px 0; border-top: 1px solid var(--line-soft); }
.rf-detail-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.rf-finances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 17px 0 12px; }
.rf-finances div { display: grid; gap: 8px; }
.rf-finances div > span { color: var(--muted); font-size: 11px; }
.rf-finances strong { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.rf-finances p { grid-column: 1 / -1; color: var(--muted); }
.rf-due { display: flex; align-items: center; gap: 9px; font-size: 12px; padding-bottom: 20px; }
.rf-due .rf-age { margin-left: auto; }
.rf-section-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.rf-automation { font-size: 12px; color: var(--muted); }
.rf-reminder-steps { display: grid; grid-template-columns: repeat(6, 1fr); padding: 0; margin: 4px 0 14px; list-style: none; gap: 4px; }
.rf-reminder-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rf-reminder-steps strong { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; color: var(--muted); }
.rf-reminder-steps .is-recorded strong { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.rf-reminder-steps time { font-size: 12px; }
.rf-history-small { margin-top: 12px; font-size: 12px; }
.rf-history-small summary { cursor: pointer; color: var(--accent-ink); }
.rf-history-small p { margin-top: 8px; }
.rf-payment { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.rf-payment small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.rf-job-link { color: var(--accent-ink); display: inline-block; margin-right: 15px; text-underline-offset: 3px; }
.rf-form { display: grid; gap: 12px; }
.rf-form > div { display: grid; gap: 6px; }
.rf-form label { color: var(--muted); font-size: 12px; }
.rf-form textarea { resize: vertical; line-height: 1.6; }
.rf-form button { justify-self: start; }
.rf-form .errorlist { margin: 0; color: var(--danger); font-size: 12px; }
.rf-latest { margin-top: 18px; padding-top: 15px; border-top: 1px dashed var(--line); }
.rf-latest > span { color: var(--muted); font-size: 11px; }
.rf-latest strong { display: block; margin: 7px 0; }
.rf-history { list-style: none; padding: 0; margin: 0; }
.rf-history li { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.rf-history li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rf-history strong { font-size: 12px; font-weight: 600; }
.rf-history time, .rf-history small { color: var(--muted); font-size: 12px; }
.rf-history p { margin: 8px 0; overflow-wrap: anywhere; }
.rf-archive-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: var(--surface-soft); border-radius: 8px; margin-top: 15px !important; padding: 10px; }
.rf-archive-notice small { color: var(--muted); }
@media (min-width: 1600px) { .rf-overview { grid-template-columns: minmax(260px, 1fr) minmax(350px, 1.65fr) minmax(250px, 1fr); padding: 28px; } .rf-total { font-size: 36px; } }
@media (max-width: 1100px) { .rf-overview { grid-template-columns: minmax(180px,.8fr) minmax(285px,1.5fr); padding: 20px; } .rf-shares { grid-column: 1 / -1; display: flex; gap: 22px; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 18px; } .rf-shares figcaption { flex: 1; } .rf-share { flex: 1; padding: 0; } .rf-aging { padding-right: 0; } .rf-supplier small { display: none; } .rf-toolbar { flex-wrap: wrap; } }
@media (max-width: 700px) { .rf-suppliers { gap: 7px; } .rf-suppliers legend { float: none; margin-bottom: 7px; padding: 0; } .rf-supplier { padding: 10px; gap: 6px; } .rf-overview { display: flex; flex-direction: column; gap: 22px; padding: 20px; } .rf-balance { padding: 0; } .rf-total { font-size: 33px; } .rf-future { margin-top: 17px; } .rf-aging { border-left: 0; padding: 20px 0 0; border-top: 1px solid var(--line); } .rf-shares { margin: 0; flex-direction: column; gap: 18px; } .rf-shares figcaption { margin: 0; } .rf-share > strong { font-size: 18px; } .rf-toolbar { padding: 13px; gap: 12px; } .rf-tabs { width: 100%; } .rf-tabs a { flex: 1; justify-content: center; } .rf-search { width: 100%; } .rf-age-filter { width: 100%; } .rf-table { min-width: 760px; } .rf-pagination { padding: 12px; flex-wrap: wrap; } .rf-detail { inset: 0; width: 100%; border-radius: 0; } .rf-detail-header { padding: 18px; } .rf-detail-body { padding: 0 18px 18px; } .rf-detail-header h2 { font-size: 20px; } .rf-finances { gap: 8px; } .rf-finances strong { font-size: 17px; } .rf-due { flex-wrap: wrap; } .rf-reminder-steps li { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .rf-detail { animation: none; } .rf-switch > span::after { transition: none; } }

.rf #case-title:focus { outline: none; }
.rf-history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.rf-history-small .rf-form { margin-top: 12px; }
.rf-switch:disabled { opacity: .55; cursor: wait; }
@media (max-width: 700px) {
  body.rf-panel-open { overflow: hidden; }
  .rf-section-title { flex-wrap: wrap; gap: 0; margin-bottom: 14px; }
  .rf-section-title h3 { margin-bottom: 6px; }
  .rf-detail-controls { flex-wrap: wrap; }
  .rf-reminder-steps { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .rf-detail-controls > div { justify-items: start; }
}
