/* ---------- atendimento guiado da OS (técnico) ---------- */
body.at-open { overflow: hidden; }
#atend { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; background: var(--background); color: var(--foreground); }
body:has(#atend) #modal { z-index: 2000; }          /* janelas abertas durante o atendimento (documentos) ficam à frente */
#atend .icon { width: 1.4em; height: 1.4em; flex: none; }
.at-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); background: var(--card); }
.at-x { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--muted, #0001); color: var(--foreground); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.at-title { flex: 1; min-width: 0; font-size: var(--text-md, 1rem); line-height: 1.25; } .at-title .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-clock { display: flex; align-items: center; gap: var(--space-2); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; }
.at-pp { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--warning); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.at-pp-go { background: var(--success); }
.at-pause { padding: var(--space-2) var(--space-4); background: color-mix(in srgb, var(--warning) 22%, transparent); display: flex; gap: var(--space-2); align-items: center; font-weight: 600; }
.at-steps { display: flex; gap: 2px; padding: var(--space-2) var(--space-2) 0; background: var(--card); border-bottom: 1px solid var(--border); }
.at-steps button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2) 0; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted-foreground); font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.at-steps button span { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--muted, #0001); font-size: var(--text-sm); }
.at-steps button span .icon { width: 1em; height: 1em; }
.at-steps button.on { color: var(--primary); border-bottom-color: var(--primary); } .at-steps button.on span { background: var(--primary); color: var(--primary-foreground, #fff); }
.at-steps button.done span { background: var(--success); color: #fff; }
.at-body { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); -webkit-overflow-scrolling: touch; }
.at-foot { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--card); }
.at-nav { flex: 1; min-height: 56px; border-radius: 28px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 1.05rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); cursor: pointer; }
.at-next { background: var(--primary); color: var(--primary-foreground, #fff); border-color: var(--primary); }
.at-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); flex: none; }
.at-card.center { align-items: center; text-align: center; } .at-big { color: var(--primary); }
.at-q { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.at-k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); margin-top: var(--space-1); } .at-v { font-size: 1.05rem; }
.at-bt { min-height: 48px; justify-content: center; }
.at-prog { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; flex: none; }
.at-bar { height: 8px; border-radius: 4px; background: var(--muted, #0002); overflow: hidden; flex: none; } .at-bar i { display: block; height: 100%; background: var(--success); transition: width .2s; }
.at-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; flex: none; }
.at-chip { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); color: var(--foreground); font-weight: 700; cursor: pointer; }
.at-chip.cur { outline: 3px solid var(--primary); outline-offset: 1px; }
.at-chip.s-ok { background: var(--success); border-color: var(--success); color: #fff; } .at-chip.s-nc { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.at-chip.s-warn { background: var(--warning); border-color: var(--warning); color: #fff; } .at-chip.s-na { background: var(--muted-foreground); border-color: var(--muted-foreground); color: #fff; }
.at-ans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); } .at-ans.one { grid-template-columns: 1fr; }
.at-btn { min-height: 64px; border-radius: var(--radius-lg, 16px); border: 3px solid var(--border); background: var(--card); color: var(--foreground); font-size: 1.1rem; font-weight: 700; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: var(--space-3); cursor: pointer; }
.at-btn .icon { width: 1.8em; height: 1.8em; }
.at-btn.ok { border-color: var(--success); color: var(--success); } .at-btn.ok.on, .at-btn.ok.big { background: var(--success); color: #fff; }
.at-btn.nc { border-color: var(--destructive); color: var(--destructive); } .at-btn.nc.on { background: var(--destructive); color: #fff; }
.at-btn.na { min-height: 52px; flex-direction: row; font-size: 1rem; color: var(--muted-foreground); border-width: 2px; } .at-btn.na.on { background: var(--muted-foreground); color: #fff; border-color: var(--muted-foreground); }
.at-btn.foto { flex-direction: row; border-color: var(--primary); color: var(--primary); min-height: 56px; }
.at-btn.big { flex-direction: row; }
.at-in { font-size: 1.15rem; min-height: 56px; width: 100%; }
.at-med { display: flex; align-items: center; gap: var(--space-2); } .at-un { font-size: 1.1rem; font-weight: 700; color: var(--muted-foreground); }
.at-msg { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md, 10px); font-weight: 600; display: flex; gap: var(--space-2); align-items: center; }
.at-msg.good { background: color-mix(in srgb, var(--success) 16%, transparent); } .at-msg.warn { background: color-mix(in srgb, var(--warning) 22%, transparent); } .at-msg.bad { background: color-mix(in srgb, var(--destructive) 18%, transparent); }
.at-extra { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px dashed var(--border); } .at-extra.req { border-top-color: var(--destructive); }
.at-more { align-self: flex-start; font-size: 1rem; padding: var(--space-2) 0; display: inline-flex; align-items: center; gap: 4px; }
.at-more { background: none; border: 0; }
body.at-open #modal .dialog-backdrop { z-index: 2200; } body.at-open #modal #mDlg { z-index: 2201; }          /* leitor de QR (e qualquer janela) abre por cima do atendimento */
body.at-open #toast { bottom: auto; top: 76px; left: var(--space-3); right: var(--space-3); z-index: 2100; }
.at-fotos { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.at-th { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--muted, #0002); } .at-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.at-thx { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #000a; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; } .at-thx .icon { width: 1em; height: 1em; }
.at-thx.static { position: static; background: var(--destructive); flex: none; width: 40px; height: 40px; }
.at-list { display: flex; flex-direction: column; gap: var(--space-2); } .at-li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: 12px; }
.at-qty { display: flex; gap: var(--space-2); align-items: center; } .at-qty input { text-align: center; } .at-qty button { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); color: var(--foreground); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.at-sum { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: 1.05rem; } .at-sum span { flex: 1; }
.at-pend { border-color: var(--warning); } .at-pi { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 52px; padding: var(--space-2) var(--space-3); border: 2px solid var(--warning); border-radius: 12px; background: var(--card); color: var(--foreground); font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer; }
.at-start { min-height: 72px; border-radius: 36px; border: 0; background: var(--success); color: #fff; font-size: 1.3rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: var(--space-3); cursor: pointer; flex: none; } .at-start .icon { width: 1.6em; height: 1.6em; }
.at-start.fin { background: var(--primary); } .at-start:disabled { opacity: .45; cursor: not-allowed; }
/* ---------- editor visual de checklist (planos, modelos, abertura de OS) ---------- */
.cke { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-3); }
.cke-list { display: flex; flex-direction: column; gap: var(--space-3); }
.cke-row { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.cke-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground, #fff); font-weight: 700; font-size: var(--text-sm); display: inline-flex; align-items: center; justify-content: center; margin-top: 6px; }
.cke-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.cke-tipos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cke-tipos button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 var(--space-3); border: 2px solid var(--border); border-radius: 19px; background: var(--card); color: var(--foreground); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.cke-tipos button.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 18%, transparent); }
.cke-tipos .icon { width: 1.2em; height: 1.2em; }
.cke-act { flex: none; display: flex; flex-direction: column; gap: 2px; }
.cke-rot-up, .cke-rot-down { transform: rotate(90deg); }
.cke-aviso { font-size: var(--text-sm); color: var(--warning); }
.cke-vazio { padding: var(--space-3) 0; }
.cke-g { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--muted-foreground); } .cke-g .select { width: auto; max-width: 100%; }
.cke-g.g-critica .select { border-color: var(--destructive); } .cke-g.g-atencao .select { border-color: var(--warning); }
@media (max-width: 600px) { .cke-row { flex-wrap: wrap; } .cke-act { flex-direction: row; width: 100%; justify-content: flex-end; } }
/* resolvida na visita (técnico) */
.at-resolv { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.at-q2 { font-size: 1.05rem; font-weight: 700; }
.ckv-resolv { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: color-mix(in srgb, var(--warning) 18%, transparent); display: flex; gap: var(--space-2); align-items: flex-start; }
.ckv-resolv.ok { background: color-mix(in srgb, var(--success) 16%, transparent); }
/* ---------- respostas do checklist na OS (administrador) ---------- */
.ckv-list { display: flex; flex-direction: column; gap: var(--space-2); }
.ckv-it { display: flex; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-left-width: 5px; border-radius: var(--radius-md); background: var(--card); }
.ckv-it.e-ok { border-left-color: var(--success); } .ckv-it.e-nc { border-left-color: var(--destructive); background: color-mix(in srgb, var(--destructive) 6%, var(--card)); }
.ckv-it.e-med { border-left-color: var(--warning); } .ckv-it.e-na { border-left-color: var(--muted-foreground); } .ckv-it.e-pend { border-left-color: var(--warning); border-style: dashed; border-left-style: solid; }
.ckv-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--muted, #0001); font-weight: 700; font-size: var(--text-sm); display: inline-flex; align-items: center; justify-content: center; }
.ckv-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ckv-q { font-weight: 600; }
.ckv-tp { display: flex; align-items: center; gap: 4px; } .ckv-tp .icon { width: 1.1em; height: 1.1em; }
.ckv-r { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ckv-val { font-size: 1.1rem; } .ckv-txt { font-style: italic; }
.ckv-obs { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--muted, #0001); }
.ckv-fotos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ckv-th { width: 72px; height: 72px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--muted, #0002); } .ckv-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ckv-big { position: fixed; inset: 0; z-index: 3500; background: #000d; display: flex; align-items: center; justify-content: center; padding: var(--space-4); cursor: zoom-out; } .ckv-big img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.ckv-big button { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff3; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 700px) { #atend { max-width: 560px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); box-shadow: 0 0 0 100vmax #0007; } }
