/* Business tab (js/business.js): this month's sales calls from Calendly.
   The stat row reuses the Revenue dashboard's tiles (.rev-kpis, .rev-stat);
   what's here is the month header, the two tables and the change list. */

.biz-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.biz-month { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.biz-month h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; color: var(--ink); }
.biz-now {
  display: inline-block; margin-left: 6px; vertical-align: 3px;
  background: var(--blue-bg); color: var(--blue); border-radius: 999px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.biz-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 18px; line-height: 1;
  text-decoration: none;
}
.biz-step:hover { background: var(--grey-bg); }
.biz-step.is-off { color: var(--tick); cursor: default; }
.biz-step.is-off:hover { background: var(--surface); }
.biz-today { font-size: 12.5px; font-weight: 650; color: var(--blue); text-decoration: none; }
.biz-today:hover { text-decoration: underline; }
.biz-src { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.biz-refresh:disabled { opacity: .6; cursor: default; }
/* where the numbers stand: a saved copy paints first, then this says
   Calendly is being read until the fresh numbers land */
.biz-status { display: inline-flex; align-items: center; gap: 8px; line-height: 1.35; }
.biz-status b { color: var(--ink); font-weight: 650; }
.biz-status.is-busy {
  background: var(--blue-bg); color: var(--blue); border-radius: 999px; padding: 5px 12px 5px 10px;
}
.biz-status.is-busy b { color: var(--blue); }
.biz-status.is-stale b { color: var(--amber); }
.biz-dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.biz-status.is-stale .biz-dot-ok { background: var(--amber); }
.biz-spin {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: bizSpin .8s linear infinite;
}
@keyframes bizSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .biz-spin { animation: none; border-right-color: currentColor; opacity: .6; } }

.biz-warn {
  background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber);
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px;
}

.biz-blank { padding: 26px 24px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.biz-blank h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.biz-blank p + p, .biz-blank ol + p { margin-top: 8px; }
.biz-blank ol { margin: 8px 0 0 20px; }
.biz-blank li + li { margin-top: 4px; }
.biz-blank code { background: var(--grey-bg); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

/* a grid cell may shrink below its table's width: the table scrolls
   inside its card (.tbl-wrap) instead of widening the page */
.biz-tables > .card { min-width: 0; }

.biz-tbl th.num, .biz-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.biz-tbl td.num { white-space: nowrap; }   /* a number and its % stay on one line */
.biz-tbl td.biz-name { font-weight: 650; color: var(--ink); white-space: nowrap; }

.biz-acts { padding: 4px 16px; }
.biz-act {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted);
}
.biz-act:last-child { border-bottom: none; }
.biz-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transform: translateY(-1px); }
.biz-dot-booked { background: var(--green); }
.biz-dot-cancelled { background: var(--red); }
.biz-dot-rescheduled { background: var(--amber); }
.biz-dot-noshow { background: var(--purple); }
.biz-act-main { min-width: 0; }
.biz-act-name { font-weight: 700; color: var(--ink); }
.biz-act-main b { color: var(--ink); font-weight: 650; }
.biz-act-link { color: var(--faint); white-space: nowrap; }
.biz-reason { display: block; margin-top: 3px; font-style: italic; color: var(--muted); overflow-wrap: anywhere; }
.biz-act-at { font-size: 12px; color: var(--faint); white-space: nowrap; }
.biz-foot { padding-top: 0; }
.biz-note { margin: 4px 2px 20px; line-height: 1.5; }

/* ---- the top: the funnel beside three supporting tiles ---- */
.biz-funnel .card-body { padding: 8px 18px 14px; }
.biz-fstep {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px 190px; gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.biz-fstep:last-child { border-bottom: none; }
.biz-flabel { font-size: 13px; font-weight: 650; color: var(--ink); }
.biz-ftrack { height: 14px; background: var(--grey-bg); border-radius: 4px; overflow: hidden; }
.biz-fbar { height: 100%; background: var(--blue); border-radius: 4px; }
.biz-fstep:first-child .biz-fbar { background: #8fa9dc; }
.biz-fnum { font-size: 22px; font-weight: 700; color: var(--ink); text-align: right; letter-spacing: -.3px; }
.biz-frate { font-size: 12px; color: var(--muted); line-height: 1.35; }
.biz-frate b { color: var(--ink); font-size: 13px; }
.biz-frate span { display: block; color: var(--faint); }
.biz-fstep.is-off .biz-flabel, .biz-fstep.is-off .biz-fnum { color: var(--faint); }


/* ---- two cards side by side ---- */
.biz-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.biz-row > .card { min-width: 0; }
.biz-row.biz-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* two tables side by side */
/* close rate by booking answer: one card at the foot of the page, folded
   to its title; opened, small tables side by side */
.biz-fold {
  display: flex; align-items: baseline; gap: 10px; width: 100%; flex-wrap: wrap;
  font: inherit; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 13px 16px; color: var(--ink); border-radius: inherit;
}
.biz-fold:hover { background: var(--grey-bg); }
.biz-fold:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.biz-fold-chev { width: 10px; color: var(--muted); font-size: 12px; }
.biz-fold-title { font-size: 14px; font-weight: 700; }
.biz-fold-act { margin-left: auto; font-size: 12.5px; font-weight: 650; color: var(--blue); }
.biz-qs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 22px;
  align-items: start; border-top: 1px solid var(--line-soft); padding: 12px 16px 14px;
}
.biz-q { min-width: 0; }
.biz-q-head { font-size: 12.5px; font-weight: 650; color: var(--ink); line-height: 1.35; margin-bottom: 4px; }
.biz-q-head .faint { font-weight: 500; margin-left: 4px; }
.biz-q .tbl th, .biz-q .tbl td { padding: 4px 6px; font-size: 12px; }
.biz-q .tbl th:first-child, .biz-q .tbl td:first-child { padding-left: 0; }
.biz-q .tbl th:last-child, .biz-q .tbl td:last-child { padding-right: 0; }
.biz-q td.biz-name { font-weight: 500; }
.biz-q td.biz-name { white-space: normal; }   /* a long answer wraps rather than pushing the numbers off */
.biz-rate { font-weight: 700; color: var(--ink); }
.biz-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.biz-pitch { display: flex; flex-direction: column; gap: 2px; }
.biz-pitchk { display: inline-block; min-width: 3.6em; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.biz-of { display: inline-block; min-width: 38px; margin-left: 8px; font-size: 11.5px; color: var(--faint); text-align: right; }

/* ---- the masterclass bar ---- */
.biz-mcbar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: 4px 0 12px; }
.biz-mcseg { height: 100%; }
.biz-mc-yes { background: var(--green); }
.biz-mc-uncertain { background: #c3ccd8; }
.biz-mc-no { background: var(--red); }
.biz-mcrow { display: grid; grid-template-columns: 10px 1fr 32px 110px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.biz-mcdot { width: 8px; height: 8px; border-radius: 50%; }
.biz-mclabel { color: var(--ink); }
.biz-mcn { font-weight: 700; color: var(--ink); text-align: right; }
.biz-mcclose { color: var(--muted); font-size: 12px; text-align: right; }

/* ---- call by call ---- */
.biz-calls .card-head { flex-wrap: wrap; }
.biz-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.biz-chip {
  font: inherit; font-size: 12px; font-weight: 650; color: var(--muted); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px;
}
.biz-chip span { color: var(--faint); font-weight: 600; margin-left: 2px; }
.biz-chip:hover { background: var(--grey-bg); }
.biz-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.biz-chip.on span { color: rgba(255, 255, 255, .7); }
.biz-calltbl td { vertical-align: middle; }
.biz-pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.biz-pill-ok { background: var(--green-bg); color: var(--green); }
.biz-pill-bad { background: var(--red-bg); color: var(--red); }
.biz-pill-up { background: var(--blue-bg); color: var(--blue); }
.biz-pill-mid { background: var(--grey-bg); color: var(--muted); }
/* a verdict the team can correct: the pill is a native select */
.biz-pickwrap { position: relative; display: inline-block; }
.biz-pickwrap::after { content: ""; position: absolute; right: 8px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; pointer-events: none; opacity: .7; }
.biz-pick { appearance: none; -webkit-appearance: none; border: 0; font: inherit; font-size: 11.5px; font-weight: 700; padding-right: 22px; cursor: pointer; line-height: 1.5; }
.biz-pickwrap:has(.biz-pill-ok) { color: var(--green); }
.biz-pickwrap:has(.biz-pill-bad) { color: var(--red); }
.biz-pickwrap:has(.biz-pill-mid) { color: var(--muted); }
.biz-pick:hover { filter: brightness(.96); }
.biz-pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.biz-mccell { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 520px; }
.biz-quote { font-size: 12px; font-style: italic; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.biz-when, .biz-link { white-space: nowrap; color: var(--muted); }
.biz-closed { display: inline-block; margin-left: 6px; background: var(--green-bg); color: var(--green); border-radius: 4px; padding: 1px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; vertical-align: 1px; }
/* ---- new clients closed ---- */
/* folded to its title at the foot of the page; opened, the grouping chips sit beside the title */
.biz-closes-head { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.biz-closes-head .biz-fold { flex: 1 1 320px; width: auto; }
.biz-closes-head .biz-chips { padding: 0 16px 0 0; }
.biz-closes-head .biz-fold:hover { background: none; }
.biz-closes-head:has(.biz-fold:hover) { background: var(--grey-bg); border-radius: inherit; }
.biz-closes #biz-closes-body { border-top: 1px solid var(--line-soft); }
/* a closer's name in By closer jumps to her closes; her group lights up for a moment */
.biz-tocloser { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.biz-tocloser:hover { color: var(--blue); text-decoration: underline solid; }
.biz-tocloser:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.biz-group.biz-lit th { animation: biz-lit 1.8s ease-out; }
@keyframes biz-lit { 0%, 35% { background: var(--blue-bg); } 100% { background: var(--grey-bg); } }
.biz-closetbl td { vertical-align: middle; }
/* a name on the roster opens her profile (closes, call by call, latest changes) */
.biz a.biz-who { color: inherit; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; }
.biz a.biz-who:hover { color: var(--blue); text-decoration: underline solid; }
/* the sales call a close came from, as plain text: its day, then its link in grey */
.biz-callday { white-space: nowrap; color: var(--ink); }
.biz-callday.biz-callbefore { color: var(--muted); }
.biz-callfrom { margin-left: 6px; color: var(--faint); white-space: nowrap; }
.biz-group th { text-align: left; text-transform: none; letter-spacing: 0; background: var(--grey-bg); font-size: 12.5px; font-weight: 700; color: var(--ink); padding-top: 7px; padding-bottom: 7px; }
.biz-group th span { margin-left: 6px; font-weight: 600; color: var(--muted); }
.biz-more { padding: 10px 16px 14px; text-align: center; border-top: 1px solid var(--line-soft); }

@media (max-width: 1100px) {
  .biz-row, .biz-row.biz-even { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .biz-fstep { grid-template-columns: 70px minmax(0, 1fr) 40px; row-gap: 4px; }
  .biz-frate { grid-column: 1 / -1; }
  .biz-link, .biz-quote { display: none; }
  /* phones keep pickers at 16px (no iOS zoom on tap), so the name wraps to
     leave the verdict room */
  .biz-calltbl td.biz-name { white-space: normal; min-width: 110px; }
  .biz-calltbl th, .biz-calltbl td { padding-left: 8px; padding-right: 8px; }
  .biz-head { align-items: flex-start; }
  .biz-month h2 { font-size: 17px; }
  .biz-src { width: 100%; justify-content: space-between; }
}
