/* Sales Calls (web/calls.js). Everything under .cl, plus the .cl-shade drawer
   appended to <body>. Same design language as Schedule / Gantt. Tokens only. */

#main:has(> .cl) { max-width: none; }
.cl { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cl > * { min-width: 0; }
.cl-sub { color: var(--muted); font-size: .76rem; }
.cl-red { color: var(--crit); font-weight: 700; }
.cl-amber { color: var(--warn); font-weight: 600; }
.cl-nowrap { white-space: nowrap; }
.cl-err { color: var(--crit); font-weight: 600; }

.cl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cl-titles h1 { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; position: relative; padding-bottom: 9px; }
.cl-titles h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 3px; border-radius: 3px; background: var(--gradient); }
.cl-titles p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; max-width: 820px; line-height: 1.45; }
.cl-sync { font-size: .74rem; color: var(--muted); }

.cl-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cl-seg { display: inline-flex; gap: 4px; }
.cl-seg .is-on { background: var(--surface-3); }
.cl-sel { font: inherit; font-size: .84rem; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }

.cl-alarm { border: 1px solid var(--crit); background: var(--crit-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cl-alarm-h { font-weight: 800; color: var(--crit); }
.cl-alarm-row { text-align: left; font: inherit; font-size: .84rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.cl-alarm-row:hover { box-shadow: var(--shadow-hover); }
.cl-pill { margin-left: 8px; font-size: .68rem; font-weight: 700; color: var(--crit); border: 1px solid var(--crit); border-radius: 99px; padding: 1px 7px; white-space: nowrap; }

.cl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cl-kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 15px 16px 12px; text-align: left; font: inherit; color: inherit; }
.cl-kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); }
.cl-kpi.click { cursor: pointer; }
.cl-kpi.click:hover { box-shadow: var(--shadow-hover); }
.cl-kpi.t-crit::before { background: var(--crit); }
.cl-kpi.t-warn::before { background: var(--warn); }
.cl-kpi.t-crit .v { color: var(--crit); }
.cl-kpi .k { font-size: .63rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cl-kpi .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.cl-kpi .s { font-size: .74rem; color: var(--muted); margin-top: 2px; }

.cl-card { padding: 16px; }
.cl-scroll { overflow-x: auto; }
.cl table.report { width: 100%; font-size: .82rem; }
.cl table.report td, .cl table.report th { vertical-align: top; }
/* app.css keeps every report-grid cell on one line (right for the money grids); these
   tables carry sentences, so they wrap here. Dates keep .cl-nowrap. */
.cl table.report tbody td { white-space: normal; }
.cl table.report tbody td.cl-nowrap { white-space: nowrap; }
.cl tr.click { cursor: pointer; }
.cl tr.click:hover td { background: var(--surface-2); }
.cl tr.sev-red td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.cl tr.sev-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.cl-why { min-width: 260px; max-width: 460px; color: var(--ink-2); }
/* Long summaries: three lines in the table, the whole text on hover and in the drawer. */
.cl-why .cl-clip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.cl-chip { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.cl-chip.t-good { background: var(--good-soft); color: var(--good); }
.cl-chip.t-warn { background: var(--warn-soft); color: var(--warn); }
.cl-chip.t-crit { background: var(--crit); color: #fff; }
.cl-chip.t-neut { background: var(--surface-3); color: var(--ink-2); }
.cl-flag { display: inline-block; margin: 3px 4px 0 0; font-size: .66rem; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 99px; padding: 0 7px; white-space: nowrap; }

/* drawer */
.cl-shade { position: fixed; inset: 0; background: rgba(6, 33, 65, .35); z-index: 40; display: flex; justify-content: flex-end; }
.cl-drawer { width: min(760px, 100%); height: 100%; overflow-y: auto; background: var(--surface); color: var(--ink); padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 14px; border-top: 4px solid transparent; border-image: var(--gradient) 1; }
.cl-dh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cl-dh h3 { margin: 4px 0; font-size: 1.15rem; }
.cl-verdict { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.cl-verdict.t-crit { border-color: var(--crit); background: var(--crit-soft); }
.cl-verdict.t-warn { background: var(--warn-soft); border-color: transparent; }
.cl-verdict.t-good { background: var(--good-soft); border-color: transparent; }
.cl-verdict p { margin: 8px 0 0; font-size: .88rem; }
.cl-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.cl-fact { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }
.cl-fact span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.cl-tl { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cl-tl-slot { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); opacity: .7; margin-left: 140px; max-width: calc(100% - 150px); }
.cl-tl-row { position: relative; display: flex; align-items: center; gap: 8px; font-size: .74rem; }
.cl-tl-n { width: 132px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-tl-bar { position: relative; flex: 1; height: 12px; background: var(--surface-2); border-radius: 6px; }
.cl-tl-bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--muted); }
.cl-tl-row.k-in .cl-tl-bar i, .cl-tl-legend .k-in::before { background: var(--accent-2); }
.cl-tl-row.k-ex .cl-tl-bar i, .cl-tl-legend .k-ex::before { background: var(--warn); }
.cl-tl-row.k-bot .cl-tl-bar i, .cl-tl-legend .k-bot::before { background: var(--line-strong); }
.cl-tl-legend { position: relative; display: flex; gap: 14px; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.cl-tl-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.cl-ai h4, .cl-ov h4 { margin: 0 0 6px; }
.cl-ai p, .cl-ai li { font-size: .86rem; line-height: 1.45; }
.cl-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 8px 0; }
.cl-score { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .8rem; }
.cl-score span { text-transform: capitalize; }
.cl-score em { grid-column: 1 / -1; color: var(--muted); font-size: .74rem; }
.cl-tx summary { cursor: pointer; font-weight: 700; }
.cl-tx p { margin: 4px 0; font-size: .82rem; line-height: 1.4; }
.cl-tx p.ex b { color: var(--warn); }
.cl-tx p.in b { color: var(--accent-2); }
.cl-ov { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cl-note { font: inherit; font-size: .86rem; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px; background: var(--surface); color: var(--ink); }
.cl-hist { font-size: .76rem; color: var(--muted); padding-left: 18px; }

@media (max-width: 640px) {
  .cl-tl-n { width: 84px; }
  .cl-tl-slot { margin-left: 92px; max-width: calc(100% - 100px); }
  .cl-sel, .cl-note { font-size: 16px; }
}

/* tabs (Scheduled calls | Phone calls) */
.cl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.cl-tab { font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px 9px; cursor: pointer; margin-bottom: -1px; }
.cl-tab:hover { color: var(--ink); }
.cl-tab.is-on { color: var(--ink); border-bottom-color: var(--accent-2); }

/* Phone calls tab (web/calls_phone.js) */
.cl td.clp-good { background: var(--good-soft); }
.cl td.clp-mid { background: var(--warn-soft); }
.cl td.clp-bad { background: var(--crit-soft); }
.clp-flags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.clp-flag { text-align: left; font: inherit; font-size: .84rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--crit); border-radius: 8px; padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.clp-flag:hover { box-shadow: var(--shadow-hover); }
.clp-flag.is-pricing { border-left-color: var(--warn); }
.clp-flagtabs { margin: 0 0 6px; }

/* recording + transcript (clMediaSlot / clTranscript) */
.cl-media { display: flex; flex-direction: column; gap: 8px; }
.cl-media-row { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; }
.cl-media audio { width: 100%; }
.cl-media video { width: 100%; max-height: 360px; border-radius: 10px; background: #000; }
.cl-txbar { display: flex; gap: 10px; align-items: center; margin: 8px 0 4px; }
.cl-txq { flex: 1; min-width: 0; }
.cl-tx p.cl-line { display: grid; grid-template-columns: 44px 1fr; column-gap: 6px; margin: 0; padding: 4px 6px; border-radius: 6px; }
.cl-tx p.cl-line[title]:not([title=""]) { cursor: pointer; }
.cl-tx p.cl-line[title]:not([title=""]):hover { background: var(--surface-2); }
.cl-ts { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; padding-top: 2px; }

/* GHL visibility (web/calls_crm.js) + the GHL line in both drawers */
.clc-ghl { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .84rem; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.clc-ghl.t-crit { background: var(--crit-soft); }
.clc-ghl.t-warn { background: var(--warn-soft); }
.clc-ghl a { margin-left: auto; font-weight: 600; }

/* Owner › Meetings & Transcripts (web/meetadmin.js) */
/* Source tag on each row: Teams meeting / GHL call / Quo call. A dot in the series colour on a light tint of it,
   text stays ink so it reads in both themes (series orange isn't text-safe on white). */
.ma-src { --src: var(--series-other); display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; line-height: 1.3;
  border-radius: 99px; padding: 2px 9px 2px 7px; white-space: nowrap; color: var(--ink);
  background: color-mix(in srgb, var(--src) 14%, transparent); border: 1px solid color-mix(in srgb, var(--src) 50%, transparent); }
.ma-src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--src); flex: none; }
.ma-src.s-teams { --src: var(--series-7); }
.ma-src.s-ghl { --src: var(--series-1); }
.ma-src.s-quo { --src: var(--series-2); }
.ma-srcseg .ma-src { margin: -2px 0; }
.cl-dh .ma-src { vertical-align: 1px; }
.ma-health { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.ma-health.t-good { background: var(--good-soft); border-color: transparent; }
.ma-health.t-warn { background: var(--warn-soft); border-color: transparent; }
.ma-health.t-crit { background: var(--crit-soft); border-color: var(--crit); }
.ma-health ul { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; }
.ma-health li.ma-crit { color: var(--crit); }
.ma-health li.ma-neut { color: var(--muted); }

/* ---------- Sales Calls layout (2026-10-14 redesign) ---------- */
.cl-head { align-items: flex-start; }
.cl-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.clh-pill { font: inherit; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: 5px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; }
.clh-pill.t-good { color: var(--good); background: var(--good-soft); border-color: transparent; }
.clh-pill.t-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.clh-pill.t-crit { color: var(--crit); background: var(--crit-soft); border-color: var(--crit); }
.cl-tabs { align-items: flex-end; }
.cl-repchip { margin-left: auto; align-self: center; font: inherit; font-size: .78rem; font-weight: 700; border: 1px solid var(--accent-2); color: var(--accent-2); background: var(--surface); border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.clo-n { margin-left: 6px; font-size: .7rem; color: var(--muted); font-weight: 600; }

/* Needs attention */
.clo-attn { display: flex; flex-direction: column; gap: 6px; }
.clo-attn-row { display: grid; grid-template-columns: auto auto auto 1fr; gap: 10px; align-items: center; text-align: left; font: inherit; font-size: .84rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.clo-attn-row.t-crit { border-left-color: var(--crit); }
.clo-attn-row:hover { box-shadow: var(--shadow-hover); }
.clo-attn-why { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Rep cards */
.clo-reps { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.clo-rep { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.clo-rep-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.clo-rep-h h2 { margin: 0; font-size: 1.05rem; }
.clo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.clo-stat { background: var(--surface-2); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; }
.clo-stat span { font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.clo-stat b { font-size: 1.15rem; }
.clo-stat em { font-style: normal; font-size: .7rem; color: var(--muted); }
.clo-stat.t-crit b { color: var(--crit); }
.clo-stat.t-warn b { color: var(--warn); }
.clo-stat.t-good b { color: var(--good); }
.clo-latest { display: flex; flex-direction: column; gap: 4px; }
.clo-mini { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 8px; align-items: center; text-align: left; font: inherit; font-size: .8rem; color: var(--ink);
  background: none; border: 0; border-top: 1px solid var(--line); padding: 7px 2px; cursor: pointer; }
.clo-mini:hover { background: var(--surface-2); }
.clo-mini-when { color: var(--muted); font-size: .74rem; }
.clo-mini-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--ink-2); }
.clo-mini-main b { color: var(--ink); }

/* Calls list */
.clo-list { padding: 4px 16px 16px; }
.clo-day { position: sticky; top: 0; z-index: 1; background: var(--surface); font-weight: 800; font-size: .86rem; padding: 14px 0 6px; border-bottom: 1px solid var(--line-strong); }
.clo-call { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 14px; width: 100%; text-align: left; font: inherit; color: var(--ink);
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 6px; cursor: pointer; }
.clo-call:hover { background: var(--surface-2); }
.clo-call.is-red { box-shadow: inset 3px 0 0 var(--crit); }
.clo-call.is-flag { box-shadow: inset 3px 0 0 var(--warn); }
.clo-when { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }
.clo-when span { color: var(--muted); font-size: .72rem; }
.clo-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.clo-who { font-size: .86rem; }
.clo-sum { font-size: .82rem; color: var(--ink-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.clo-score { font-size: .74rem; font-weight: 800; border-radius: 6px; padding: 1px 7px; }
.clo-score.clp-good { background: var(--good-soft); color: var(--good); }
.clo-score.clp-mid { background: var(--warn-soft); color: var(--warn); }
.clo-score.clp-bad { background: var(--crit-soft); color: var(--crit); }
.clo-flag { font-size: .68rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.clo-flag.is-red { color: var(--crit); border: 1px solid var(--crit); }
.clo-flag.is-amber { color: var(--warn); border: 1px solid var(--warn); }
.clo-more { margin: 14px auto 0; display: block; }
.clo-q { min-width: 240px; }

@media (max-width: 760px) {
  .cl-controls { justify-content: flex-start; }
  .clo-reps { grid-template-columns: 1fr; }
  .clo-call { grid-template-columns: 1fr; gap: 6px; }
  .clo-side { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .clo-attn-row { grid-template-columns: auto 1fr; }
  .clo-attn-why { grid-column: 1 / -1; white-space: normal; }
  .clo-mini { grid-template-columns: 44px 1fr auto; }
  .clo-mini .clo-score { display: none; }
}

/* Owner › Meetings & Transcripts › People (web/meetpeople.js, migration 137). */
.mp-note { margin: -2px 0 0; }
.mp-q { min-width: 180px; }
.mp-table th.mp-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.mp-table th.mp-sort.is-on { color: var(--ink); }
.cl table.report td.num, .cl-drawer table.report td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-row { cursor: pointer; }
.mp-row:hover td { background: var(--surface-2); }
.mp-zero td { color: var(--muted); }
.mp-tag { margin-left: 6px; font-size: .64rem; padding: 1px 6px; vertical-align: 1px; }
.mp-score { min-width: 34px; text-align: center; }
.mp-up { color: var(--good); }
.mp-down { color: var(--warn); }
.mp-trend { display: flex; gap: 3px; align-items: center; }
.mp-cell { width: 14px; height: 18px; border-radius: 3px; display: inline-block; }
.mp-cell.is-on { outline: 2px solid var(--ink); outline-offset: 1px; }
.mp-hl td { background: var(--surface-2); font-weight: 600; }
.mp-cell.is-partial { opacity: .45; }
