/* Procedures (SOPs), the workload dashboard and departments. Only what the kit does not already cover. */
.sop-filter { margin-left: auto; } .sop-filter select { max-width: 200px; }
.sop-plan b { font-weight: 600; color: var(--text); }
.sop-row.st-retired .rt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-2); }
.sop-row.st-concept .rt { color: var(--text-2); }
.sop-help { margin-top: 20px; }

.sop-purpose { font-size: 1.02rem; color: var(--text-2); margin: 0 0 16px; max-width: 70ch; }
.sop-actions { margin: 4px 0 6px; } .sop-actions .hint { margin: 0 0 0 4px; }
.sop-props { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 10px 0 16px; }
.sop-props .pv { height: auto; min-height: 30px; flex-wrap: wrap; line-height: 1.3; }
.sop .ltabs { margin-top: 6px; }
.sop-est { margin-bottom: 8px; } .sop-estlog { margin-top: 10px; } .sop-estlog b { font-family: var(--mono); }
.sop-body { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin: 0 0 14px; }
.sop .d-sec .btn { margin-top: 8px; }

/* editor */
.sop-form .card-b { padding-bottom: 16px; }
.sop-freq { display: flex; align-items: center; gap: 6px; } .sop-freq input { width: 64px !important; flex: none; } .sop-freq select { width: auto; flex: 1; min-width: 0; }
.sop-form-actions { justify-content: flex-end; }

/* workload */
.wl { display: flex; flex-direction: column; gap: 14px; }
.wl .stats { margin: 0; } .wl .card .tscroll:last-child { margin-bottom: 0; } .wl .card .tscroll { margin-bottom: 8px; }
.wl-vol { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.wl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .wl-grid2 > .card { min-width: 0; }
.wl-h3 { margin: 12px 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-family: var(--sans); }
.wl-donut svg { max-width: 240px; display: block; margin: 0 auto; }
.wl .chart { display: block; color: var(--text); } .wl .chart text { fill: currentColor; font-family: var(--sans); }
.wl .donut-big { font-size: 20px; font-weight: 700; } .wl .donut-small, .wl .donut-pct { font-size: 12px; opacity: .65; }
.wl-legend { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr; gap: 4px 12px; font-size: .86rem; }
.wl-legend li { display: flex; gap: 8px; align-items: center; min-width: 0; } .wl-legend .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-legend b, .wl-legend .muted { white-space: nowrap; font-variant-numeric: tabular-nums; } .wl-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.wl .pareto { display: flex; height: 28px; border-radius: 6px; overflow: hidden; margin: 2px 0 4px; }
.wl .pareto span { display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 700; color: #0b0f14; min-width: 2px; border-right: 1px solid var(--surface); }
.wl-bars .bar-label { font-size: 13px; } .wl-bars .bar-note { font-size: 12px; opacity: .8; font-family: var(--mono); }
.wl-gaps { margin: 0; padding: 0 0 0 18px; font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.wl-drv { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; } .wl-drv input { width: 80px; height: 30px; text-align: right; }
.wl-sort { text-decoration: none; color: inherit; } .wl-sort.on { color: var(--accent); }
.wl-all td:first-child { max-width: 320px; }
.wl .prop.inline select { max-width: 150px; }
.wl-card .card-h h2 small { white-space: normal; }

/* departments */
.dept-row .rl { gap: 10px; } .dept-f { flex-direction: row; gap: 8px; align-items: center; }
.dept-f input { height: 32px; } .dept-pos { width: 64px !important; text-align: right; }
.dept-add { margin-top: 16px; }

@media (max-width: 900px) { .wl-grid2 { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .sop-filter { margin-left: 0; width: 100%; flex-wrap: wrap; height: auto; padding: 6px; }
  .sop-filter select { max-width: none; width: 100%; }
  .sop-props { grid-template-columns: 1fr 1fr; }
  .wl-vol { margin-left: 0; }
  .dept-f { flex-wrap: wrap; } .dept-row .ra { padding-left: 34px; }
}

/* v8.2: steps as a list with photos, the record pill, print button */
.rec { color: var(--accent); font-weight: 600; } .rec .ic { width: 13px; height: 13px; }
.sop-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sop-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.sop-step .ssn { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font: 600 .82rem var(--mono); flex: none; margin-top: 1px; }
.sop-step .ssm { flex: 1; min-width: 0; } .sop-step .sst { font-weight: 600; font-size: .98rem; } .sop-step .ssb { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; font-size: .84rem; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.photos.main { margin: 4px 0 14px; }
.photo { margin: 0; width: 164px; display: flex; flex-direction: column; gap: 4px; }
.photos.main .photo { width: 180px; }
.photo .js-zoom { display: block; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; width: 100%; aspect-ratio: 4 / 3; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { font-size: .8rem; color: var(--muted); }
.photo-cap { display: flex; gap: 2px; align-items: center; width: 100%; } .photo-cap input { height: 26px; font-size: .8rem; min-width: 0; width: 100%; flex: 1; padding: 0 6px; }
.photo-cap form { display: contents; }
.photo-add { align-self: flex-start; cursor: pointer; } .photo-add.busy { opacity: .5; pointer-events: none; }
.photos .photo-add { height: 36px; }
.photos .photo-add { margin: 0; flex: none; }
.photos:not(.main):has(.photo) .photo-add { align-self: center; }
.sop-photos h3 small { font-weight: 400; color: var(--muted); margin-left: 6px; }
@media (max-width: 720px) { .photo { width: calc(50% - 4px); } .photos.main .photo { width: calc(50% - 4px); } }

/* v8.3: the procedure editor as step cards (one picture per step) */
.sop-editor .page-head input.big { font-size: 1.2rem; }
.sop-steps-ed { margin: 4px 0 18px; }
.step-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.step-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.sc-pic { position: relative; }
.sc-img { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; }
.sc-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sc-img.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); cursor: default; border-bottom: 1px dashed var(--border); }
.sc-img.empty .ic { width: 28px; height: 28px; }
.sc-add { position: absolute; right: 8px; bottom: 8px; background: rgb(255 255 255 / .92); color: #111; border-color: transparent; box-shadow: 0 1px 6px rgb(0 0 0 / .2); }
:root[data-theme="dark"] .sc-add { background: rgb(20 22 28 / .9); color: #fff; }
.sc-strip { display: flex; gap: 4px; padding: 6px 8px 0; flex-wrap: wrap; }
.sc-th { position: relative; width: 44px; height: 33px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.sc-th.first { outline: 2px solid var(--accent); outline-offset: -1px; }
.sc-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-th button { position: absolute; bottom: 0; width: 18px; height: 16px; padding: 0; border: 0; background: rgb(0 0 0 / .55); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sc-th button .ic { width: 11px; height: 11px; }
.sc-th .js-pic-del { right: 0; } .sc-th .js-pic-first { left: 0; }
.sc-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 8px; }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--bg); font: 700 .82rem var(--mono); flex: none; }
.sc-head input { font-weight: 600; }
.sc-body textarea { font-size: .88rem; min-height: 0; resize: vertical; }
.sc-row { display: flex; gap: 6px; align-items: center; }
.sc-min { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .82rem; } .sc-min input { width: 58px; }
.sc-video { flex: 1; min-width: 0; font-size: .82rem; }
.sc-actions { display: flex; align-items: center; gap: 2px; margin-top: 2px; } .sc-actions .grow { flex: 1; }
.sc-actions button[disabled] { opacity: .3; }
.sc-addrow { display: flex; align-items: flex-start; gap: 14px; margin-top: 14px; flex-wrap: wrap; } .sc-addrow .sc-bulk { flex: 1; min-width: 260px; }
.sc-other { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--r); }
.sc-other h4 { margin: 0 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .sc-other h4 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.sop-form-actions { display: flex; align-items: center; } .sop-form-actions .grow { flex: 1; }
.sop-video { margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sop-step .ssd { color: var(--text-2); font-size: .9rem; margin-top: 2px; white-space: pre-wrap; }
.run-video { margin-left: 6px; }
.pic-move { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); } .pic-move select { height: 24px; font-size: .78rem; padding: 0 4px; flex: 1; min-width: 0; }
@media (max-width: 720px) { .step-cards { grid-template-columns: 1fr; } }
