/* Revenue assurance shell: layout, top bar, nav, side panel and shared components. Kit tokens only. */
.nowrap { white-space: nowrap; }
.ra-wordmark { display: block; flex: none; width: 52px; height: 20px; background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKcAAABACAYAAAB/V2fWAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAp6ADAAQAAAABAAAAQAAAAACvqqIdAAALwklEQVR4Ae1dzXLbOBIGSGl3D1u12idYTpxU5TbOE4xy3EPi0RPYfoLYVWOn9mT5NLV2quI8ge0nkJ3s1h7tPEE8t1QlzvAN1nOYqdkRCezXlEhTZBMiKY0sWWCVTKDRaDQajcZfgxbCPlYCVgJWAlYCVgJWAlYC9SXwqPd6tX5um3NZJODMuqJe77WnnH5v1uXa8hZPAo2qLD98d9gWWqwprdtSiBbyeyka/vXa7lepeC7oin4bQO9R72D1U2f3KodgAVYCQwmUVk4aipUbvNZKtykvFLPyA6vZEk5/jzIq13mB12ZlIjbD0kig1LBO1lI5wYWAtawrGRrOHad/gfxeREOrjQfvDiNFrUvT5rvfEhhrAEmp3LRSmeWRG9ZX3h5sIMua0LIthKZpQPbxhXQuhQzPr5+9PMsm2vjySmCs5YRibkE8Xm0RhfEUgFVMkJUtoYOfZODc1C7DZryXEhg755RCfqOxAuIeKeUl4Oc61EPFit+32Ned3RPETrze9xjWGz0p9GqSqsSbUPzc9Ttdq5iJUGwgloBxWKcFDCznf2PkkbcUJ9fPdzdHYGMiQ3ofgOZhRVU5/xjyNvmeScA4rDcawa2Vy1TcCcWbDGhs1O9s38DaRvnq5B9bgEW4VxIwKqeppnX3KIMwOANdv25+E0827X5JoLZy1hWD3/mHL5Terpvf5lseCcxcOUm01x27ZbQ8Kla/pneinPXZtTmXSQJjt5IWURi0K0CLOa21J/HDJv8NtsNoMeZ/frZzOes6Pf7P916/77ajcrHtVnfkiOgEzioONFpRvUBQo05UryBo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line { background: var(--background); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); }

/* Top bar (L-01): 56px, 32px controls */
.topbar { gap: 12px; }
.topbar .brand-mark { flex: none; }
.ra-top-field { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ra-top-field .select { width: auto; min-width: 0; padding: 0 8px; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--muted-brand); color: var(--primary); font-size: 12px; font-weight: 600; }
.ra-menu-wrap { position: relative; }
.ra-menu { position: absolute; right: 0; top: 40px; z-index: 45; width: 240px; padding: 4px; background: var(--popover); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.ra-menu .ra-menu-who { padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ra-menu .navitem { font-weight: 400; }

/* Body: nav 248px, main shrinks, side panels fixed width (L-14, L-24) */
.ra-body { display: flex; min-height: 0; overflow: hidden; }
.ra-nav { flex: 0 0 248px; width: 248px; padding: 16px 8px; background: var(--background); }
.ra-nav .group { white-space: nowrap; padding: 16px 12px 4px; }
.ra-nav .group:first-child { padding-top: 4px; }
.ra-nav .navitem { white-space: nowrap; }
.ra-nav .navitem .label { overflow: hidden; text-overflow: ellipsis; }
.ra-nav .navitem .count { flex: none; }
.ra-nav .navitem[aria-current="page"] .count { background: var(--background); color: var(--primary); }
.ra-main { display: flex; flex: 1 1 0; min-width: 0; min-height: 0; }
.ra-main > .page { flex: 1 1 0; min-width: 0; }
.page-inner { padding: 24px; max-width: none; }
/* With a side or Fina panel open, tables keep their full-width layout and scroll inside their card instead of squeezing (Fina ResizablePanel behaviour) */
.ra-main:has(> #side:not([hidden])) #page .table-wrap > table.table,
.ra-main:has(> #fina:not([hidden])) #page .table-wrap > table.table,
.ra-main:has(> #side:not([hidden])) #page .ra-table-wrap > table.table,
.ra-main:has(> #fina:not([hidden])) #page .ra-table-wrap > table.table { min-width: 1080px; }
.ra-main:has(> #side:not([hidden])) #page .table-wrap,
.ra-main:has(> #fina:not([hidden])) #page .table-wrap,
.ra-main:has(> #side:not([hidden])) #page .ra-table-wrap,
.ra-main:has(> #fina:not([hidden])) #page .ra-table-wrap { overflow-x: auto; }

/* Right side panel: the product's ResizablePanel (45% default, 40 to 75%), width animates in and out */
.ra-side { position: relative; flex: none; width: 0; max-width: 75%; min-height: 0; overflow: hidden; background: var(--background); transition: width var(--motion-standard, 200ms) var(--ease-move, ease-out); }
.ra-side.resizing { transition: none; }
.ra-side::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--border); z-index: 2; }
.ra-resize { position: absolute; left: 0; top: 0; bottom: 0; width: 12px; z-index: 3; cursor: col-resize; display: flex; align-items: stretch; }
.ra-resize span { width: 2px; border-radius: var(--radius-full); background: var(--primary); opacity: 0; transition: opacity var(--motion-quick, 150ms); }
.ra-resize:hover span, .ra-side.resizing .ra-resize span { opacity: 1; }
.ra-side-inner { position: absolute; inset: 0 0 0 1px; min-width: 320px; display: flex; flex-direction: column; }
.ra-side-head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--border); flex: none; }
.ra-side-head .grow > * + * { margin-top: 2px; }
.ra-side-title { overflow-wrap: anywhere; }
.ra-side-body { flex: 1; min-height: 0; overflow: auto; padding: 24px; }
.ra-clause { font-family: var(--font-serif); font-size: 16px; line-height: 24px; }
.table tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--primary); }

/* Ask Fina panel */
.ra-fina { flex: 0 0 380px; width: 380px; }
.ra-ask { display: flex; flex-direction: column; gap: 16px; }
.ra-ask .q-bubble { align-self: flex-end; background: var(--muted); border-radius: var(--radius-lg); padding: 8px 12px; max-width: 85%; }
.ra-ask .ra-reading { font-size: 14px; line-height: 22px; }
.ra-try { display: flex; flex-direction: column; gap: 8px; }
.ra-try-head { padding-left: 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted-foreground); }
.ra-try-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); }
.ra-try-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; transition: background var(--motion-quick, 150ms); }
.ra-try-row + .ra-try-row { border-top: 1px solid var(--border); }
.ra-try-row:hover, .ra-try-row:focus-visible { background: var(--accent); }
.ra-try-row svg.lucide { color: var(--muted-foreground); }
.ra-try-label { flex: none; white-space: nowrap; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--foreground); }
.ra-try-prompt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--muted-foreground); opacity: .8; }
.ra-composer { display: flex; gap: 8px; }

/* Fina summary card */
.ra-fina-card > * + * { margin-top: 8px; }
.ra-reading { font-family: var(--font-serif); font-size: 16px; line-height: 24px; }
.ra-reading b, .ra-reading strong { font-weight: 600; }

/* Tabs: kit pattern at 32px (Q-07) */
.tabs { padding: 2px; max-width: 100%; overflow-x: auto; }
.tab { height: 28px; white-space: nowrap; flex: none; }

/* KPI grid */
.ra-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.ra-kpi { display: flex; flex-direction: column; gap: 4px; }
.ra-kpi-value { font-size: 20px; line-height: 28px; font-weight: 600; white-space: nowrap; }
.ra-kpi.success .ra-kpi-value { color: var(--success); }
.ra-kpi.warning .ra-kpi-value { color: var(--warning); }
.ra-kpi.destructive .ra-kpi-value { color: var(--destructive); }
.ra-kpi.info .ra-kpi-value { color: var(--information); }
.ra-kpi.brand .ra-kpi-value { color: var(--primary); }

/* Tables: own overflow box, min width, nowrap numbers (D-01..D-05) */
.ra-table-wrap table.table { min-width: var(--min-w, 720px); }
.table td.num, .table td.nowrap, .table th.nowrap { white-space: nowrap; }
.badge svg.lucide { width: 12px; height: 12px; }

/* House table standard (applies to every table in every view; views must not override) */
.table th, .table td { text-align: left; vertical-align: middle; }
.table th.num, .table td.num { text-align: right; }
.table th.act, .table td.act { text-align: right; width: 48px; }
.table td { border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { display: block; color: var(--foreground); }
.table .cell-sub { display: block; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.table td .badge { display: inline-flex; width: auto; max-width: none; white-space: nowrap; }
.badge { flex: none; width: auto; white-space: nowrap; }
.table tr.group td { background: var(--muted); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; }
.table tr.group:hover td { background: var(--accent); }
.table tr.group .group-toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 6px); background: var(--background); vertical-align: middle; }
.table tr.group .group-toggle svg { width: 14px; height: 14px; transition: transform 150ms ease-in-out; }
.table tr.group[aria-expanded="false"] .group-toggle svg { transform: rotate(-90deg); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Waterfall: deductions float from the running total, subtotals start at 0 */
.wf-unit { text-align: right; }
.wf-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.wf-row.total { border-top: 1px solid var(--border); }
.wf-head { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: start; }
.wf-label { min-width: 0; overflow-wrap: anywhere; }
.wf-val { text-align: right; white-space: nowrap; }
.wf-row.total .wf-label, .wf-row.total .wf-val { font-weight: 500; }
.wf-row.adj .wf-label, .wf-row.adj .wf-val, .wf-row.ref .wf-label, .wf-row.ref .wf-val { color: var(--muted-foreground); }
.wf-row.bad .wf-label, .wf-row.bad .wf-val { color: var(--destructive); }
.wf-row.over .wf-label, .wf-row.over .wf-val { color: var(--warning); }
.wf-track { display: flex; height: 12px; }
.wf-bar { flex: none; height: 12px; border-radius: 2px; background: var(--primary); }
.wf-bar.dec { background: var(--muted-foreground); }
.wf-bar.inc { background: var(--success); }
.wf-bar.billed { background: var(--information); }
.wf-bar.gap { background: var(--destructive); }
.wf-bar.over { background: var(--warning); }
.wf-bar.ref { background: transparent; border: 1px dashed var(--muted-foreground); }

@media (max-width: 1100px) {
  .ra-top-field > .t-meta { display: none; }
    .ra-fina { flex-basis: 340px; width: 340px; }
}

/* Page header (H5): title left and nowrap, meta and actions right, wrapping below when short of room */
.page-head { flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.page-head .t-page { white-space: nowrap; }
.page-head > .grow, .page-head > h1 { flex: 1 0 auto; min-width: auto; }
.page-head > .row:last-child, .ra-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; min-width: 0; }

/* Round 9: long module name shrinks with an ellipsis (full name in its title) before the top bar controls do. */
.topbar .ra-module { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
