/* ==========================================================================
   admin/css/office-crm.css — THE CRM'S NEW SCREENS AND ITS PHONE (crm-3, 5 Nov 2026)

   The pipeline report (office.html#pipeline), Ask about clients (#ask),
   Today's jobs (today.html), and the CRM's targets on a phone.

   Every colour is an --o-* token, so the pro sheet, the dark side and the
   classic Office each draw it in their own set (office-pro.css,
   mode-switch.css): nothing here needs a dark twin.

   PLAIN BARS. A figure is said in words first; the bar beside it is only
   the shape, a thin track with a fill from the left, its data end rounded.
   Never a ring, a gauge, a spin or anything turned about a centre.
   ========================================================================== */

/* ── the pipeline report ─────────────────────────────────────────────────── */
#office .ofc-pipe__parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem 2.25rem;
  margin-top: 0.25rem;
}
@media (max-width: 75rem) { #office .ofc-pipe__parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 48rem) { #office .ofc-pipe__parts { grid-template-columns: minmax(0, 1fr); } }
#office .ofc-pipe__h {
  margin: 0 0 0.75rem;
  font-size: var(--o-t-md);
  font-weight: 650;
  color: var(--o-text);
}
#office #ofc-pipe-stats .ofc-stat__n { font-variant-numeric: tabular-nums; }
#office #ofc-pipe-unknown { margin: 1.25rem 0 0; }

#office .ofc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
#office .ofc-bars__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
#office .ofc-bars__label { min-width: 0; font-size: var(--o-t-sm); font-weight: 600; color: var(--o-text); overflow-wrap: anywhere; }
#office .ofc-bars__n { flex: none; font-size: var(--o-t-sm); font-weight: 650; color: var(--o-text); font-variant-numeric: tabular-nums; }
#office .ofc-bars__track { height: 0.5rem; margin-top: 0.5rem; background: var(--o-inset); border-radius: 0 var(--tk-r-xs) var(--tk-r-xs) 0; overflow: hidden; }
#office .ofc-bars__fill {
  height: 100%;
  width: calc(var(--share, 0) * 100%);
  min-width: 2px;
  background: var(--o-text);
  border-radius: 0 var(--tk-r-xs) var(--tk-r-xs) 0;
}
#office .ofc-bars__fill.is-none { min-width: 0; }
#office .ofc-bars__sub { margin: 0.25rem 0 0; font-size: var(--o-t-xs); line-height: 1.45; color: var(--o-faint); }
#office .ofc-bars__empty { font-size: var(--o-t-sm); color: var(--o-faint); }

/* ── your stages ─────────────────────────────────────────────────────────── */
#office .ofc-stages { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.5rem; max-width: 46rem; }
#office .ofc-stages__row {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--o-line);
}
#office .ofc-stages__name { width: 100%; }
#office .ofc-stages__kind { font-size: var(--o-t-xs); color: var(--o-faint); }
#office .ofc-stages__acts { display: flex; gap: 0.5rem; justify-content: flex-end; }
#office .ofc-stages__add { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; margin-top: 1.25rem; }
#office .ofc-stages__add label { display: grid; gap: 0.25rem; font-size: var(--o-t-label, var(--o-t-sm)); font-weight: 600; color: var(--o-dim); }
#office .ofc-stages__msg { min-height: 1.4em; margin: 0.75rem 0 0; font-size: var(--o-t-sm); color: var(--o-dim); }
@media (max-width: 40rem) {
  #office .ofc-stages__row { grid-template-columns: minmax(0, 1fr) auto; }
  #office .ofc-stages__kind { grid-column: 1; grid-row: 2; }
  #office .ofc-stages__acts { grid-column: 2; grid-row: 1 / span 2; }
  #office .ofc-stages__add { display: grid; grid-template-columns: minmax(0, 1fr); }
}

/* ── ask about clients ───────────────────────────────────────────────────── */
#office .ofc-ask__form { display: flex; gap: 0.5rem; max-width: 46rem; }
#office .ofc-ask__box { flex: 1 1 auto; min-width: 0; }
#office .ofc-ask__try { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0; max-width: 60rem; }
#office .ofc-ask__list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 46rem; }
#office .ofc-ask__a { padding: 1rem 0 1rem; border-top: 1px solid var(--o-line); }
#office .ofc-ask__q { margin: 0; font-size: var(--o-t-sm); font-weight: 600; color: var(--o-dim); }
#office .ofc-ask__words { margin: 0.5rem 0 0; font-size: var(--o-t-lg); line-height: 1.5; color: var(--o-text); }
#office .ofc-ask__a.is-declined .ofc-ask__words { font-size: var(--o-t-md); color: var(--o-dim); }
#office .ofc-ask__from { margin-top: 0.75rem; }
#office .ofc-ask__from-h { margin: 0 0 0.5rem; font-size: var(--o-t-xs); font-weight: 650; color: var(--o-faint); }
#office .ofc-ask__cites { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
#office .ofc-ask__cite {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--o-line-2);
  border-radius: var(--o-r-sm);
  font-size: var(--o-t-sm);
  font-weight: 600;
  color: var(--o-text);
  text-decoration: none;
}
#office .ofc-ask__cite:hover { background: var(--o-hover); }
#office .ofc-ask__cite:focus-visible { outline: 1px solid var(--focus-edge); outline-offset: 2px; }
#office .ofc-ask__all { margin-top: 0.5rem; }
#office .ofc-ask__how { margin: 0.5rem 0 0; font-size: var(--o-t-xs); color: var(--o-faint); }

/* ── today's jobs ────────────────────────────────────────────────────────── */
#office .tj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
#office .tj-head h2 { margin: 0; }
#office .tj-count { margin: 0; font-size: var(--o-t-sm); font-weight: 650; color: var(--o-dim); font-variant-numeric: tabular-nums; }
#office .tj-copy {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--o-r-sm);
  background: var(--o-warn-bg);
  color: var(--o-warn-ink);
  font-size: var(--o-t-sm);
  line-height: 1.45;
}
#office .tj-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
#office .tj-job {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--o-line);
}
#office .tj-job__when { margin: 0.75rem 0 0; font-size: var(--o-t-sm); font-weight: 600; color: var(--o-dim); font-variant-numeric: tabular-nums; }
#office .tj-job.is-late .tj-job__when { color: var(--o-warn-ink); }
#office .tj-job__main { min-width: 0; }
#office .tj-job__who {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--o-t-md);
  font-weight: 650;
  color: var(--o-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
#office .tj-job__who:hover { text-decoration: underline; }
#office .tj-job__what { margin: 0; font-size: var(--o-t-sm); line-height: 1.45; color: var(--o-text); }
#office .tj-job__kind { margin: 0.25rem 0 0; font-size: var(--o-t-xs); color: var(--o-faint); }
#office .tj-job__acts { display: flex; gap: 0.5rem; }
#office .tj-job__act { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; text-decoration: none; }
#office .tj-read { margin: 0.75rem 0 0; font-size: var(--o-t-xs); color: var(--o-faint); }
@media (max-width: 40rem) {
  #office .tj-job { grid-template-columns: minmax(0, 1fr); }
  #office .tj-job__when { margin: 0; }
  #office .tj-job__acts { margin-top: 0.25rem; }
  #office .tj-job__act { flex: 1 1 0; }
}

/* ── the CRM on a phone: every target at least 44px ──────────────────────────
   The owner's bar (crm/mobile): "The whole CRM is usable at 390 px". Under
   40rem every control on the CRM's screens (Enquiries and a record opened
   there, Clients, the pipeline report, Ask, Today's jobs), the header's own
   and the stage picker's is at least 44px each way: a finger is not a
   pointer. A link inside a sentence stays the sentence's (WCAG 2.5.8's
   inline exception). tools/bars/crm-mobile.mjs walks the tasks and measures
   every one. On a desk nothing here applies. #office#office outranks the
   pro theme's own 36px header (office-pro.css), on a phone only. */
@media (max-width: 40rem) {
  #office#office :is(.ofc-top, .ofc-phonebar) :is(button, a[href], select),
  #office#office :is(.ofc-view[data-view="crm"], .ofc-view[data-view="clients"], .ofc-view[data-view="pipeline"], .ofc-view[data-view="ask"], .tj-view)
    :is(button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, [role="tab"], .ofc-q__act, a.ofc-linkish, .ofc-ask__cite, td a[href]),
  #office#office :is(#ofc-stagepick, .ofc-daypick) :is(button, a[href], input:not([type="hidden"]), select) {
    min-height: 44px;
  }
  #office#office :is(.ofc-top, .ofc-phonebar) :is(button, a[href]),
  #office#office :is(.ofc-view[data-view="crm"], .ofc-view[data-view="clients"], .ofc-view[data-view="pipeline"], .ofc-view[data-view="ask"], .tj-view) :is(button, [role="tab"], .ofc-q__act),
  #office#office :is(#ofc-stagepick, .ofc-daypick) button {
    min-width: 44px;
  }
  /* What is drawn small on a desk, a whole target here: the star, an action that is a link, a name in the list. */
  #office#office :is(.ofc-q__star, .ofc-lead__star) { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  #office#office :is(.ofc-view[data-view="crm"], .ofc-view[data-view="clients"]) :is(a.ofc-q__act, a.ofc-linkish, td a[href]) {
    display: inline-flex; align-items: center; justify-content: center;
  }
  #office#office .ofc-view[data-view="clients"] td a[href] { justify-content: flex-start; }
  #office#office .ofc-ask__form { flex-wrap: nowrap; }
  /* The light/dark switch in the phone bar: the same 52 x 28 pill, drawn inside a 60 x 44 target (mode-switch.css
     draws the pill on the button itself, so the button keeps its look only if the pill moves to a layer). */
  #office#office .ofc-phonebar .mode-switch--bar {
    position: relative; width: 60px; min-width: 60px; height: 44px; min-height: 44px; max-height: 44px; margin-right: -4px;
    background: transparent; box-shadow: none;
  }
  #office#office .ofc-phonebar .mode-switch--bar::before {
    content: ""; position: absolute; inset: 8px 4px; border-radius: var(--tk-r-pill);
    background: var(--tk-grey-1a); box-shadow: inset 0 0 0 1px var(--tk-white-a120);
  }
  #office#office .ofc-phonebar .mode-switch--bar .mode-switch__knob { top: 11px; left: 7px; }
  #office#office .ofc-phonebar .mode-switch--bar svg { top: 15px; }
  #office#office .ofc-phonebar .mode-switch--bar .mode-switch__sun { left: 11px; }
  #office#office .ofc-phonebar .mode-switch--bar .mode-switch__moon { right: 11px; }
}
