/* ═════════════════════════════════════════════════════════════════════════
   PROCUREMENT INTELLIGENCE: ORDERS AND SUBCONTRACTS (proc-commitments.css)

   Only new selectors, every one prefixed .cm-. The rail, strip, alerts,
   chips, pills, drawer, fields and activity list are the workspace's own
   ws-*, op-*, rc-*, xf-* and sr-* classes and are not restyled here. Same
   tokens, same greens, ambers and blues, and a light pass for every colour
   set below.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── The bar above the ledger ────────────────────────────────────────── */
.cm-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    margin: 4px 0 16px;
}
.cm-bar-l h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--white); }
.cm-bar-l span { display: block; margin-top: 3px; font-size: 12px; color: var(--gray-light); }
.cm-bar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-bar-r .up-btn { padding: 8px 16px; font-size: 12.5px; }
.cm-sel {
    font: inherit; font-size: 12px; padding: 7px 10px; border-radius: 9px; max-width: 260px;
    background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--white);
}
.cm-sel:focus { outline: none; border-color: rgba(196,23,23,.6); box-shadow: 0 0 0 3px rgba(196,23,23,.15); }
.cm-strip { margin-bottom: 22px; }
.cm-strip .ws-kpi { cursor: pointer; text-align: left; font: inherit; color: inherit; }

/* ── Sections ────────────────────────────────────────────────────────── */
.cm-sec { margin-bottom: 26px; }
.cm-sec-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.cm-sec-h h2 {
    margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gray-light);
}
.cm-sec-s { font-size: 12px; color: var(--gray-light); opacity: .85; max-width: 90ch; }
.cm-quiet {
    padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--border);
    font-size: 12.5px; line-height: 1.6; color: var(--gray-light);
}
.cm-rollups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cm-contract {
    margin: 0 0 22px; padding: 12px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.55;
    border: 1px solid rgba(224,160,59,.35); background: rgba(224,160,59,.08); color: var(--white);
}
.cm-contract.is-bad { border-color: rgba(196,23,23,.45); background: rgba(196,23,23,.1); }

/* ── Tables: the ledger, the rollups, the lines ──────────────────────── */
.cm-tbl-w { overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.025); }
.cm-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--white); }
.cm-tbl th {
    text-align: left; padding: 9px 11px; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
    color: var(--gray-light); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.cm-tbl td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cm-tbl tbody tr:last-child td { border-bottom: 0; }
.cm-tbl-sm { font-size: 12px; }
.cm-tbl-sm td, .cm-tbl-sm th { padding: 7px 10px; }
.cm-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cm-strong { font-weight: 750; }
.cm-none { font-style: normal; font-weight: 400; color: var(--gray-light); opacity: .8; }
.cm-codes { font-family: var(--font-mono); font-size: 11px; color: var(--gray-light); }
.cm-var.is-ahead { color: #2fc07d; }
.cm-var.is-behind { color: #ff8f8f; }
.cm-row { cursor: pointer; transition: background .12s ease; }
.cm-row:hover td { background: rgba(255,255,255,.04); }
.cm-row.is-quiet td { color: var(--gray-light); }
.cm-row.is-warn .cm-no { box-shadow: inset 3px 0 0 #e0a03b; }
.cm-row.is-bad .cm-no { box-shadow: inset 3px 0 0 #ff6b6b; }
.cm-row.is-stop .cm-no { box-shadow: inset 3px 0 0 var(--red); }
.cm-no { white-space: nowrap; }
.cm-no .op-mono { font-weight: 700; }
.cm-risk { margin-left: 6px; }
.cm-vendor { min-width: 180px; }
.cm-vendor > span { display: block; }
.cm-vchip { margin-top: 3px; }
.cm-code { white-space: nowrap; }
.cm-exp { white-space: nowrap; }
.cm-total td { border-top: 2px solid var(--border); border-bottom: 0; font-weight: 750; color: var(--white); }
.cm-total td:first-child { font-size: 10px; letter-spacing: .11em; text-transform: uppercase; color: var(--gray-light); }
.cm-vlink, .cm-lnk {
    appearance: none; cursor: pointer; font: inherit; padding: 0; border: 0; background: none;
    font-weight: 700; color: var(--white);
}
.cm-vlink:hover, .cm-lnk:hover { color: #ff8f6b; }
.cm-lnk { font-weight: 600; font-size: inherit; }

/* ── The drawer ──────────────────────────────────────────────────────── */
.cm-meta-v { display: inline-flex; align-items: center; gap: 6px; }
.cm-meta-v .cm-vlink { font-size: inherit; }
.cm-pill { text-transform: none; }
.cm-acts { row-gap: 6px; }
.cm-acts .sr-act.is-danger { margin-left: auto; }
.cm-risk-b {
    margin: 12px 24px 0; padding: 10px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.55;
    border: 1px solid rgba(224,160,59,.4); background: rgba(224,160,59,.1); color: var(--white);
}
.cm-risk-b b { color: #e0a03b; }
.cm-ok { padding: 12px 24px 0; font-size: 12.5px; line-height: 1.55; color: var(--gray-light); }
.cm-err { margin: 12px 24px 0; }
.cm-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 24px 0; }
.cm-m { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); min-width: 0; }
.cm-m > span { font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-light); }
.cm-m > b { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--white); }
.cm-m > i { font-style: normal; font-size: 10.5px; color: var(--gray-light); }
.cm-m.is-strong > b { font-size: 16px; }
.cm-m.is-warn > b { color: #e0a03b; }
.cm-m.is-ahead > b { color: #2fc07d; }
.cm-m.is-behind > b { color: #ff8f8f; }
.cm-gate {
    margin: 14px 24px 0; padding: 12px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.6;
    border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--white);
}
.cm-gate.is-ok { border-color: rgba(20,168,106,.35); background: rgba(20,168,106,.08); }
.cm-gate.is-ok b { color: #2fc07d; }
.cm-gate.is-bad { border-color: rgba(196,23,23,.45); background: rgba(196,23,23,.09); }
.cm-gate.is-bad b { color: #ff8f8f; }
.cm-gate ul { margin: 6px 0 0; padding-left: 18px; }
.cm-gate li { margin: 3px 0; }
.cm-gate-a { margin-top: 10px; }
.cm-blk { padding: 18px 24px 0; }
.cm-blk h4 {
    display: flex; align-items: center; gap: 9px; margin: 0 0 8px;
    font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--white);
}
.cm-blk h4::before { content: ""; width: 14px; height: 2px; border-radius: 100px; background: var(--red); }
.cm-h-act { margin-left: auto; text-transform: none; letter-spacing: 0; }
.cm-lines { font-size: 11.5px; }
.cm-lines td, .cm-lines th { padding: 7px 8px; }
.cm-lines .cm-desc { min-width: 200px; }
.cm-line.is-void td { opacity: .5; text-decoration: line-through; }
.cm-line.is-bad .cm-desc, .cm-line.is-critical .cm-desc { box-shadow: inset 3px 0 0 #ff6b6b; }
.cm-line.is-warn .cm-desc { box-shadow: inset 3px 0 0 #e0a03b; }
.cm-line-acts { white-space: nowrap; }
.cm-line-acts .sr-act { padding: 3px 8px; font-size: 10.5px; margin-right: 4px; }
.cm-slack { font-variant-numeric: tabular-nums; font-weight: 700; padding: 1px 7px; border-radius: 100px; background: rgba(255,255,255,.07); }
.cm-slack.is-ok { color: #2fc07d; background: rgba(20,168,106,.16); }
.cm-slack.is-warn { color: #e0a03b; background: rgba(224,160,59,.16); }
.cm-slack.is-bad, .cm-slack.is-critical { color: #ff8f8f; background: rgba(255,107,107,.16); }
.cm-li {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--gray-light);
}
.cm-li:first-of-type { border-top: 0; }
.cm-li.is-void, .cm-li.is-rejected, .cm-li.is-not_selected { opacity: .65; }
.cm-li.is-bad { color: var(--white); }
.cm-li-t { flex: 1; min-width: 160px; line-height: 1.45; }
.cm-li-a { font-variant-numeric: tabular-nums; color: var(--white); }
.cm-li-a.is-credit { color: #2fc07d; }
.cm-li-acts { display: flex; gap: 6px; margin-left: auto; }
.cm-li-acts .sr-act { padding: 3px 9px; font-size: 10.5px; }
.cm-stage { color: var(--white); }
.cm-threat { font-style: normal; color: #ff8f8f; }
.cm-claims { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.cm-act { padding-top: 22px; }

/* ── Light theme, every colour above ─────────────────────────────────── */
html.light .cm-bar-l h2, html.light .cm-tbl, html.light .cm-total td, html.light .cm-vlink, html.light .cm-lnk,
html.light .cm-m > b, html.light .cm-blk h4, html.light .cm-li-a, html.light .cm-stage, html.light .cm-contract,
html.light .cm-risk-b, html.light .cm-gate, html.light .cm-li.is-bad { color: var(--black); }
html.light .cm-bar-l span, html.light .cm-sec-h h2, html.light .cm-sec-s, html.light .cm-quiet, html.light .cm-tbl th,
html.light .cm-none, html.light .cm-codes, html.light .cm-row.is-quiet td, html.light .cm-total td:first-child,
html.light .cm-m > span, html.light .cm-m > i, html.light .cm-ok, html.light .cm-li { color: var(--gray-mid); }
html.light .cm-sel { background: #fff; border-color: rgba(0,0,0,.13); color: var(--black); }
html.light .cm-quiet { border-color: rgba(0,0,0,.14); }
html.light .cm-tbl-w { background: #fafbfc; border-color: rgba(0,0,0,.09); }
html.light .cm-tbl th, html.light .cm-tbl td, html.light .cm-li, html.light .cm-claims { border-color: rgba(0,0,0,.08); }
html.light .cm-row:hover td { background: rgba(0,0,0,.03); }
html.light .cm-total td { border-top-color: rgba(0,0,0,.18); }
html.light .cm-var.is-ahead, html.light .cm-m.is-ahead > b, html.light .cm-gate.is-ok b, html.light .cm-li-a.is-credit, html.light .cm-slack.is-ok { color: #0f7a4b; }
html.light .cm-var.is-behind, html.light .cm-m.is-behind > b, html.light .cm-gate.is-bad b, html.light .cm-threat, html.light .cm-slack.is-bad, html.light .cm-slack.is-critical { color: #c41717; }
html.light .cm-m.is-warn > b, html.light .cm-risk-b b, html.light .cm-slack.is-warn { color: #a8690f; }
html.light .cm-row.is-warn .cm-no, html.light .cm-line.is-warn .cm-desc { box-shadow: inset 3px 0 0 #a8690f; }
html.light .cm-row.is-bad .cm-no, html.light .cm-row.is-stop .cm-no, html.light .cm-line.is-bad .cm-desc, html.light .cm-line.is-critical .cm-desc { box-shadow: inset 3px 0 0 #c41717; }
html.light .cm-m { background: rgba(0,0,0,.04); }
html.light .cm-slack { background: rgba(0,0,0,.06); }
html.light .cm-slack.is-ok { background: rgba(20,168,106,.14); }
html.light .cm-slack.is-warn { background: rgba(168,105,15,.12); }
html.light .cm-slack.is-bad, html.light .cm-slack.is-critical { background: rgba(196,23,23,.1); }
html.light .cm-contract { border-color: rgba(168,105,15,.35); background: rgba(168,105,15,.07); }
html.light .cm-contract.is-bad { border-color: rgba(196,23,23,.35); background: rgba(196,23,23,.07); }
html.light .cm-risk-b { border-color: rgba(168,105,15,.35); background: rgba(168,105,15,.07); }
html.light .cm-gate { border-color: rgba(0,0,0,.1); background: #fff; }
html.light .cm-gate.is-ok { border-color: rgba(15,122,75,.3); background: rgba(20,168,106,.07); }
html.light .cm-gate.is-bad { border-color: rgba(196,23,23,.3); background: rgba(196,23,23,.06); }
html.light .cm-vlink:hover, html.light .cm-lnk:hover { color: #c2410c; }
html.light .cm-strip .ws-kpi:hover { border-color: rgba(0,0,0,.1); }
html.light .cm-line.is-void td { opacity: .55; }

@media (max-width: 900px) {
    .cm-rollups { grid-template-columns: 1fr; }
    .cm-money { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .cm-bar-r { width: 100%; }
    .cm-sel { flex: 1; min-width: 0; max-width: none; }
    .cm-li-acts { margin-left: 0; width: 100%; }
}
