/* Client monitoring (/agencies/monitoring/) in the painted theme (template-parts/painted/pages/agencies-monitoring.php):
   only what its windows alone draw, the client's replies with their channels, the AI SDR's Always to a person, the
   Sender profiles page on Needs attention and the Dashboard's Sender profiles card. The rows, the people, the chips, the
   strips and the buttons are the kit's, and so is the app at the agency's own address (assets/css/lines.css: .pp-card,
   .pp-person, .pp-who, .pp-btn, .ag-win). */

/* a card that only heads the window's list: its name and what it holds */
.pp-card.mon-hd { display: grid; gap: 3px; padding: 12px 14px; }
.mon-hd b { font-weight: 600; font-size: 14px; letter-spacing: -.01em; color: var(--ink); }
.mon-hd small { font-size: 12px; line-height: 1.4; color: var(--mute); text-wrap: pretty; }

/* 1. the client's replies: who and what, the channels its thread has, where it stands */
/* every row is a grid of its own, so the channels' column has a set width: one channel stands where a pair starts */
.pp-card.mon-rp > li { grid-template-columns: minmax(0, 1fr) 116px 136px; min-height: 54px; }
.mon-rp .pp-person small { max-width: 100%; }
.mon-chs { display: flex; justify-self: start; gap: 8px; }
.mon-ch { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 11.5px; line-height: 1; white-space: nowrap; }
.mon-ch::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.mon-li { color: #2F4FD8; }
.mon-li::before { background: #3D63F0; }
.mon-em { color: #B5530F; }
.mon-em::before { background: #E9781C; }
.mon-rp > li > .st { justify-self: start; }
.mon-rp .st svg.i { width: 12px; height: 12px; }

/* 2. the hand-offs that always go to a person, each switched on */
.pp-card.mon-hand > li { grid-template-columns: minmax(0, 1fr) max-content; gap: 14px; min-height: 40px; font-size: 13px; line-height: 1.35; }
.mon-tg { position: relative; flex: none; width: 30px; height: 18px; border-radius: 999px; background: var(--ink); background-image: var(--ink-tex); }
.mon-tg i { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

/* 3. the Sender profiles page: its filters with their counts, the profiles on Needs attention, the workflow's Who sends */
.mon-fl { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.mon-fl span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, .72); box-shadow: 0 1px 2px rgba(70, 50, 36, .08); font-weight: 600; font-size: 12.5px; color: var(--ink); white-space: nowrap; }
.mon-fl small { font: 600 10.5px/1 var(--mono); color: var(--mute); }
.mon-fl span.on { background-color: var(--ink); background-image: var(--ink-tex); color: #fff; box-shadow: none; }
.mon-fl span.on small { color: rgba(255, 255, 255, .7); }
.pp-card.mon-sp > li { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 128px; min-height: 62px; }
.mon-sp .pp-btn { justify-self: end; }
.mon-st { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.mon-st small { overflow: hidden; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; font-size: 11.5px; color: var(--mute); }
.pp-card.mon-wf { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.mon-wf .disc { width: 28px; height: 28px; background: var(--ct); color: var(--cd); }
.mon-wf .disc svg.i { width: 15px; height: 15px; }
.mon-wf > span:nth-child(2) { min-width: 0; }
.mon-wf b { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; color: var(--ink); }
.mon-wf small { display: block; font-size: 11.5px; line-height: 1.3; color: var(--mute); }
.mon-wf .st { margin-left: auto; }

/* 4. the Dashboard's Sender profiles card: today's meter, then the period's numbers */
.pp-card.mon-db > li { grid-template-columns: minmax(0, 1.25fr) minmax(52px, .8fr) minmax(0, .6fr) minmax(0, .6fr) minmax(0, .8fr) minmax(0, .6fr); gap: 12px; min-height: 48px; font-variant-numeric: tabular-nums; }
.mon-db > li > span:nth-child(n+3) { justify-self: end; font-weight: 600; }
.mon-db > li.pp-th { line-height: 1.35; }
.mon-db > li.pp-th > span:nth-child(n+3) { text-align: right; }
.mon-db > li > .mon-rate { color: var(--ai-d); }
.mon-m { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--sunk); box-shadow: inset 0 0 0 1px rgba(22, 22, 26, .06); overflow: hidden; }
.mon-m i { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 3px; background: var(--out); }

/* a narrower window: the replies' channels go, so the words and where each one stands keep their room */
@media (max-width: 1100px) {
  .pp-card.mon-rp > li { grid-template-columns: minmax(0, 1fr) 132px; }
  .mon-rp .mon-chs { display: none; }
  .pp-card.mon-rp > li.pp-th > span:nth-child(2) { display: none; }
  .pp-card.mon-db > li { grid-template-columns: minmax(0, 1.2fr) minmax(48px, .8fr) minmax(0, .6fr) minmax(0, .6fr) minmax(0, .8fr); }
  .mon-db > li > span:nth-child(6) { display: none; }
}

/* a phone: a sender profile's state under its name, the Dashboard on today, the replies and the rate */
@media (max-width: 760px) {
  .pp-card.mon-rp > li { grid-template-columns: minmax(0, 1fr) max-content; }
  .pp-card.mon-rp > li.pp-th > span:last-child { display: none; }
  .mon-fl span:last-child { display: none; }
  .pp-card.mon-sp > li { grid-template-columns: minmax(0, 1fr) max-content; padding: 10px 0; }
  .mon-sp .mon-st { grid-column: 1; grid-row: 2; margin-left: 33px; }
  .mon-sp .pp-btn { grid-row: 1; grid-column: 2; }
  .pp-card.mon-wf { flex-wrap: wrap; }
  .mon-wf .st { margin-left: 38px; }
  .pp-card.mon-db > li { grid-template-columns: minmax(0, 1.2fr) minmax(44px, .7fr) repeat(2, minmax(0, .6fr)); gap: 10px; }
  .mon-db > li > span:nth-child(3), .mon-db > li > span:nth-child(6) { display: none; }
}

/* ---------- the header's piece: the agency's round (template-parts/painted/pages/agencies-monitoring.php) ----------
   its clients along the window's top, each a click; the workspace picked shows what waits on the agency first, in three
   columns; under the window the morning without it and with it */
.mnh { display: grid; gap: 16px; text-align: left; }
.mnh-bar { gap: 14px; }
.mnh-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mnh-tabs::-webkit-scrollbar { display: none; }
.mnh-tabs button { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; border-radius: 10px; font: 600 13px/1 var(--sans); color: var(--ink); white-space: nowrap; cursor: pointer; transition: background-color .2s; }
.mnh-tabs button .av { width: 22px; height: 22px; border-radius: 6px; font-size: 8.5px; }
.mnh-tabs button[aria-pressed=true] { background: #fff; box-shadow: 0 1px 2px rgba(70, 50, 36, .1), 0 6px 14px -10px rgba(80, 52, 40, .45); }
.mnh-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.mnh-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, #D9880A 16%, #fff); font: 700 10.5px/1 var(--mono); color: #B45309; }
.mnh-n.mnh-att { background: #B45309; color: #fff; }
.mnh-ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ai-t); color: var(--ai-d); }
.mnh-ok svg.i { width: 11px; height: 11px; stroke-width: 2.8; }
.mnh-ws { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, .8fr); gap: 14px; }
.mnh-ws[hidden] { display: none; }
.mnh-col { display: flex; flex-direction: column; min-width: 0; }
.mnh-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 2px 8px; }
.mnh-h b { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.mnh-h span { font: 600 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.pp-card.mnh-list { margin: 0; }
.pp-card.mnh-list > li { grid-template-columns: minmax(0, 1fr) max-content; min-height: 60px; padding: 8px 0; }
.mnh-st { display: grid; justify-items: end; gap: 4px; }
.mnh-st small { font-size: 11px; color: var(--mute); white-space: nowrap; }
.pp-card.mnh-calm { display: flex; align-items: center; gap: 9px; margin: 0; padding: 14px; font-size: 13px; line-height: 1.4; color: var(--ink); }
.mnh-calm svg.i { flex: none; width: 16px; height: 16px; stroke-width: 2.4; color: var(--ai-d); }
.pp-btn.mnh-fix { align-self: flex-start; margin-top: 10px; }
.pp-card.mnh-today { margin: 0; }
.pp-card.mnh-today > li { grid-template-columns: minmax(0, 1fr) max-content; min-height: 42px; }
.mnh-today span { font-size: 12.5px; color: var(--mute); }
.mnh-today b { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--ink); }
.mnh-today b.mnh-rate { color: var(--ai-d); }
@media (max-width: 1100px) {
  .mnh-ws { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mnh-ws > .mnh-col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mnh-tabs .mnh-name { display: none; }
  .mnh-tabs button { padding: 0 8px 0 6px; }
  .mnh-ws { grid-template-columns: minmax(0, 1fr); }
}
