/* Platform foundation (modules/20-platform) and the shared parts every investment-banking module uses (ib- classes). */

/* Status chips above lists */
.ib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-chips a { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid #d3dde7; border-radius: 99px; background: #fff; font-size: 12px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.ib-chips a b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.ib-chips a.on { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.ib-chips a.on b { color: #dbeafe; }
.ib-chips a.t-bad:not(.on) { border-color: #f1c4c8; } .ib-chips a.t-warn:not(.on) { border-color: #f3dca6; } .ib-chips a.t-ok:not(.on) { border-color: #bfe5d2; }

/* Record pages */
.ib-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.ib-head .ib-id { display: flex; gap: 10px; align-items: center; min-width: 0; flex-wrap: wrap; }
.ib-head .ib-id b { font-size: 15px; }
.ib-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ib-facts > div { background: var(--panel2, #f6f9fc); border: 1px solid #dde5ed; border-radius: 4px; padding: 8px 10px; min-width: 0; }
.ib-facts span { display: block; font-size: 11.5px; color: var(--muted); }
.ib-facts b { display: block; font-size: 15.5px; margin-top: 2px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ib-facts b.up { color: #0b7a52; } .ib-facts b.down { color: #b3261e; }
.ib-steps { overflow-x: auto; position: relative; }
.ib-steps .ct-steps { min-width: 560px; }
.ib-note { margin-top: 4px; padding: 7px 10px; background: var(--panel-soft, #f5f8fb); border-radius: 6px; white-space: normal; overflow-wrap: anywhere; }
.ib-actions form { margin: 0; }
.ib-actions .ct-btn { width: 100%; justify-content: center; }
.ib-actions .ib-inline { display: flex; gap: 6px; }
.ib-actions .ib-inline .ct-input { flex: 1; min-width: 0; }
.ib-actions .ib-inline .ct-btn { width: auto; }
.ib-pre { margin: 0; padding: 10px 12px; background: #0f1d2e; color: #d9e6f5; border-radius: 4px; font-family: Consolas, 'Courier New', monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; position: relative; }
.ib-saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ib-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid #e0e7ed; }
.ib-bulk select { max-width: 280px; }
.ib-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ib-split > * { min-width: 0; }

/* Where a figure came from */
.ib-src { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ib-demo { display: inline-block; padding: 1px 6px; border-radius: 3px; background: #fff3d6; color: #8a5a00; border: 1px solid #f1d58e; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.ib-sandbox { display: inline-block; padding: 1px 6px; border-radius: 3px; background: #f1e9ff; color: #5a2fb3; border: 1px solid #d6c4fb; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }

/* Numbers */
.ib-pos { color: #0b7a52; } .ib-neg { color: #b3261e; }
.ct-tbl td.num, .ct-tbl th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-tbl td.nw, .ct-tbl th.nw { white-space: nowrap; }

/* In-table meter (utilisation against a limit) */
.ib-meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ib-meter i { flex: 1; height: 7px; background: #e6edf3; border-radius: 99px; position: relative; overflow: hidden; display: block; }
.ib-meter i em { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #2083ee, #0962d3); }
.ib-meter.warn i em { background: linear-gradient(90deg, #f5a524, #e08a00); }
.ib-meter.bad i em { background: linear-gradient(90deg, #ef5927, #d23a10); }
.ib-meter b { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }

/* Grids of numbers (sensitivity tables, ladders, matrices) */
.ib-grid td, .ib-grid th { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ib-grid td:first-child, .ib-grid th:first-child { text-align: left; }
.ib-grid td.base { background: #e8f2ff; font-weight: 700; }
.ib-heat-1 { background: #eaf7f0; } .ib-heat-2 { background: #cdeedd; } .ib-heat-3 { background: #fdf0d6; } .ib-heat-4 { background: #fbd9cf; } .ib-heat-5 { background: #f6b9b0; }

/* Calendar check */
.ib-check { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.ib-check .ct-field { min-width: 140px; }

@media (max-width: 760px) {
    .ib-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ib-actions .ib-inline { flex-wrap: wrap; }
    .ib-chips a { padding: 4px 8px; }
}

/* Long names wrap in the first column so status pills and numbers stay visible in narrow panels. */
.ct-tbl td:first-child:not(.nw) { white-space: normal; min-width: 160px; }
.ct-tbl td .sub { white-space: normal; }
.ct-tbl td .ct-pill { white-space: nowrap; }
.ib-hl{background:rgba(11,92,173,.10)!important;font-weight:600}
