/* Pack 24: Chiropractic module. Tokens only.
   Breakpoints follow R5: 1279, 1023 and 767 px. */

/* period and filter bar under the tabs */
.c24-period { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: calc(-1 * var(--s2)) 0 var(--s4); }
.c24-period .filter { height: 34px; }
.c24-asof { font-size: 12px; color: var(--muted); margin-left: auto; }
@media (max-width: 767px) {
  .c24-period { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--s4)); padding-right: var(--s4); }
  .c24-period .filter { height: 40px; }
  .c24-asof { display: none; }
}

/* small explanatory notes under cards */
.c24-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.c24-note .icon { flex-shrink: 0; margin-top: 2px; }

/* compact figures inside a card */
.c24-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.c24-stat { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
a.c24-stat:hover { border-color: var(--primary-tint-2); background: var(--primary-tint); }
.c24-stat .lbl { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.c24-stat b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.2; }
.c24-stat small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 1023px) { a.c24-stat { min-height: var(--tap); } }

/* patient name link with a second line */
.c24-pl { display: grid; gap: 1px; min-width: 0; }
.c24-pl strong { font-size: 13.5px; color: var(--text); font-weight: 600; }
.c24-pl small { font-size: 12px; color: var(--muted); }
a.c24-pl:hover strong { color: var(--primary-ink); text-decoration: underline; }

/* visits completed against expected (plan pacing) */
.c24-pace { display: grid; gap: 4px; min-width: 120px; }
.c24-pace .track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-sunk); overflow: hidden; }
.c24-pace .exp { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--m-chiropractic) 22%, var(--surface)); }
.c24-pace .done { position: absolute; inset: 0 auto 0 0; background: var(--m-chiropractic); border-radius: 4px; }
.c24-pace .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c24-pace .t b { color: var(--text); }

/* cadence phases of a care plan */
.c24-phases { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.c24-phase { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 4px; background: var(--surface); min-width: 0; }
.c24-phase.on { border-color: var(--m-chiropractic); box-shadow: inset 0 3px 0 var(--m-chiropractic); }
.c24-phase.done { background: var(--surface-2); }
.c24-phase .k { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.c24-phase b { font-size: 14px; color: var(--text); }
.c24-phase small { font-size: 12px; color: var(--muted); }
@media (max-width: 767px) { .c24-phases { grid-auto-flow: row; } }

/* visit dots along a plan (completed, missed, upcoming) */
.c24-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.c24-dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-sunk); border: 1px solid var(--border); display: inline-block; }
.c24-dots i.done { background: var(--m-chiropractic); border-color: var(--m-chiropractic); }
.c24-dots i.miss { background: var(--bad-tint); border-color: var(--bad-line); }
.c24-dots i.re { box-shadow: 0 0 0 2px var(--primary); }
.c24-dots i.next { background: var(--surface); border: 2px dashed var(--m-chiropractic); }
.c24-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.c24-legend span { display: inline-flex; gap: 6px; align-items: center; }
.c24-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* retention and drop-off bars by visit number */
.c24-ret { display: grid; gap: 6px; }
.c24-ret a, .c24-ret > div { display: grid; grid-template-columns: 128px minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 4px; border-radius: 6px; }
.c24-ret a:hover { background: var(--surface-2); }
.c24-ret .bar { height: 12px; border-radius: 6px; background: var(--surface-sunk); overflow: hidden; }
.c24-ret .bar i { display: block; height: 100%; background: var(--c, var(--m-chiropractic)); border-radius: 6px; }
.c24-ret .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.c24-ret .v b { color: var(--text); }
@media (max-width: 1023px) { .c24-ret a { min-height: var(--tap); } }
@media (max-width: 767px) { .c24-ret a, .c24-ret > div { grid-template-columns: minmax(0, 1fr) auto; } .c24-ret .bar { grid-column: 1 / -1; order: 3; } }

/* definition box (PVA and other clinic-defined measures) */
.c24-def { border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.c24-def .f { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.c24-big { font-size: 34px; font-weight: 700; letter-spacing: -0.8px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }

/* today list on the dashboard */
.c24-day { display: grid; }
.c24-day a { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.c24-day a:last-child { border-bottom: 0; }
.c24-day .tm { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.c24-day strong { color: var(--text); font-weight: 600; display: block; }
.c24-day small { color: var(--muted); font-size: 12px; display: block; }
a.c24-day-i:hover strong { color: var(--primary-ink); }
@media (max-width: 1023px) { .c24-day a { min-height: var(--tap); } }

/* setup steps list */
.c24-steps { display: grid; gap: 0; }
.c24-steps a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.c24-steps a:last-child { border-bottom: 0; }
.c24-steps .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-sunk); color: var(--muted); }
.c24-steps .num.ok { background: var(--ok-tint); color: var(--ok-ink); }
.c24-steps .num.on { background: var(--primary); color: var(--on-primary); }
.c24-steps strong { display: block; font-size: 13.5px; color: var(--text); }
.c24-steps small { display: block; font-size: 12px; color: var(--muted); }
.c24-steps a.on { background: var(--primary-tint); border-radius: var(--r); }
@media (max-width: 1023px) { .c24-steps a { min-height: var(--tap); } }

/* feature switch rows in settings */
.c24-feat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.c24-feat:last-child { border-bottom: 0; }
.c24-feat strong { display: block; font-size: 13.5px; color: var(--text); }
.c24-feat small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.c24-feat .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* terminology editor rows */
.c24-term { display: grid; grid-template-columns: 200px minmax(0, 1fr) 160px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.c24-term:last-child { border-bottom: 0; }
.c24-term .key { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
@media (max-width: 1023px) { .c24-term { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* plan option cards in the report of findings */
.c24-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.c24-opt { border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; display: grid; gap: 8px; background: var(--surface); min-width: 0; }
.c24-opt.sel { border-color: var(--m-chiropractic); box-shadow: 0 0 0 2px color-mix(in srgb, var(--m-chiropractic) 25%, transparent); }
.c24-opt h3 { font-size: 14.5px; }
.c24-opt .price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c24-opt ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 3px; }

/* attention list on the dashboard */
.c24-att { display: grid; }
.c24-att a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.c24-att a:last-child { border-bottom: 0; }
.c24-att .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); }
.c24-att strong { display: block; font-size: 13.5px; color: var(--text); line-height: 1.35; }
.c24-att small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.c24-att a > .icon { color: var(--muted-2); margin-top: 8px; }
.c24-att a:hover strong { color: var(--primary-ink); }
@media (max-width: 1023px) { .c24-att a { min-height: var(--tap); } }

/* row actions in worklists */
.c24-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.c24-why { display: grid; gap: 2px; font-size: 12.5px; }
.c24-why b { color: var(--text); font-weight: 600; font-size: 13px; }
.c24-why small { color: var(--muted); font-size: 12px; }

/* money rows on the dashboard */
.c24-money { display: grid; }
.c24-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: center; }
.c24-mrow:hover { background: var(--surface-2); }
.c24-mrow .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.c24-mrow.total { border-bottom: 0; border-top: 2px solid var(--border-strong); }
@media (max-width: 1023px) { .c24-mrow { min-height: var(--tap); } }

/* setup: steps list on wide screens, stepper on phones */
.c24-mstep { display: none; margin-bottom: var(--s3); }
@media (max-width: 767px) { .c24-mstep { display: block; } .c24-dsteps { display: none; } }

/* keep stacked page sections inside the viewport when they hold wide tables */
body[data-page^="24-"] .main .stack { grid-template-columns: minmax(0, 1fr); }
