/* H5 Service plus: styles for this module only. Tokens from tokens.css only (no raw hex). */

/* head strip */
.stat-g.sv-g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-g.sv-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sv-g5 .kpi > b, .sv-g3 .kpi > b { font-size: 21px; white-space: nowrap; }
.sv-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.sv-card > h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sv-card > h4 .i { color: var(--d-svc); }
.sv-card > h4 em { margin-left: auto; font: 600 12px var(--mono); font-style: normal; color: var(--ink-3); }
.sv-tech { margin-left: auto; }
.btools .sv-tech select { max-width: 220px; }

/* list rows: plans, unsigned reports, calibration, extras on the ticket and unit sheets */
.sv-li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
a.sv-li { cursor: pointer; }
a.sv-li:hover { background: var(--hover); text-decoration: none; }
.sv-card > .sv-li:first-of-type, .sv-card > h4 + .sv-li { border-top: 0; }
.sv-lit { display: grid; min-width: 0; color: inherit; text-decoration: none; }
.sv-lit b { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-lit small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-liw { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.sv-none { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 2px 2px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
.sv-none .i { color: var(--warn); }
.sv-cal-due { margin-bottom: 14px; }
.sv-slot { margin-top: 4px; }

/* today's visits: the technician's list, one card per visit */
.sv-list { display: grid; gap: 10px; margin: 12px 0 16px; }
.sv-visit { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 18px; border-radius: var(--r-l); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-1); }
/* state is in the time column and the pills, not in a coloured edge */
.sv-visit.now { border-color: color-mix(in oklab, var(--warn-fill) 45%, transparent); background: var(--warn-soft); }
.sv-time { display: grid; align-content: start; gap: 2px; }
.sv-time b { font: 600 18px var(--mono); }
.sv-time small { color: var(--ink-3); font-size: 12px; }
.sv-visit.late .sv-time small { color: var(--err); font-weight: 560; }
.sv-main { display: grid; gap: 6px; min-width: 0; }
.sv-main .km { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sv-main .kt { font-weight: 560; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.sv-who { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.sv-place { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-2); font-size: 13.5px; }
.sv-place .i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ink-3); }
.sv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sv-acts .btn { text-decoration: none; }

/* small forms: rows of measurements and calibration readings */
.sv-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.sv-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) 96px 36px; gap: 6px; align-items: center; }
.sv-row .in, .sv-ms .in { min-width: 0; width: 100%; max-width: none; }
.sv-pass { width: 100%; max-width: none; }

/* signature pad */
.sv-sigs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sv-sigs > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.sv-pad { display: grid; gap: 6px; }
.sv-padh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sv-cv { width: 100%; height: auto; aspect-ratio: 640 / 220; border-radius: var(--r-m); border: 1.5px dashed var(--line-2); background: white; touch-action: none; cursor: crosshair; } /* paper: the ink is dark in both themes */
.sv-sigdone { display: grid; gap: 6px; align-content: start; }
.sv-sig { width: 100%; max-width: 320px; max-height: 120px; object-fit: contain; border-radius: var(--r-s); border: 1px solid var(--line); background: white; padding: 4px; }
.sv-sigdone small { color: var(--ink-3); }

/* service report */
.sv-rep { display: grid; gap: 4px; }
.sv-ckh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sv-ckh .bar { flex: 1; }
.sv-ck { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.sv-ck .ck-note { grid-column: 1 / -1; }
.sv-ckt { overflow-wrap: anywhere; font-size: 14.5px; }
.sv-ckn { grid-column: 1 / -1; color: var(--err); }
.sv-ck.fail .sv-ckt { color: var(--err); font-weight: 560; }
.sv-ck.ok .sv-ckt { color: var(--ink-2); }
.sv-seg > button { min-width: 56px; height: 40px; padding: 0 12px; }
.sv-seg > button.on.ok { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 0 1px var(--ok-fill); }
.sv-seg > button.on.fail { background: var(--err-soft); color: var(--err); box-shadow: 0 0 0 1px var(--err-fill); }
.sv-seg > button.on.na { background: var(--mute-soft); color: var(--mute); }
.sv-seg > button:disabled { opacity: 1; cursor: default; }
.sv-seg > button:disabled:not(.on) { color: var(--ink-4); }
.sv-ms { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .7fr) 96px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.sv-ms.ro { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
.sv-msn { display: grid; min-width: 0; }
.sv-unit { color: var(--ink-3); font-size: 13.5px; }
.sv-pt { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 8px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.sv-pt .chk-l { margin: 0; }
.sv-pt.ro { grid-template-columns: minmax(0, 1fr) auto; }
.sv-pt .sub { grid-column: 1 / -1; }
.sv-acc { margin: 0; padding: 6px 0; }
.sv-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 12px 0 4px; margin-top: 12px; background: var(--panel-solid); border-top: 1px solid var(--line); z-index: 2; }
.sv-rep .seg.wide > button { height: auto; min-height: 44px; padding: 6px 8px; line-height: 1.25; }
.sv-foot .btn { height: 46px; }
.sv-foot .btn.pri { flex: 1 1 200px; }
.hint { font-size: 12.5px; color: var(--ink-3); }

/* print view: the same page rules as the sales documents, for our own root */
#svPrint { display: none; }
.p-kv th { padding-right: 10px; font-weight: 600; white-space: nowrap; }
.p-kv td { padding-right: 16px; }
.p-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.p-photos img { width: 100%; height: 110px; object-fit: cover; }
.p-sign img { display: block; height: 70px; margin: 0 auto; object-fit: contain; border-bottom: 1px solid black; }
@media print {
  html.svc-printing body > *:not(#svPrint) { display: none !important; }
  html.svc-printing #svPrint { display: block; }
  html.svc-printing, html.svc-printing body { background: white !important; }
}

@media (max-width: 1100px) {
  .stat-g.sv-g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stat-g.sv-g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-g.sv-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-top { grid-template-columns: minmax(0, 1fr); }
  .sv-tech { margin-left: 0; width: 100%; }
  .btools .sv-tech select { max-width: none; width: 100%; }
  .sv-visit { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px; }
  .sv-time { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; }
  .sv-acts .btn { height: 44px; flex: 1 1 auto; }
  .sv-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .sv-row > [name=name] { grid-column: 1 / -1; }
  .sv-row .sv-pass { grid-column: span 1; }
  .sv-ms { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sv-ms .sv-msn { grid-column: 1 / -1; }
  .sv-ms .sv-unit { grid-column: 1; }
  .sv-sigs { grid-template-columns: minmax(0, 1fr); }
  .sv-ck { grid-template-columns: minmax(0, 1fr); }
  .sv-seg { display: flex; width: 100%; }
  .sv-seg > button { flex: 1; height: 44px; }
  .sv-pt { grid-template-columns: minmax(0, 1fr) 72px; }
  .sv-pt > .btn { grid-column: 1 / -1; }
  .sv-li { grid-template-columns: minmax(0, 1fr) auto; }
  .sv-li > :nth-child(3) { grid-column: 1 / -1; justify-self: start; }
}
.tbl .who { display: flex; max-width: 100%; } /* phone: the name never runs under the numbers */
