/* KTE Service — "Service Line" design trial: the field app (Technicians and Supervisors: one shared view).
   Phone first: large titles, cards you can hit with a thumb, the day's visits as a numbered route, the main action at the bottom. */

/* ---------- Today (My Jobs) ---------- */
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.today-head h1 { font-size: 2.4rem; line-height: 1; }
.today-head p.muted { margin: 6px 0 0; font-size: 1.02rem; }
.today-ring { width: 78px; height: 78px; background: radial-gradient(closest-side, var(--bg) 74%, transparent 76% 100%), conic-gradient(var(--accent) calc(var(--p) * 1%), #dfe4ea 0); }
.today-ring b { font: 700 1.2rem var(--font-c); }
.update-note { margin: 0 0 14px; padding: 11px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid #f3d38f; color: #6b4300; font-weight: 700; }
/* days with jobs, as a strip of dates */
.day-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 2px 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip a { flex: none; display: grid; justify-items: center; gap: 0; min-width: 76px; padding: 8px 10px 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); scroll-snap-align: start; }
.day-strip a small { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.day-strip a b { font: 700 1.5rem/1.1 var(--font-c); }
.day-strip a span { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.day-strip a.is-today { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-strip a.is-today small, .day-strip a.is-today span { color: #b9c6d6; }
.day-block { scroll-margin-top: calc(var(--top-h) + var(--safe-t) + 10px); }

.tech-sec { margin-bottom: 24px; }
.tech-sec h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-sub { margin: -6px 0 10px; }
.sec-today h2 { font-size: 1.45rem; }
.job-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.job-cards > li { min-width: 0; }
.job-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-height: 64px; text-decoration: none; color: var(--ink); position: relative; }
.job-card:hover, .job-card:focus-visible { border-color: var(--line-strong); }
.job-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-top > b { font: 700 0.95rem/1 var(--font-c); background: var(--ink); color: #fff; padding: 5px 8px; border-radius: 7px; }
.job-top .status { margin-left: auto; align-items: flex-end; text-align: right; }
.job-top > .status-pill { margin-left: auto; }
.job-main { font: 700 1.25rem/1.2 var(--font-c); margin-top: 4px; }
.job-sub { color: var(--ink-2); font-size: 0.94rem; }
.wait-line { font-weight: 700; color: #7a4c00; }
.job-flag { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.carried-tag { display: inline-block; font-size: 0.76rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--alert-soft); color: #7a1510; }
.job-no { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 0.95rem var(--font-c); flex: none; }
.done-tick { background: #e3f3d8; color: #285410; font-weight: 700; font-size: 0.8rem; border-radius: 6px; padding: 3px 8px; }
.job-card.is-done { background: #f7faf4; }
.job-card.is-done .job-no { background: #2f8f3a; }
.job-card.is-done .job-main { color: var(--muted); }
/* the day's visits as a route: numbered stops joined by a line */
.route .job-cards { gap: 12px; }
.sec-today.route .job-cards > li { position: relative; }
.sec-today.route .job-cards > li:has(.job-no)::before { content: ""; position: absolute; left: 30px; top: 44px; bottom: -14px; width: 2px; background: repeating-linear-gradient(var(--line-strong) 0 5px, transparent 5px 9px); }
.sec-today.route .job-cards > li:has(.job-no):last-child::before, .sec-today.route .job-cards > li:has(.job-no):has(+ li:not(:has(.job-no)))::before { display: none; }
.sec-today.route .job-cards > li > * { position: relative; z-index: 1; }
/* Record Visit: inside the job's card, full width; the next one to do is amber */
.job-cards > li:has(.job-record) .job-card { border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: 12px; }
.job-record { display: flex; width: 100%; min-height: 50px; border-radius: 0 0 16px 16px; font-size: 1rem; }
.job-record.primary { background: var(--surface); color: var(--ink); border-color: var(--line); border-top: 1px dashed var(--line-strong); }
.job-record.primary:hover { background: var(--hover); border-color: var(--line); }
.job-record.accent { border-color: var(--accent); }
.sec-ready .job-card { border-left: 5px solid #1da27a; }
.sec-clarify .job-card { border-left: 5px solid #9a54d6; }
.sec-helping .job-card { border-left: 5px solid var(--link); }
/* AMC visits: their own teal identity */
.amc-card { border-left: 5px solid #0b6e8a; }
.amc-card .job-top b { font: 700 1.12rem var(--font-c); background: none; color: var(--ink); padding: 0; }
.amc-badge { background: #0b6e8a; }
/* crew and transport from the Planner */
.my-crew { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.my-crew small { display: block; color: var(--muted); }
.crew-avs { display: inline-flex; }
.crew-avs .av { border: 2px solid var(--surface); border-radius: 50%; margin-left: -8px; }
.crew-avs .av:first-child { margin-left: 0; }
.drop-card { border-left: 5px solid var(--ink); }
.my-crews .my-crew-day + .my-crew-day { margin-top: 10px; }

/* ---------- My AMC ---------- */
.app-head { margin-bottom: 12px; }
.month-switch { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.month-switch b { font: 700 1.3rem var(--font-c); margin-right: auto; }
.month-switch .icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: 1.3rem; color: var(--ink); }
.amc-progress { display: flex; align-items: center; gap: 16px; }
.amc-progress p { margin: 0; display: grid; gap: 2px; }
.amc-progress p b { font: 700 1.2rem var(--font-c); }
.amc-checklist { list-style: none; margin: 0 0 18px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.amc-checklist li + li { border-top: 1px solid var(--line); }
.amc-check { display: grid; grid-template-columns: 30px minmax(0, 1fr) 10px; gap: 14px; align-items: center; padding: 14px 16px; min-height: 64px; text-decoration: none; color: var(--ink); }
.amc-check::after { content: ""; width: 8px; height: 8px; border-top: 2px solid var(--faint); border-right: 2px solid var(--faint); transform: rotate(45deg); }
.amc-check:hover { background: var(--hover); }
.check-mark { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.9rem; }
.amc-check.is-done .check-mark { background: #0b6e8a; border-color: #0b6e8a; }
.amc-check.is-done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.amc-check-main b { display: block; font-size: 1.02rem; }
.amc-check-main small { color: var(--muted); }

@media (min-width: 821px) {
  .role-technician main, .is-field main { max-width: 900px; }
  .day-strip { margin: 0 0 16px; padding: 2px 0 4px; }
}
@media (max-width: 820px), (pointer: coarse) and (max-height: 500px) {
  .today-head h1 { font-size: 2.3rem; }
  .job-main { font-size: 1.2rem; }
}

/* ---------- one job (field) ---------- */
.job-hero .job-title { font-size: 2rem; margin-top: 2px; }
.job-hero .case-id { margin-bottom: 8px; }
.job-hero .case-id .status { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin-helping { margin: 4px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick-acts { display: flex; gap: 10px; margin: 16px 0 2px; flex-wrap: wrap; }
.quick { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 700; }
.quick:hover { background: var(--sunken); }
.q-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.q-ic svg { width: 20px; height: 20px; }
.job-actions { margin-bottom: 4px; }
.job-actions .next-btn { min-width: 240px; }
/* the visit form */
.visit-form h2, .visit-times h2 { margin-bottom: 10px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.result-btn { min-height: 64px; font: 700 1.05rem var(--font-c); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 14px; cursor: pointer; }
.result-btn[data-result="rectified"][aria-checked="true"] { background: #2f8f3a; border-color: #2f8f3a; color: #fff; }
.result-btn[data-result="revisit"][aria-checked="true"] { background: #ee8a1c; border-color: #ee8a1c; color: #1e1400; }
.result-btn[data-result="need_parts"][aria-checked="true"] { background: #a7713f; border-color: #a7713f; color: #fff; }
.result-btn[data-result="not_repairable"][aria-checked="true"] { background: #cf5636; border-color: #cf5636; color: #fff; }
.part-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 74px minmax(0, 2fr) 38px; gap: 6px; margin-bottom: 6px; align-items: center; }
.part-row .p-no { text-transform: uppercase; font-weight: 700; }
.block-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ids-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0 0 12px; }
.also-list li { padding: 8px 0; }
.also-list .check { align-items: center; flex-wrap: wrap; }
/* visits on this job */
.vc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vc-result { font-weight: 700; font-size: 0.9rem; }
.vc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 0; padding: 9px 11px; background: var(--bg); border-radius: var(--r-sm); }
.vc-facts dt { color: var(--muted); font-size: 0.8rem; }
.vc-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.vc-need { display: grid; gap: 2px; margin-top: 8px; padding: 9px 11px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-sm); }
.vc-sub { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.vc-who { display: flex; align-items: center; gap: 8px; }
.vc-parts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.vc-parts li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.vc-parts li:last-child { border-bottom: 0; }
.involved-tag { font-size: 0.74rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--link-soft); color: var(--link-dark); white-space: nowrap; }
details.panel.fold > summary { font: 700 1.1rem var(--font-c); }
@media (max-width: 820px), (pointer: coarse) and (max-height: 500px) {
  .job-hero .job-title { font-size: 1.75rem; }
  .quick-acts { display: grid; grid-template-columns: 1fr 1fr; }
  .quick { padding-right: 12px; }
  .job-actions .next-btn { min-width: 0; }
  .job-actions .act-note { display: block; text-align: center; flex: 1; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .part-row { grid-template-columns: minmax(0, 1fr) 64px 38px; }
  .part-row .p-desc { grid-column: 1 / 3; grid-row: 2; }
}
/* phones: Call and Directions stay in the bottom bar beside Record Visit (the header ones scroll away) */
.bar-ic { display: none !important; }
@media (max-width: 820px), (pointer: coarse) and (max-height: 500px) {
  .job-actions .bar-ic { display: inline-flex !important; flex: 0 0 52px; padding: 0; }
  .job-actions .bar-ic svg { width: 22px; height: 22px; }
}
