/* backoffice.css — Post-trade-specific styles */

.auto-match-link { color: hsl(270 60% 55%); animation: auto-glow 2s ease-in-out infinite; }
.auto-match-link:hover:not(.disabled) { color: hsl(270 60% 40%); }
.auto-match-link.disabled { color: var(--muted-fg); animation: none; cursor: not-allowed; opacity: 0.5; }
@keyframes auto-glow { 0%, 100% { text-shadow: 0 0 4px hsl(270 60% 60% / 0.3); } 50% { text-shadow: 0 0 10px hsl(270 60% 60% / 0.6); } }

.has-match-investor, .has-match-ref { position: relative; }
.has-match-investor::before { content: "\2721"; position: absolute; left: -0.125rem; color: var(--primary); opacity: 0.7; font-size: 0.75rem; }
.has-match-ref::before { content: "\2726"; position: absolute; left: -0.125rem; color: hsl(270 60% 55%); opacity: 0.8; font-size: 0.75rem; }

.ref-auto-matched { text-shadow: 0 0 6px hsl(270 60% 60% / 0.5); }
.ref-auto-matched-strong { text-shadow: 0 0 8px hsl(270 60% 60% / 0.7); }

tr.state-claimed > td { background: repeating-linear-gradient(-45deg, transparent, transparent 4px, hsl(0 0% 50% / 0.06) 4px, hsl(0 0% 50% / 0.06) 8px); }
tr.state-claimed:hover > td { background: hsl(0 0% 50% / 0.04) !important; }

.sidebar-card-tabs { display: flex; border-bottom: 1px solid var(--border); margin: -0.6rem -0.75rem 0.5rem; border-radius: 6px 6px 0 0; overflow: visible; }
.sidebar-card-tab { flex: 1; text-align: center; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-fg); padding: 0.5rem 0.75rem; cursor: pointer; background: var(--background); border: none; border-right: 1px solid var(--border); position: relative; }
.sidebar-card-tab:last-child { border-right: none; }
.sidebar-card-tab.active { background: var(--accent); color: var(--foreground); margin-bottom: -1px; border-bottom: 1px solid var(--accent); }
.sidebar-card-tab:disabled { opacity: 0.4; cursor: not-allowed; }

.parties-grid { font-size: 0.8125rem; display: grid; grid-template-columns: 5rem 1fr auto; row-gap: 0.2rem; align-items: baseline; }

.inv-face-value { font-size: 1.25rem; font-weight: 600; font-family: var(--font-mono); }
.inv-days-label { font-size: 0.6875rem; font-weight: 500; }

.btn-block { width: 100%; text-align: center; margin-top: 0.5rem; }

.sidebar-card.tx-table-card table { width: 100%; margin: 0; }
.sidebar-card.tx-table-card table th:first-child, .sidebar-card.tx-table-card table td:first-child { padding-left: 0.5rem; }
.sidebar-card.tx-table-card table th:last-child, .sidebar-card.tx-table-card table td:last-child { padding-right: 0.5rem; }

.tx-sidebar-title { margin:0; font-size:1.25rem; }
.tx-sidebar-subtitle { font-size:0.75rem; margin-top:0.15rem; }
.tx-detail-grid { display:grid; grid-template-columns:auto 1fr; gap:0.25rem 0.75rem; font-size:0.8125rem; }
.tx-word-break { word-break:break-all; }
.tx-pipeline-row { display:flex; align-items:center; gap:0.5rem; font-size:0.8125rem; }
.tx-pipeline-icon { width:1rem; height:1rem; flex-shrink:0; }
.tx-table-card { padding:0; }
.tx-table { width:100%; border-collapse:collapse; font-size:0.8125rem; }
.tx-table th { text-align:left; padding:0.5rem 0.75rem; font-size:0.6875rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--muted-fg); }
.tx-table th.text-right { text-align:right; }
.tx-table thead tr { border-bottom:1px solid var(--border); }
.tx-table td { padding:0.25rem 0.75rem; }
.tx-match-header { display:flex; align-items:center; gap:0.5rem; padding:0.625rem 0.75rem; font-size:0.8125rem; border-bottom:1px solid var(--border); }
.tx-score-detail { padding:0; background:var(--accent); border-bottom:1px solid var(--border); }
.tx-score-table { width:100%; font-size:0.75rem; border-collapse:collapse; }
.tx-score-table td { padding:0.25rem 0.75rem; white-space:nowrap; }
.tx-score-table td:first-child { width:5rem; }
.tx-score-table td:nth-child(2) { width:2.5rem; text-align:right; padding-right:0.75rem; }
.tx-run-header { display:flex; align-items:center; gap:0.5rem; font-size:0.8125rem; cursor:pointer; }
.tx-run-trace { margin-top:0.25rem; padding:0.5rem; background:var(--accent); border-radius:var(--radius); font-size:0.75rem; max-height:200px; overflow-y:auto; }
.tx-run-trace-line { color:var(--muted-fg); margin:0.125rem 0; }
.tx-padding { padding:0.75rem; }
.tx-candidate-row { cursor:pointer; }
.tx-apply-col { width:1.5rem; }
.tx-resolve-btn { font-size:0.6875rem; margin-top:0.25rem; }
.tx-sender-context-badge { margin-left:0.25rem; }
.tx-mapping-section { font-size:0.8125rem; }
.tx-reviewed-indent { margin-left:0.5rem; }
.tx-rerun-btn { margin-top:0.75rem; }
.tx-loading { padding:1rem; }
.tx-screening-divider { border-top:1px solid var(--border); padding-top:0.5rem; margin-top:0.5rem; }

/* Reference transforms settings */
.icon-sm { width: 1rem; height: 1rem; }
.font-semibold { font-weight: 600; }
.input-mono { font-family: var(--font-mono); font-size: 0.8rem; }
.input-upper { text-transform: uppercase; }
.form-group-sm { flex: 0 0 6rem !important; }
.form-group-xs { flex: 0 0 5rem !important; }
.empty-state { text-align: center; padding: 1.5rem; }

/* Invoice sidebar progress bar (redesigned) */
.inv-progress { display: flex; gap: 0.375rem; align-items: stretch; margin-bottom: 0.5rem; }
.inv-progress-track { display: flex; height: 0.625rem; border-radius: var(--radius); overflow: hidden; flex: 1; background: var(--border); }
.inv-progress-fees { flex: 0 0 auto; min-width: 3rem; max-width: 30%; }
.inv-bar-seg { height: 100%; transition: width 0.2s ease; }

/* Paid segments (solid, strong colours) */
.inv-bar-paid-debtor { background: hsl(142 60% 45%); }
.inv-bar-paid-creditor { background: hsl(210 60% 55%); }
.inv-bar-written-off { background: hsl(0 0% 65%); }

/* Outstanding segments (striped, muted) */
.inv-bar-owed-debtor {
  background: repeating-linear-gradient(-45deg, hsl(142 40% 75%), hsl(142 40% 75%) 3px, hsl(142 40% 85%) 3px, hsl(142 40% 85%) 6px);
}
.inv-bar-owed-creditor {
  background: repeating-linear-gradient(-45deg, hsl(210 40% 75%), hsl(210 40% 75%) 3px, hsl(210 40% 85%) 3px, hsl(210 40% 85%) 6px);
}

.inv-summary { display: flex; justify-content: space-between; font-size: 0.75rem; }
.inv-recourse-section { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.inv-recourse-section .sidebar-card-label { margin-bottom: 0.375rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.text-upper { text-transform: uppercase; }

/* --- Invoice ledger table (dual-axis: obligation ○ / cash ●) --- */
.ledger-table { width:100%; border-collapse:collapse; font-size:0.8125rem; }
.ledger-table th { padding:0.5rem 0.75rem; }
.ledger-table td { padding:0.4rem 0.75rem; }
.ledger-table .ledger-date-row td { background:var(--accent); border:none; padding:0.2rem 0.75rem; }
.ledger-table .ledger-balance td { padding:0.5rem 0.75rem; border-top:2px solid var(--border); }
.ledger-row-pending { background:hsl(40 90% 50% / 0.06); }
.ledger-cell { white-space:nowrap; }
.ledger-cell .axis-icon { font-size:var(--text-2xs); opacity:0.35; margin-left:0.25rem; }
.ledger-cell .cash-line { margin-top:0.125rem; }
