/* u97-work-groups-ui — connected entities: the chip, Clients → Connected entities, the group page (.wcg-* only). Cobalt Paper tokens. */

/* the chip: group name and how many clients are in it */
.wcg-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 240px; height: 20px; padding: 0 4px 0 7px; margin-left: 6px; border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font: 500 12px/18px var(--font-body); cursor: pointer; vertical-align: middle; white-space: nowrap; }
.wcg-chip .ti { font-size: 13px; }
.wcg-chip span { overflow: hidden; text-overflow: ellipsis; }
.wcg-chip b { min-width: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; line-height: 16px; }
.wcg-chip:hover, .wcg-chip:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .18); }
.w3-title .wcg-chip { height: 24px; font-size: 13px; margin-left: 10px; }
.wcg-cpslot { display: inline-flex; align-items: center; margin-left: 10px; }
.wcg-cpslot .btn-link { font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.wk-table td .wcg-chip { margin-left: 8px; }

/* Clients view: the tab row, and the list with a group's clients together */
.wcg-tabs { margin: 0 0 14px; }
#view-orgs.wcg-on #orgsList, #view-orgs.wcg-on #orgBulkBar, #view-orgs.wcg-on #orgSheetOut { display: none; }
.wcg-together { margin-left: 4px; white-space: nowrap; }
tr.wcg-ghead td { background: var(--bg); font-size: 13px; padding-top: 8px; padding-bottom: 8px; border-top: 1px solid var(--border-2); }
tr.wcg-ghead td .ti { color: var(--accent); margin-right: 2px; }
tr.wcg-ghead .btn-link { margin-left: 8px; font-size: 12px; }
tr[data-wcgin] > td:first-child { box-shadow: inset 3px 0 0 var(--accent-line); }

/* Clients → Connected entities */
.wcg { display: flex; flex-direction: column; gap: 12px; }
.wcg .w3-note { margin: 0; }
.wcg .w3-card + .w3-card { margin-top: 0; }
#wcgBody { display: flex; flex-direction: column; gap: 12px; }
.wcg-stats { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 14px; }
.wcg .wcg-stats { margin-bottom: 0; }
.wcg-stat { flex: 1 1 150px; padding: 12px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wcg-stat:last-child { border-right: 0; }
.wcg-stat.is-person { flex: 2.2 1 300px; }
.wcg-stat-l { font-size: 12px; color: var(--ink-3); }
.wcg-stat.is-main .wcg-stat-l { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--amber); }
.wcg-stat-n { font-family: var(--font-display); font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.wcg-stat-n small { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--ink-3); }
.wcg-stat-n.is-late { color: var(--red); }
.wcg-stat-p { font-family: var(--font-display); font-size: 18px; line-height: 1.3; color: var(--text); }
.wcg-stat-s { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcg-tabrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wcg-table td, .wcg-table th { vertical-align: middle; }
.wcg-table .wcg-c-inc { width: 64px; text-align: center; }
.wcg-table tr.is-off td:not(.wcg-c-inc) { color: var(--ink-4); }
.wcg-table tr.is-off td b { font-weight: 500; }
.wcg-table .wcg-why { color: var(--text-2); font-size: 13px; }
.wcg-click { cursor: pointer; }
.wcg-click:hover td { background: var(--bg); }
.wcg-sug .w3-card-h { gap: 6px 8px; }
.wcg-sug .w3-card-h h3 { font-weight: 600; margin-right: 6px; }
.wcg-sug .w3-card-h h3 b { font-weight: 700; }
.wcg-foot { padding: 10px 16px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.wcg-foot:empty { display: none; }
.wcg-foot-row { display: flex; align-items: flex-end; gap: 10px 12px; flex-wrap: wrap; }
.wcg-foot .w3-field { margin: 0; }
.wcg-foot .wcg-f-name { flex: 1 1 240px; max-width: 320px; }
.wcg-foot .wcg-f-main { flex: 1 1 200px; max-width: 280px; }
.wcg-foot .w3-field input, .wcg-foot .w3-field select { height: 30px; }
.wcg-splitnote { color: var(--amber); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.wcg-footnote { font-size: 12px; color: var(--ink-4); }
.wcg-msg { font-size: 13px; color: var(--amber); font-weight: 500; }
.wcg-when { color: var(--ink-3); font-size: 12px; }
.wcg-when.is-late { color: var(--red); }

/* dialogs */
.wcg-picklist { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); margin: 8px 0; background: var(--surface); }
.wcg-pickrow { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.wcg-pickrow:last-child { border-bottom: 0; }
.wcg-pickrow > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcg-pickrow.is-off { cursor: default; color: var(--ink-4); }
.wcg-pickrow input { margin: 0; }
.wcg-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; min-height: 24px; }
.wcg-picked .w3-label { margin: 0 4px 0 0; }
.wcg-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.wcg-or { text-align: center; font-size: 12px; color: var(--ink-4); margin: 10px 0 0; }
.wcg-danger { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.wcg-inline { display: flex; align-items: center; gap: 8px; }
.wcg-inline select { flex: 1; min-width: 0; }
.wcg-inline .w3-help { flex: 1; margin: 0; }
.wcg-preview { margin-top: 8px; }
.wcg-prevrow { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.wcg-prevrow b { flex: 0 0 44%; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcg-prevrow span { color: var(--text-2); }
.wcg-hist { max-height: 420px; overflow: auto; }
.wcg-hist-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* the group page (same frame as the client page) */
#groupPage.conv-page { left: 240px; background: var(--bg); }
#groupPage .conv-inner { background: var(--bg); }
#groupPage .cv-column { max-width: none; margin: 0; padding: 0 28px 48px; }
#groupPage .cv-column > *:not(.topbar) { max-width: 1240px; }
#groupPage .topbar { position: sticky; top: 0; z-index: 20; margin: 0 -28px 18px; }
#groupPage .w3-note { margin-bottom: 14px; }
#groupPage .w3-card + .w3-card { margin-top: 14px; }
#groupPage .w3-card-h .w3-sub { font-size: 12px; color: var(--ink-3); }
@media (max-width: 1300px) { #groupPage .cv-column { padding: 0 20px 40px; } #groupPage .topbar { margin: 0 -20px 16px; padding: 10px 20px; } }
@media (max-width: 900px) {
  #groupPage.conv-page { left: 0; }
  #groupPage .cv-column { padding: 0 12px 32px; } #groupPage .topbar { margin: 0 -12px 12px; padding: 8px 12px; }
  .wcg-stat { flex: 1 1 45%; border-right: 0; border-bottom: 1px solid var(--border); }
  .wcg-foot .wcg-f-name, .wcg-foot .wcg-f-main { max-width: none; flex: 1 1 100%; }
  .wcg-chip { max-width: 170px; }
}

/* the client's name and its chip on one line in the tables (the name is a block by default) */
.w3-cell-main > b:has(+ .wcg-chip) { display: inline-block; max-width: calc(100% - 150px); vertical-align: middle; }
.w3-cell-main > .wcg-chip { margin-left: 6px; }

/* u111-connected-extras-ui: Add entity, not in Work yet, not our client */
.pill.wcg-niw { background: #fff4e0; color: #8a5a00; }
.pill.wcg-ext-pill { background: var(--sunken, #f1f2f6); color: var(--ink-3, #666); }
.wcg-ext-row td { color: var(--ink-3, #666); }
.wcg-ext { margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--sunken, #f6f7fa); }
.wcg-ext-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; margin-top: 6px; }
.wcg-ext-grid input, .wcg-ext-grid select { margin: 0; width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .wcg-ext-grid { grid-template-columns: 1fr; } }
