/* Cloud-Based Telephony dashboard.
 *
 * Phase 4C.36. The monolith's `<style>` block from website/cloud_telephony.html and the shared entity
 * picker's `<style>` block from website/partials/_entity_picker.html, taken at monolith commit
 * cb02cf0 with no selector, value or colour changed. The only additions are at the end and are
 * listed there: they exist because the Content Security Policy admits no style attribute and no
 * inline style element, so the monolith's were moved here.
 */
  :root { --cbt-border:#e6ebf1; --cbt-ink:#0f172a; --cbt-mut:#64748b; --cbt-soft:#94a3b8;
          --cbt-good:#15803d; --cbt-goodbg:#e8f6ec; --cbt-warn:#b45309; --cbt-warnbg:#fdf3e3;
          --cbt-bad:#b91c1c; --cbt-badbg:#fdeaea; --cbt-neutralbg:#eef1f6; }

  .cbt-attribution { background:#f6f8fc; border:1px solid var(--cbt-border); border-left:3px solid var(--theme); border-radius:8px; padding:14px 18px; font-size:13px; color:#4b5563; margin-bottom:24px; }

  /* Search */
  .cbt-search { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
  .cbt-search .fld { display:flex; flex-direction:column; gap:5px; flex:1; }
  .cbt-search .fld.tight { flex:0 0 auto; min-width:130px; }
  .cbt-search label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--cbt-mut); }
  .cbt-search input, .cbt-search select { padding:11px 14px; font-size:14px; border:1px solid #d1d9e0; border-radius:8px; color:var(--cbt-ink); min-width:130px; background:#fff; }
  .cbt-search .fld.wide { min-width:280px; }
  .cbt-search input:focus { outline:none; border-color:var(--theme); box-shadow:0 0 0 3px rgba(13,91,184,.08); }
  .cbt-btn { background:var(--theme); color:#fff; border:none; padding:11px 26px; border-radius:8px; font-weight:700; font-size:14px; cursor:pointer; white-space:nowrap; }
  .cbt-btn:hover { opacity:.92; }

  /* Cards & sections */
  .cbt-card { background:#fff; border:1px solid var(--cbt-border); border-radius:12px; padding:22px 24px; margin-bottom:18px; }
  .cbt-eyebrow { font-size:11px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; color:var(--theme); margin:0 0 3px; }
  .cbt-h { font-size:16px; font-weight:800; color:var(--cbt-ink); margin:0 0 18px; display:flex; align-items:center; gap:9px; }
  .cbt-h .ic { color:var(--theme); }
  .cbt-sub { color:var(--cbt-mut); font-size:12.5px; margin:-12px 0 16px; }

  /* Context header */
  .cbt-context { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:10px; border-bottom:1px solid var(--cbt-border); padding-bottom:16px; margin-bottom:18px; }
  .cbt-context h2 { font-size:22px; font-weight:800; color:var(--cbt-ink); margin:0; }
  .cbt-context .meta { color:var(--cbt-mut); font-size:13px; margin-top:4px; }
  .cbt-context .code { color:var(--cbt-soft); font-weight:600; font-size:14px; }

  /* Stat grid */
  .cbt-stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:14px; }
  .cbt-stat { border:1px solid var(--cbt-border); border-radius:10px; padding:15px 17px; }
  .cbt-stat .lbl { font-size:10.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--cbt-mut); }
  .cbt-stat .val { font-size:1.7rem; font-weight:800; color:var(--cbt-ink); line-height:1.15; margin-top:5px; }
  .cbt-stat .val.sm { font-size:1.15rem; }
  .cbt-stat .foot { font-size:11.5px; color:var(--cbt-soft); margin-top:5px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }

  /* Chips */
  .cbt-chip { font-size:11px; font-weight:700; border-radius:20px; padding:2px 9px; white-space:nowrap; }
  .cbt-chip.good { background:var(--cbt-goodbg); color:var(--cbt-good); }
  .cbt-chip.warn { background:var(--cbt-warnbg); color:var(--cbt-warn); }
  .cbt-chip.bad  { background:var(--cbt-badbg);  color:var(--cbt-bad);  }
  .cbt-chip.neutral { background:var(--cbt-neutralbg); color:var(--cbt-mut); }

  /* Performance line */
  .cbt-perf { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
  .cbt-perf .badge { font-size:1.05rem; font-weight:800; padding:6px 16px; border-radius:9px; }
  .cbt-perf .badge.good { background:var(--cbt-goodbg); color:var(--cbt-good); }
  .cbt-perf .badge.neutral { background:var(--cbt-neutralbg); color:var(--cbt-mut); }
  .cbt-perf .badge.bad { background:var(--cbt-badbg); color:var(--cbt-bad); }
  .cbt-perf .ranks { display:flex; gap:26px; flex-wrap:wrap; }
  .cbt-perf .ranks .lbl { font-size:10.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--cbt-mut); }
  .cbt-perf .ranks .v { font-size:1.25rem; font-weight:800; color:var(--cbt-ink); }
  .cbt-perf .ranks .x { font-size:11.5px; color:var(--cbt-soft); }

  /* Tabs */
  .cbt-tabs { display:flex; flex-wrap:wrap; gap:2px; border-bottom:2px solid var(--cbt-border); margin-bottom:20px; }
  .cbt-tab { background:none; border:none; padding:10px 16px; font-size:13px; font-weight:700; color:var(--cbt-mut); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; display:flex; align-items:center; gap:7px; }
  .cbt-tab:hover { color:var(--theme); }
  .cbt-tab.active { color:var(--theme); border-bottom-color:var(--theme); }
  .cbt-pane { display:none; }
  .cbt-pane.active { display:block; }

  /* Charts */
  .cbt-chartwrap { position:relative; min-height:280px; }

  /* Tables */
  .cbt-table { width:100%; border-collapse:collapse; font-size:13px; }
  .cbt-table th { text-align:left; font-size:10.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--cbt-mut); padding:9px 10px; border-bottom:2px solid var(--cbt-border); background:#fafbfd; }
  .cbt-table td { padding:9px 10px; border-bottom:1px solid #f1f4f8; }
  .cbt-table td.num, .cbt-table th.num { text-align:right; font-variant-numeric:tabular-nums; }
  .cbt-table tr.me { background:#f0f6ff; }
  .cbt-table tr.me td { font-weight:700; }
  .cbt-table .code { font-size:11px; color:var(--cbt-soft); }
  .cbt-pos { color:var(--cbt-good); font-weight:700; } .cbt-neg { color:var(--cbt-bad); font-weight:700; }
  .cbt-spacer td { text-align:center; color:var(--cbt-soft); font-size:11px; padding:6px; background:#fafbfd; }

  /* Funnel */
  .cbt-funnel-bar { display:flex; height:34px; border-radius:7px; overflow:hidden; margin:6px 0 14px; }
  .cbt-funnel-bar > span { display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:700; min-width:0; }
  .cbt-legend { display:flex; gap:18px; flex-wrap:wrap; font-size:12px; color:var(--cbt-mut); }
  .cbt-legend i { width:11px; height:11px; border-radius:3px; display:inline-block; margin-right:5px; }

  /* Heatmap */
  .cbt-heat { border-collapse:separate; border-spacing:3px; font-size:11px; width:100%; min-width:520px; table-layout:fixed; }
  .cbt-heat th { color:var(--cbt-mut); font-weight:700; font-size:10px; padding:2px 5px; text-align:center; }
  .cbt-heat th:first-child, .cbt-heat td.lbl { width:64px; }
  .cbt-heat td.lbl { color:var(--cbt-ink); font-weight:700; text-align:right; padding-right:8px; }
  .cbt-heat td.cell { height:30px; text-align:center; border-radius:4px; color:#1e293b; }
  .cbt-seg { display:inline-flex; border:1px solid var(--cbt-border); border-radius:8px; overflow:hidden; }
  .cbt-seg button { border:none; background:#fff; padding:6px 14px; font-size:12px; font-weight:700; color:var(--cbt-mut); cursor:pointer; }
  .cbt-seg button.active { background:var(--theme); color:#fff; }

  /* Insights */
  .cbt-insight { display:flex; gap:13px; border:1px solid var(--cbt-border); border-left-width:4px; border-radius:9px; padding:14px 16px; margin-bottom:11px; }
  .cbt-insight.good { border-left-color:var(--cbt-good); } .cbt-insight.warn { border-left-color:var(--cbt-warn); }
  .cbt-insight.bad  { border-left-color:var(--cbt-bad); }  .cbt-insight.info { border-left-color:var(--theme); }
  .cbt-insight .ic { font-size:1.1rem; margin-top:2px; }
  .cbt-insight.good .ic { color:var(--cbt-good); } .cbt-insight.warn .ic { color:var(--cbt-warn); }
  .cbt-insight.bad .ic { color:var(--cbt-bad); }   .cbt-insight.info .ic { color:var(--theme); }
  .cbt-insight .t { font-weight:800; color:var(--cbt-ink); font-size:13.5px; }
  .cbt-insight .d { color:var(--cbt-mut); font-size:13px; margin-top:2px; }

  .cbt-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  .cbt-muted { color:var(--cbt-soft); font-size:13px; }
  #cbt-error { background:var(--cbt-badbg); border:1px solid #f3c2c2; border-radius:8px; padding:12px 16px; font-size:13px; color:var(--cbt-bad); margin-bottom:20px; display:none; }

  /* Trends */
  .cbt-trend-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:18px; }
  .cbt-trend-cell { border:1px solid var(--cbt-border); border-radius:10px; padding:12px 14px; }
  .cbt-trend-cell .cbt-eyebrow { margin-bottom:6px; }
  .cbt-trend-cell .cbt-chartwrap { min-height:200px; }
  .cbt-summary-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:12px; }
  .cbt-sumcard { border:1px solid var(--cbt-border); border-radius:10px; padding:12px 14px; }
  .cbt-sumcard .lbl { font-size:10.5px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--cbt-mut); }
  .cbt-sumcard .val { font-size:22px; font-weight:800; color:var(--cbt-ink); margin-top:3px; }
  .cbt-sumcard .delta { font-size:12px; font-weight:700; margin-top:3px; }
  .cbt-sumcard .delta.good { color:var(--cbt-good); }
  .cbt-sumcard .delta.bad { color:var(--cbt-bad); }
  .cbt-sumcard .delta.neutral { color:var(--cbt-mut); }
  .cbt-sumcard .foot { font-size:11px; color:var(--cbt-soft); margin-top:2px; }
  .cbt-extremes { display:flex; flex-wrap:wrap; gap:14px; margin-top:14px; }
  .cbt-extreme { font-size:12.5px; color:var(--cbt-mut); }
  .cbt-extreme strong { color:var(--cbt-ink); }

  @media (max-width:820px){ .cbt-grid2, .cbt-trend-grid { grid-template-columns:1fr; } }
  @media (max-width:640px){ .cbt-search input { min-width:100%; } }

/* ── The shared entity picker (partials/_entity_picker.html) ── */
  .epick-chip { display:inline-flex; align-items:center; gap:10px; padding:10px 14px;
    background:#fff; border:1px solid #d1d9e0; border-radius:10px; font-size:14px;
    font-weight:600; color:#5a6b7b; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
  .epick-chip:hover { border-color:#b6c2cd; }
  .epick-chip.set { color:#1a2a3b; border-color:#16a085; }
  .epick-chip .epick-trigger-val { font-weight:700; }
  .epick-chip > i:last-child { color:#aab4be; font-size:12px; }

  .epick-modal { position:fixed; inset:0; z-index:100000; display:flex; align-items:flex-start; justify-content:center; }
  .epick-modal[hidden] { display:none; }
  .epick-backdrop { position:absolute; inset:0; background:rgba(15,30,42,.45); backdrop-filter:blur(2px); }
  .epick-box { position:relative; background:#fff; width:min(560px,92vw); margin-top:clamp(110px,16vh,200px);
    border-radius:14px; box-shadow:0 24px 60px rgba(0,0,0,.3); overflow:hidden; animation:epickPop .14s ease-out; }
  @keyframes epickPop { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:none; } }
  .epick-head { display:flex; align-items:center; gap:11px; padding:16px 18px; border-bottom:1px solid #eef1f4; }
  .epick-head > i { color:#16a085; }
  .epick-head span { font-size:15px; font-weight:800; color:#1a2a3b; flex:1; }
  .epick-head button { background:none; border:none; font-size:22px; line-height:1; color:#b6bfc8; cursor:pointer; }
  .epick-head button:hover { color:#1a2a3b; }
  .epick-search { display:flex; align-items:center; gap:10px; padding:14px 18px; }
  .epick-search i { color:#b6bfc8; }
  .epick-search input { flex:1; border:none; outline:none; font-size:16px; color:#1a2a3b; background:none; }
  .epick-hint { padding:0 18px 8px; font-size:11.5px; color:#9aa5b1; }
  .epick-results { max-height:46vh; overflow-y:auto; border-top:1px solid #f0f3f6; }
  .epick-item { display:flex; align-items:center; gap:12px; padding:11px 18px; cursor:pointer; border-bottom:1px solid #f5f7f9; }
  .epick-item:hover, .epick-item.active { background:#f0faf8; }
  .epick-item .epick-code { font-size:11px; font-weight:700; color:#16a085; min-width:62px; }
  .epick-item .epick-name { flex:1; font-size:13.5px; color:#1a2a3b; }
  .epick-item .epick-name .epick-sub { color:#9aa5b1; font-size:11.5px; font-weight:600; }
  .epick-item .epick-go { color:#cdd3da; font-size:12px; }
  .epick-item.active .epick-go { color:#16a085; }
  .epick-empty { padding:24px 18px; text-align:center; color:#b6bfc8; font-size:13px; }

/* ── Phase 4C.36: what the monolith's inline style="" attributes became ─────────────────────
   The Content Security Policy admits no style attribute, so each one the template carried is a
   class here, or (where it only hid an element the script later shows) an id rule, with the same
   declarations. */
  :root { --theme:#0d5bb8; }  /* the monolith site's --theme, which the shell does not define */
  .cbt-wrap { max-width:none; margin:0; padding:0; }
  .cbt-title { font-size:28px; font-weight:800; color:var(--cbt-ink); margin:0 0 16px; }
  .cbt-ico { width:1em; height:1em; vertical-align:-.125em; fill:none; stroke:currentColor; stroke-width:2;
    stroke-linecap:round; stroke-linejoin:round; flex:none; }
  .cbt-tab .cbt-ico { width:16px; height:16px; }
  .cbt-mt16 { margin-top:16px; }
  .cbt-mt12 { margin-top:12px; }
  .cbt-mt18 { margin-top:18px; }
  .cbt-mt14 { margin-top:14px; }
  .cbt-mt30 { margin-top:30px; }
  .cbt-mla { margin-left:auto; }
  .cbt-ml4 { margin-left:4px; }
  .cbt-mb16 { margin-bottom:16px; }
  .cbt-m0 { margin:0; }
  .cbt-ovx { overflow-x:auto; }
  .cbt-cursor { cursor:pointer; }
  .cbt-ink { color:var(--cbt-ink); }
  .cbt-bigicon { font-size:28px; color:#cbd5e1; }
  .cbt-bignum { font-size:2.6rem;font-weight:800; }
  .cbt-row12 { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
  .cbt-row10 { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
  #cbt-nat-core-card { display:none; }
  #cbt-need-practice { display:none; text-align:center; color:var(--cbt-mut); }
  #cbt-dashboard { display:none; }
  #compare-toggle-wrap { display:none; font-size:13px; font-weight:700; color:var(--cbt-mut); cursor:pointer; user-select:none; display:flex; align-items:center; gap:7px; }
  #improvement-composite-card { display:none; }
  #volatility-card { display:none; }
  #workforce-card { display:none; }
  #callback-card { display:none; }
  #workload-pred-card { display:none; }
  #morning-rush-card { display:none; }
  #mr-peak { display:none; margin-left:4px; }
  #core-hours-card { display:none; }
  #tod-bh-flag { display:none; margin-bottom:8px; }
  #patterns-unavailable { display:none; }
  #trend-velocity-card { display:none; }
  #anomalies-card { display:none; }
  #percentile-card { display:none; }
  #per1000-unavailable { display:none; }

/* Phase 4C.36: the monolith styled its Font Awesome `<i>` glyphs with `i` selectors. The icons here
   are inline SVG, so the same declarations apply to `svg`. */
.epick-chip > svg:last-child { color:#aab4be; font-size:12px; }
.epick-head > svg { color:#16a085; }
.epick-search svg { color:#b6bfc8; }
.epick-item .epick-go { width:12px; height:12px; }
.cbt-h .ic { width:1.1em; height:1.1em; }
.cbt-insight .ic .cbt-ico { width:1.1rem; height:1.1rem; }

/* ── Phase 4C.36: fitting the monolith's page inside this service's shell ──────────────────────
   The monolith's dashboard had the viewport to itself. Here a sidebar takes ~250px of it, so the
   viewport breakpoint the source chose (820px) fires too late: at 1024px the two-column chart
   grids no longer fit. These rules only move that breakpoint out by the sidebar's width and let
   grid children shrink; no colour, size or arrangement the source defines changes at any width the
   source defined it for. A table wider than its card scrolls inside the card, so the document
   itself never gains a horizontal scrollbar. */
.cbt-grid2 > *, .cbt-trend-grid > *, .cbt-stats > *, .cbt-summary-grid > * { min-width:0; }
div:has(> table.cbt-table) { overflow-x:auto; }
@media (max-width:1100px){ .cbt-grid2, .cbt-trend-grid { grid-template-columns:1fr; } }
