/* Findings (views/findings.js). Kit tokens only. */

.fd-amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.fd-amt.leakage { color: var(--destructive); }
.fd-amt.overbilling { color: var(--warning); }
.fd-amt.flag, .fd-amt.reconciliation { color: var(--foreground); }

/* Header export menu */
.fd-export { position: relative; }
.fd-export > summary { list-style: none; }
.fd-export > summary::-webkit-details-marker { display: none; }
.fd-export > summary svg.lucide:last-child { width: 14px; height: 14px; color: var(--muted-foreground); }
.fd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; width: 240px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--popover); box-shadow: var(--shadow-filter-popover); }

/* Summary strip and rollup */
.fd-summary { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.fd-summary .rx-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fd-summary .rx-kpi-value { font-size: 20px; line-height: 28px; }
.fd-rollup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; border-radius: var(--radius-xl); background: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.fd-rollup b { font-weight: 600; }
.fd-rollup svg.lucide { width: 14px; height: 14px; color: var(--muted-foreground); margin: 0 4px; }

/* Toolbar and results */
.fd-toolbar { flex-wrap: wrap; }
.fd-toolbar .rx-search { flex: 1 1 200px; min-width: 180px; }
.fd-toolbar .select { min-width: 0; width: auto; max-width: 180px; }
.fd-results-meta { display: flex; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 8px; }
.fd-group-sel { width: auto; }

/* Register */
.fd-cust { max-width: 140px; display: block; }
.fd-pair { display: block; max-width: 190px; }
.fd-rc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 190px; white-space: normal; }
.fd-rec-ic { width: 12px; height: 12px; color: var(--muted-foreground); vertical-align: -1px; }
.fd-del { display: block; max-width: 130px; margin-left: auto; }
.fd-clause { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fd-clause .cite-chip, .fd-clause .cite { max-width: 120px; }
.fd-action { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--radius-md); border: 1px solid var(--border-brand); background: var(--background-brand); color: var(--primary); font-size: 12px; font-weight: 500; white-space: nowrap; cursor: help; }
.fd-action svg.lucide { width: 12px; height: 12px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.fd-group { margin-bottom: 16px; }
.fd-group-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.fd-group-head .count { font-size: 12px; color: var(--muted-foreground); }

/* Open month */
.fd-empty { border: 1px dashed var(--border); border-radius: var(--radius-xl); background: var(--card); }

/* Detail panel */
.fd-detail { display: flex; flex-direction: column; gap: 20px; }
.fd-detail-top { display: flex; align-items: flex-start; gap: 12px; }
.fd-detail-amt { font-size: 20px; line-height: 28px; }
.fd-badges { gap: 8px; justify-content: flex-end; }
.fd-title-line { margin: -8px 0 0; font-size: 14px; line-height: 20px; }
.fd-trace { list-style: none; margin: 0; padding: 0; }
.fd-step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.fd-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); }
.fd-step-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--radius-full); background: var(--muted); border: 1px solid var(--border); color: var(--muted-foreground); }
.fd-step-ic svg.lucide { width: 14px; height: 14px; }
.fd-step.leakage .fd-step-ic { background: var(--destructive-foreground); color: var(--destructive); border-color: transparent; }
.fd-step.overbilling .fd-step-ic { background: var(--warning-foreground); color: var(--warning); border-color: transparent; }
.fd-step.fina .fd-step-ic { background: var(--muted-brand); color: var(--primary); border-color: transparent; }
.fd-step-body { flex: 1; min-width: 0; padding-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.fd-step-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.fd-step-label { font-size: 14px; font-weight: 600; }
.fd-step-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.fd-step-meta { gap: 8px; align-items: center; }
.fd-quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--primary); border-radius: var(--radius-md); background: var(--background-brand); font-family: var(--font-serif); font-size: 14px; line-height: 22px; }
.fd-quote mark.rx-hl { padding: 0 2px; border-radius: var(--radius-xs); }
.fd-calc { font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.fd-src { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--muted-foreground); text-align: left; }
.fd-src.link { cursor: pointer; color: var(--primary); }
.fd-src svg.lucide { width: 12px; height: 12px; flex: none; }
.fd-fina-text { margin: 0; font-family: var(--font-serif); font-size: 14px; line-height: 22px; }

/* Resolve card */
.fd-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); }
.fd-card-head { display: flex; align-items: center; gap: 8px; }
.fd-card-head svg.lucide { color: var(--primary); width: 16px; height: 16px; }
.fd-btns { gap: 8px; }
.fd-more { padding-top: 12px; border-top: 1px solid var(--border); }
.fd-note { padding: 8px 12px; border-radius: var(--radius-md); background: var(--muted); font-size: 14px; }
.fd-doc { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--background); box-shadow: var(--shadow-sm); overflow: hidden; }
.fd-doc-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--muted); border-bottom: 1px solid var(--border); }
.fd-doc-head svg.lucide { width: 16px; height: 16px; color: var(--muted-foreground); }
.fd-doc-title { display: block; font-size: 14px; font-weight: 600; }
.fd-doc-lines { width: 100%; border-collapse: collapse; font-size: 12px; }
.fd-doc-lines th, .fd-doc-lines td { padding: 4px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.fd-doc-lines th { color: var(--muted-foreground); font-weight: 500; }
.fd-doc-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-doc-lines tfoot td { font-weight: 600; border-bottom: 0; }
.fd-doc-text { margin: 0; padding: 8px 12px; font-size: 14px; line-height: 20px; }
.fd-doc-text.fd-plain { padding: 0; }
.fd-fas { margin: 0; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.fd-fas dt { font-size: 12px; color: var(--muted-foreground); }
.fd-fas dd { margin: 0; font-size: 14px; line-height: 20px; }

/* Meta and links */
.fd-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 16px; border-radius: var(--radius-xl); background: var(--muted); }
.fd-meta dt { font-size: 12px; color: var(--muted-foreground); }
.fd-meta dd { margin: 4px 0 0; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.fd-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 500; }
.fd-link svg.lucide { width: 14px; height: 14px; }

/* Evidence */
.fd-ev { display: flex; flex-direction: column; gap: 12px; }
.fd-h3 { margin: 0; font-size: 16px; font-weight: 600; }
.fd-ev-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; }
.fd-ev-k { font-size: 12px; color: var(--muted-foreground); padding-top: 4px; }
.fd-ev-v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.fd-ev-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fd-file { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); font: inherit; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.fd-file:hover:not([disabled]) { background: var(--accent); }
.fd-file[disabled] { cursor: default; }
.fd-file > svg.lucide { width: 16px; height: 16px; color: var(--muted-foreground); flex: none; }
.fd-file { width: 100%; }
.fd-file .grow { min-width: 0; flex: 1 1 auto; }
.fd-file .cell-main, .fd-file .cell-sub { display: block; white-space: normal; overflow-wrap: anywhere; }
.fd-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fd-activity li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; line-height: 20px; }
.fd-act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); flex: none; transform: translateY(-2px); }

/* File preview */
.fd-csv { display: flex; flex-direction: column; gap: 12px; }
.fd-csv .row { gap: 8px; align-items: center; }
.fd-csv-wrap { max-height: calc(100vh - 200px); overflow: auto; }

@media (max-width: 1100px) { .fd-summary .rx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .fd-summary .rx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fd-ev-row { grid-template-columns: minmax(0, 1fr); } }
