/* Pack 23: Podiatry module. Tokens only. Breakpoints 1279, 1023 and 767 px (R5). */

/* change against comparison period */
.pd-ok-ink { color: var(--ok-ink); font-weight: 600; }
.pd-bad-ink { color: var(--bad-ink); font-weight: 600; }

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

/* label and value rows; every value opens its records */
.pd-cls { display: grid; }
.pd-cl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.pd-cl:last-child { border-bottom: 0; }
a.pd-cl:hover { background: var(--surface-2); }
a.pd-cl:hover b { color: var(--primary-ink); }
.pd-cl b { font-weight: 700; color: var(--text); text-align: right; }
.pd-cl.total { border-top: 2px solid var(--border-strong); border-bottom: 0; font-weight: 700; color: var(--text); }
.pd-cl .pd-sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 8px; }
@media (max-width: 1023px) { a.pd-cl { min-height: var(--tap); } }

/* two lenses (R4 S04) */
.pd-lens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.pd-lens > a, .pd-lens > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.pd-lens > a:hover { border-color: var(--primary-tint-2); box-shadow: 0 0 0 3px var(--primary-tint); }
.pd-lens b { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text); }
.pd-lens span { font-size: 12.5px; color: var(--text-2); }
.pd-lens small { font-size: 12px; color: var(--muted); }
@media (max-width: 380px) { .pd-lens { grid-template-columns: minmax(0, 1fr); } }

/* where podiatry patients went next */
.pd-paths { display: grid; gap: var(--s3); }
.pd-path { display: grid; grid-template-columns: minmax(150px, 1.1fr) repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.pd-path .from { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; min-width: 0; }
.pd-node { position: relative; display: grid; gap: 1px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--c, var(--primary)) 7%, var(--surface)); min-width: 0; }
a.pd-node:hover { border-color: var(--c, var(--primary)); }
.pd-node b { font-size: 19px; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.2; }
.pd-node span { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.pd-node.none { background: var(--surface-2); }
.pd-node.none b { color: var(--muted-2); }
.pd-path .pd-node + .pd-node::before { content: ""; position: absolute; left: -8px; top: 50%; width: 8px; height: 2px; background: var(--border-strong); }
@media (max-width: 1023px) { .pd-path { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pd-path .from { grid-column: 1 / -1; } }
@media (max-width: 767px) { .pd-path { grid-template-columns: minmax(0, 1fr); } .pd-path .pd-node + .pd-node::before { display: none; } a.pd-node { min-height: var(--tap); } }

/* orthotic stages: counts per stage, each opens its orders */
.pd-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pd-stage { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); min-width: 0; border-top: 3px solid var(--c, var(--border-strong)); }
a.pd-stage:hover { box-shadow: 0 0 0 3px var(--primary-tint); }
.pd-stage b { font-size: 21px; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.2; }
.pd-stage span { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.pd-stage small { font-size: 11.5px; color: var(--muted); }
@media (max-width: 1279px) { .pd-stages.in-card { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .pd-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } a.pd-stage { min-height: var(--tap); } }
@media (max-width: 767px) { .pd-stages, .pd-stages.in-card { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* one order's progress */
.pd-track { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.pd-tstep { display: grid; gap: 4px; justify-items: start; padding: 0 10px 0 0; position: relative; min-width: 0; }
.pd-tstep .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunk); color: var(--muted-2); border: 2px solid var(--border-strong); z-index: 1; }
.pd-tstep.done .dot { background: var(--ok); border-color: var(--ok); color: var(--on-primary); }
.pd-tstep.now .dot { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-ink); }
.pd-tstep::after { content: ""; position: absolute; left: 26px; right: 0; top: 12px; height: 2px; background: var(--border); }
.pd-tstep.done::after { background: var(--ok); }
.pd-tstep:last-child::after { display: none; }
.pd-tstep strong { font-size: 13px; }
.pd-tstep span { font-size: 12px; color: var(--muted); }
@media (max-width: 1023px) {
  .pd-track { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pd-tstep { grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; padding: 0 0 14px; }
  .pd-tstep .dot { grid-row: span 2; }
  .pd-tstep::after { left: 12px; right: auto; top: 26px; bottom: 0; width: 2px; height: auto; }
}

/* foot exam: left and right side by side */
.pd-feet { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pd-feet th { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted-2); text-align: left; font-weight: 600; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.pd-feet td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
.pd-feet td:first-child { color: var(--text-2); }
.pd-feet tr:last-child td { border-bottom: 0; }
.pd-feet .prev { display: block; font-size: 12px; color: var(--muted); }
@media (max-width: 767px) {
  .pd-feet thead { display: none; }
  .pd-feet tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .pd-feet td { padding: 0; border: 0; }
  .pd-feet td:first-child { grid-column: 1 / -1; font-weight: 600; color: var(--text); }
  .pd-feet td[data-side]::before { content: attr(data-side) ": "; color: var(--muted); }
}

/* foot exam entry: one row per measurement with a field per side */
.pd-entry { display: grid; gap: 0; }
.pd-erow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pd-erow:last-child { border-bottom: 0; }
.pd-erow .nm strong { display: block; font-size: 13.5px; }
.pd-erow .nm small { display: block; font-size: 12px; color: var(--muted); }
.pd-erow.head { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted-2); font-weight: 600; padding-top: 0; }
@media (max-width: 767px) { .pd-erow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pd-erow .nm { grid-column: 1 / -1; } .pd-erow.head { display: none; } }

/* visiting provider clinic days */
.pd-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.pd-day { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
a.pd-day:hover { border-color: var(--primary-tint-2); box-shadow: 0 0 0 3px var(--primary-tint); }
.pd-day .d { font-weight: 700; font-size: 14px; }
.pd-day .s { font-size: 12.5px; color: var(--muted); }
.pd-slots { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
.pd-slots i { display: block; height: 14px; border-radius: 3px; background: var(--surface-sunk); border: 1px solid var(--border); }
.pd-slots i.b { background: var(--m-podiatry); border-color: var(--m-podiatry); }
.pd-slots i.c { background: var(--warn-tint); border-color: var(--warn-line); }
@media (max-width: 1279px) { .pd-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .pd-days { grid-template-columns: minmax(0, 1fr); } }
.pd-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pd-legend span { display: inline-flex; gap: 6px; align-items: center; }
.pd-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); border: 1px solid var(--border); }

/* utilisation by clinic day: one bar per day held */
.pd-ubars { display: grid; gap: 8px; }
.pd-ubar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 150px; gap: 12px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
a.pd-ubar:hover { background: var(--surface-2); }
.pd-ubar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pd-ubar .v b { color: var(--text); }
@media (max-width: 767px) { .pd-ubar { grid-template-columns: minmax(0, 1fr) auto; } .pd-ubar .bar { grid-column: 1 / -1; order: 3; } a.pd-ubar { min-height: var(--tap); } }

/* feature switch rows */
.pd-feat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px) 70px; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.pd-feat:last-child { border-bottom: 0; }
.pd-feat .nm { display: grid; gap: 2px; min-width: 0; }
.pd-feat .nm strong { font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-feat .nm span { font-size: 12.5px; color: var(--muted); }
.pd-feat .key { overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--muted-2); }
.pd-feat .dep { font-size: 12px; color: var(--text-2); display: grid; gap: 3px; min-width: 0; }
.pd-feat .sw { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding-right: 4px; }
.pd-feat, .pd-feat .sw { overflow: hidden; }
.pd-feat .sw { overflow: visible; }
.pd-feat.locked { background: var(--surface-2); }
.pd-swlink { display: inline-flex; align-items: center; }
.pd-swlink .switch { display: block; }
.pd-feat .why { min-width: 0; grid-column: 1 / -1; font-size: 12.5px; color: var(--text-2); display: flex; gap: 6px; align-items: flex-start; margin-top: -4px; }
@media (max-width: 767px) {
  .pd-feat { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; gap: 8px 12px; }
  .pd-feat .dep { grid-column: 1 / -1; order: 3; }
  .pd-feat .sw { grid-row: 1; grid-column: 2; }
}
@media (max-width: 1023px) {
  .pd-feat .switch { width: 52px; height: 30px; border-radius: 15px; }
  .pd-feat .switch::after { top: 4px; left: 4px; width: 22px; height: 22px; }
  .pd-feat .switch.on::after { left: 26px; }
}

/* impact preview counts */
.pd-impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pd-impact > a, .pd-impact > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; min-height: var(--tap); }
.pd-impact > a:hover { border-color: var(--primary-tint-2); }
.pd-impact b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pd-impact span { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 767px) { .pd-impact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* report library */
.pd-reps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.pd-rep { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); align-items: start; min-width: 0; }
a.pd-rep:hover { border-color: var(--primary-tint-2); box-shadow: 0 0 0 3px var(--primary-tint); }
.pd-rep .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--m-podiatry) 12%, var(--surface)); color: var(--m-podiatry-ink); }
.pd-rep strong { display: block; font-size: 13.5px; color: var(--text); }
.pd-rep small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
@media (max-width: 1279px) { .pd-reps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .pd-reps { grid-template-columns: minmax(0, 1fr); } }

/* setup step cards on phones */
.pd-setup { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s4); align-items: start; }
.pd-setup > aside { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: var(--s4); }
@media (max-width: 1279px) { .pd-setup { grid-template-columns: minmax(0, 1fr); } .pd-setup > aside { position: static; order: -1; } }
.pd-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: var(--s4); }
@media (max-width: 767px) {
  .pd-foot { position: sticky; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; margin-bottom: -10px; z-index: 5; }
  .pd-foot .btn { flex: 1; }
}

/* small helpers */
.pd-kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 767px) { .pd-kv2 { grid-template-columns: minmax(0, 1fr); } }
.pd-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pd-note .icon { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.pd-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 767px) { .pd-actions { justify-content: stretch; } .pd-actions .btn { flex: 1 1 auto; } }
.pd-gap { height: var(--s4); }
@media (max-width: 359px) { .pd-tstep { padding-right: 3px; } .pd-tstep strong { font-size: 10.5px; overflow-wrap: anywhere; } }
