/* Clients area: pipeline board, opportunity dialog, scoping summary, history and small helpers. Tokens from styles.css. */

.badge.cl-warn { color: var(--warn); border-color: #6b5a39; }
.badge.cl-bad { color: var(--bad); border-color: #774153; }
.cl-h { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.cl-flags { flex: none; gap: 4px; }
.cl-list .list-row.as-link { padding: 12px 4px; }
.cl-calm { justify-content: space-between; flex-wrap: wrap; }
.stat.cl-money strong { font-size: 1.35rem; line-height: 1.5; }

/* Upload control (document type + button) */
.cl-upload { flex-wrap: nowrap; gap: 8px; }
.cl-upload select { width: auto; min-width: 130px; min-height: 42px; padding: 8px 10px; font-size: .88rem; }

/* Pipeline: one row of stages that scrolls sideways when it does not fit */
.kanban.cl-pipe { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.cl-pipe .kcol { padding: 12px 10px; gap: 8px; }
.cl-pipe .kcol-head h3 { font-size: .8rem; }
.cl-pipe .kcol-sum { min-height: 1.4em; color: var(--muted); font: 11px/1.4 var(--mono); }
.cl-pipe .kcol-discovery .kcol-head, .cl-pipe .kcol-qualified .kcol-head, .cl-pipe .kcol-scoping .kcol-head { border-top-color: var(--accent); }
.cl-pipe .kcol-proposal-sent .kcol-head, .cl-pipe .kcol-negotiation .kcol-head { border-top-color: var(--warn); }
.cl-pipe .kcol-won .kcol-head { border-top-color: var(--good); }
.cl-pipe .kcol-lost .kcol-head { border-top-color: var(--bad); }
.cl-pipe .kcard { padding: 9px 10px; gap: 5px; }
.cl-pipe .kcard-title { font-size: .84rem; }
.cl-pipe .kcard-meta { flex-wrap: wrap; gap: 6px; min-height: 32px; }
.cl-card-client { color: var(--muted); font-size: .75rem; }
.cl-card-money { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .82rem; }
.cl-card-money span { color: var(--muted); font: 11px var(--mono); white-space: nowrap; }

/* Opportunity dialog. infoModal wraps its content in a div (only `dialog > form` gets the scrolling layout), so give these info dialogs the same layout. */
dialog > .modal-form:has(.cl-opp, .cl-cmp) { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.cl-opp { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.cl-opp .fx-block .panel-head { min-height: 34px; }
.cl-rows .list-row { flex-wrap: wrap; row-gap: 8px; }
.cl-rows .list-main { min-width: min(220px, 100%); }
.cl-row-actions { gap: 4px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.dtable .cl-row-actions { flex-wrap: nowrap; }

/* Merge and comparison dialogs */
.cl-merge { display: flex; flex-direction: column; gap: 16px; padding-bottom: 6px; }
.cl-cmp { margin-top: 16px; }
.cl-cmp-body { display: flex; flex-direction: column; gap: 12px; }
.cl-cmp-grid .fx-section h3 { display: flex; align-items: center; gap: 8px; }
.cl-cmp-grid .list-row { padding: 9px 2px; }

/* Scoping questionnaire summary */
.cl-scope-sum { margin-bottom: 16px; padding: 12px 16px; }

/* History */
.timeline.cl-history { gap: 14px; }
.cl-history .tl-day { gap: 6px; }
.cl-history .tl-row { align-items: flex-start; padding: 9px 12px; color: var(--ink); text-decoration: none; }
.cl-history div.tl-row:hover { border-color: var(--line); }
.cl-history .tl-time { width: 58px; }
.cl-history .list-main b .ico { color: var(--accent); margin-right: 2px; }
.cl-ev-won .list-main b .ico, .cl-ev-end .list-main b .ico { color: var(--good); }
.cl-ev-lost .list-main b .ico { color: var(--bad); }
.cl-ev-report .list-main b .ico { color: var(--violet); }

@media (max-width: 900px) {
  .kanban.cl-pipe { grid-auto-columns: minmax(230px, 80%); scroll-snap-type: x mandatory; }
}
@media (max-width: 720px) {
  .cl-rows .cl-row-actions { width: 100%; margin-left: -10px; justify-content: flex-start; }
  dialog > .modal-form:has(.cl-opp) .modal-foot .btn { flex: 1 1 auto; }
  .cl-upload { flex-wrap: wrap; }
  .cl-upload select { flex: 1; }
  .cl-history .tl-row { gap: 10px; }
  .cl-history .tl-time { width: 48px; }
}
