/* iHouse CRM · ajustes da versão com servidor: celular legível e "cara de aplicativo".
   Carregado depois do estilo das telas, para valer por cima dele só nestes pontos. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ----- celular e tablet pequeno ----- */
@media (max-width: 700px) {
  /* letras pequenas (etiquetas, títulos de tabela, observações): nunca abaixo de 12,5 px */
  .badge, th, small, .eyebrow, .os-un, .mk-ch, .p-addr, .hint, .field > span, label.field > span, .kv span, .sr-v small, .pv-d small, .task-p .badge { font-size: max(12.5px, .8em); }
  th .th-b, button.th-b { font-size: max(12.5px, .8em); }
  /* reforço: as regras originais dessas partes são mais específicas; aqui valem por cima delas (fora dos documentos impressos) */
  body :is(.nav-i em, .me small, .field .req, .sub, .eyebrow, .badge, .badge.lnkb, .tbl th, th, .perf-bar small, .os-un, .model small, .tax-grid label, .q-h, .dia-tp, .medal, .q-edit, .pv-d small, .mp small, .pop-t small, .nt-b small, .rel-area > small, .rel-i span, .stepper span, .tema-c small, .bib-sec span, .cb-q > span small, .md-prev-l, .cr-cli-v span, .cr-h small, .mk-wd span, .mk-dt, .mk-p, .mk-more, .mk-ch, .mk-dtd small, .imei-ev small, .scan-box small, .pub-steps li, label > span, .field > span, .hint, small):not(.paper *):not(.danfe *):not(.nf *) { font-size: 12.5px; }
  body :is(.q-i, .q-i.main, .q-i.wide) { font-size: 12px; }
  body .dia-tp { font-size: 12px !important; }
  .strip .seg button { min-height: 32px; padding-inline: 12px; }
  body .bell em, body .nav-i em { font-size: 11.5px; min-width: 20px; }
  body :is(.mk-p i, .mk-leg i, .mk-ch.sm) { font-size: 11px; }
  .lnk { font-size: 14px; }
  /* campos com 16 px: o iPhone não dá zoom sozinho ao tocar */
  input, select, textarea { font-size: 16px !important; }
  /* alvos de toque mais confortáveis */
  .strip .lnk, .strip button { padding-block: 4px; }
  .strip-r { row-gap: 0; column-gap: 18px; }
  .btn.sm { min-height: 36px; }
  .icon-btn { width: 36px; height: 36px; }
  .x-in, .x-mini { min-width: 32px; min-height: 32px; font-size: 18px; display: inline-grid; place-items: center; }
  .mk-dn, .mk-nav button, .mk-h .icon-btn { min-width: 32px; min-height: 32px; }
  .chip { min-height: 34px; }
  :is(button, a).lnk, td .lnk, td button.badge, .tbl td button:not(.btn), button.lnkb { display: inline-flex; align-items: center; min-height: 32px; }
  /* tabelas largas rolam dentro do quadro, sem espremer o texto */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-wrap table { min-width: 100%; }
  /* aviso de "salvo": discreto no celular (só a bolinha); o texto aparece quando está salvando ou sem conexão */
  .sv-status.ok { padding: 7px; gap: 0; }
  .sv-status.ok > span:not(.sv-dot) { display: none; }
  .sv-status { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* ----- aberto pela tela de início (aplicativo instalado) ----- */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  /* sem a barra do navegador, o topo e a base respeitam o entalhe e a barrinha do iPhone */
  .strip { padding-top: max(8px, env(safe-area-inset-top, 0px)); }
  #pops { top: env(safe-area-inset-top, 0px); }
  .toasts, #toasts { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

/* convite para ativar as notificações (tela de Início) */
.sv-convite { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--accent-line, #9cbcff); background: var(--accent-soft, #eaf1ff); margin-bottom: 16px; }
.sv-convite img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.sv-convite b { display: block; margin-bottom: 2px; }
.sv-convite p { margin: 0 0 8px; color: var(--fg-2, #33425f); }
.sv-convite .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-push-ok { color: var(--good, #0e8f62); font-weight: 700; }
.sv-passos-ios { margin: 8px 0 0; padding-left: 20px; }
.sv-passos-ios li { margin: 4px 0; }

/* logo da iHouse (ícone) no lugar do "i" provisório */
img.logo.sv-logo-app { padding: 0; object-fit: cover; background: #0000FE; box-shadow: none; }
.p-logo img.logo.sv-logo-app { width: 28px; height: 28px; border-radius: 7px; }

/* escolha da loja (funcionário com acesso às duas lojas) */
.sv-lojas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.sv-lojas .btn { justify-content: center; padding: 16px 12px; font-size: 16px; }
.seg.sv-loja button { min-height: 32px; }

/* estoques separados: aparelhos · demais produtos · peças */
.est-grupos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.est-g { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, #dfe5f0); background: var(--surface, #fff); color: var(--fg, #0b1222); cursor: pointer; text-align: left; min-width: 0; }
.est-g b { font-size: 14px; }
.est-g small { color: var(--muted, #5b6b85); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.est-g.on { border-color: var(--accent, #1e6bff); background: var(--accent-soft, #eaf1ff); box-shadow: inset 0 0 0 1px var(--accent, #1e6bff); }
@media (max-width: 700px) { .est-grupos { grid-template-columns: 1fr 1fr; } .est-g small { white-space: normal; } }

/* regras da assistência */
.cfg-regra { padding: 10px 0; border-bottom: 1px solid var(--line, #e3e8f2); }
.cfg-regra:last-child { border-bottom: 0; }
.cfg-regra .hint { margin: 4px 0 0 46px; }
.ck-conf { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft, #eaf1ff); }

/* nome do sistema no menu: iHouse · Sistema de Gestão · quem está usando */
.brand small.brand-sis { display: block; font-weight: 700; opacity: .95; }

/* 2.3 · catálogo de modelos e tipo de equipamento */
.field .opc { font-style: normal; color: var(--mut, #667); font-size: 11px; font-weight: 600; margin-left: 4px; }
.eq-campos > .field.span2 { margin-bottom: 10px; }
.eq-campos .chips { flex-wrap: wrap; }
.eq-novo { margin-top: 10px; padding: 12px 14px; border: 1px dashed var(--line, #cdd3e0); border-radius: 12px; background: var(--soft, rgba(0,0,254,.03)); }
.eq-novo h4.sub { margin-top: 0; }
.rel-mod-t td:first-child { font-weight: 600; }
.rel-mod-det { margin: 8px 0 14px; }
.rel-mod-bar { height: 6px; border-radius: 3px; background: var(--line, #e3e7ef); margin-top: 4px; max-width: 240px; overflow: hidden; }
.rel-mod-bar i { display: block; height: 100%; background: var(--accent, #0000FE); border-radius: 3px; }
.rel-mod-t tr.on td { background: var(--soft, rgba(0,0,254,.05)); }

/* ---------- 2.4 ---------- */
/* topo: lupa de pesquisa e número da versão (pequeno e discreto) */
.strip-r { align-items: center; }
.v-lupa { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); font: inherit; font-weight: 700; cursor: pointer; }
.v-lupa:hover { border-color: var(--accent-line); color: var(--accent-strong); }
.v-lupa .ic { width: 16px; height: 16px; }
.v-ver { font-size: 10.5px; font-weight: 600; color: var(--muted); opacity: .6; letter-spacing: .02em; user-select: none; }
.v-ver-login { text-align: center; margin-top: 10px; }
@media (max-width: 760px) { .v-lupa-t { display: none; } .v-lupa { min-width: 40px; min-height: 40px; justify-content: center; } }
/* pesquisa de funções */
.v-busca-m .search { max-width: none; margin-bottom: 10px; }
.v-busca-m .search input { font-size: 16px; padding: 11px 0; }
.v-blist { display: flex; flex-direction: column; gap: 2px; max-height: min(55vh, 460px); overflow-y: auto; }
.v-bg { margin: 10px 4px 4px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.v-bi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; min-height: 44px; }
.v-bi:hover, .v-bi.on { background: var(--accent-soft); border-color: var(--accent-line); }
.v-bi .ic { color: var(--accent-strong); flex: none; }
.v-bi b { display: block; }
.v-bi small { display: block; color: var(--muted); font-size: 12px; }
/* resumo do dia: tudo em ordem */
.v-rs-ok { display: flex; gap: 12px; align-items: center; padding: 18px; border-radius: 14px; background: var(--good-soft); margin-bottom: 14px; }
.v-rs-ok > .ic { color: var(--good); width: 28px; height: 28px; flex: none; }
.v-rs-ok b { display: block; font-size: 15px; }
.v-rs-ok span { color: var(--fg-2); font-size: 13px; }
.v-rs-al { margin-top: 8px; align-items: center; }
/* garantia em vermelho */
.paper .p-gar-ate { color: #C62828; font-weight: 800; font-size: 1.05em; margin: 8px 0 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper .p-gar-ate b { color: inherit; }
.paper .p-gar-ate.p-gar-prev { font-weight: 700; font-size: 1em; }
.paper .p-gar tbody td.n b { color: #C62828; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.gar-ate { color: #C62828; }
/* avisos verdes e pequenos */
.alert.good { background: var(--good-soft); } .alert.good > .ic { color: var(--good); }
.alert.sm { padding: 9px 12px; font-size: 12.5px; }
.v-desc { margin-top: 6px; }
.v-desc .btn-row { margin-top: 8px; }
.v-os-desc { margin-top: 10px; }
/* lista de compras */
.v-lc-form .v-lc-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.v-lc-form .v-lc-row > .field:first-child { flex: 1 1 260px; }
.v-lc-form .v-lc-qf { flex: 0 1 130px; }
.v-lc-form .v-lc-row > .btn { min-height: 42px; }
.v-lc-grid { margin-top: 14px; align-items: start; }
.v-lc-i { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.v-lc-i:last-child { border-bottom: 0; }
.v-lc-i.feito .v-lc-t b { text-decoration: line-through; color: var(--muted); }
.v-lc-t { flex: 1; min-width: 0; }
.v-lc-t b { display: block; overflow-wrap: anywhere; }
.v-lc-t small { display: block; color: var(--muted); font-size: 12px; }
.v-lc-q { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 800; }
.v-lc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.v-lc-ck input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.v-lc-feitos { margin-top: 10px; }
.v-lc-feitos summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 0; }
/* textos de orçamento */
.v-to-mdls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.v-to-m { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; min-height: 64px; }
.v-to-m span { font-size: 12px; color: var(--muted); }
.v-to-m.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.v-to-m.add { border-style: dashed; justify-content: center; align-items: center; flex-direction: row; gap: 6px; color: var(--accent-strong); font-weight: 800; }
.v-to-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 10px; }
.v-to-ed textarea { min-height: 300px; line-height: 1.5; }
.v-to-r { display: flex; flex-direction: column; gap: 2px; }
.v-to-lb { font-size: 12.5px; font-weight: 700; color: var(--fg-2); }
.v-bubble { white-space: pre-wrap; background: #E7F7EC; color: #0C1730; border: 1px solid #BFE3CA; border-radius: 14px 14px 14px 4px; padding: 12px 14px; line-height: 1.5; font-size: 13.5px; min-height: 260px; margin-top: 6px; overflow-wrap: anywhere; }
.chip.v-var code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; color: var(--muted); font-weight: 500; }
.chip small { font-weight: 600; opacity: .85; }
@media (max-width: 860px) { .v-to-ed { grid-template-columns: 1fr; } }
/* orçamento rápido */
.v-orc-back { margin: -4px 0 10px; }
.v-orc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .v-orc { grid-template-columns: 1fr; } }
.v-orc .card { display: flex; flex-direction: column; gap: 12px; }
.v-orc-loja .chips { flex-wrap: wrap; }
.v-orc-busca { position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; }
.v-orc-busca:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.v-orc-busca > .ic { color: var(--muted); flex: none; }
.v-orc-busca input { border: 0; background: transparent; box-shadow: none; padding: 13px 0; font-size: 16px; flex: 1; min-width: 0; }
.v-orc-busca input:focus { box-shadow: none; }
.v-orc-x { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; flex: none; }
.v-orc-x:hover { background: var(--accent-soft); color: var(--fg); }
.v-orc-sug { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg, 0 18px 40px rgba(12,23,48,.18)); overflow: hidden; }
.v-orc-si { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px; min-height: 52px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.v-orc-si:last-child { border-bottom: 0; }
.v-orc-si:hover, .v-orc-si:focus-visible { background: var(--accent-soft); }
.v-orc-si.usar { background: var(--surface-2); }
.v-orc-sv { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.v-orc-sv small { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.v-orc-dica { padding: 10px 14px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin: 0; }
.v-orc-vazio { display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.v-orc-res { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.v-orc-rh { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.v-orc-rh b { font-family: var(--f-display); font-size: 17px; }
.v-tag { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.v-tag.fora { background: var(--warn-soft); color: var(--warn); }
.v-orc-vals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.v-orc-val { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v-orc-val .k { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.v-orc-val .v { font-family: var(--f-display); font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.v-orc-val small { color: var(--muted); font-size: 12px; }
.v-orc-val .k { flex-wrap: wrap; row-gap: 4px; }
select.v-orc-n { flex: none; min-width: 70px; width: auto; padding: 3px 8px; font-size: 14px; font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--accent-strong); border-color: var(--accent-line); background: var(--accent-soft); border-radius: 8px; }
.v-orc-info { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--fg-2); margin: 0; }
.v-orc-info .ic { color: var(--good); flex: none; margin-top: 1px; }
.v-orc-man { margin: 0; }
.v-orc-sep { height: 1px; background: var(--line); }
.v-orc-cli { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.v-orc-cli > div { flex: 1; min-width: 0; }
.v-orc-cli b { display: block; } .v-orc-cli small { display: block; color: var(--muted); }
.v-orc-clis { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.v-orc-clis button { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 52px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--fg); text-align: left; font: inherit; cursor: pointer; }
.v-orc-clis button:last-child { border-bottom: 0; }
.v-orc-clis button:hover { background: var(--accent-soft); }
.v-orc-clis b { display: block; } .v-orc-clis small { display: block; color: var(--muted); font-size: 12px; }
.v-orc-clis .muted { padding: 10px 12px; margin: 0; }
.v-orc-mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v-orc-mh h2 { margin: 0; font-size: 17px; }
.v-orc-tsel { margin: 0; }
.v-orc-tsel select { width: auto; max-width: 260px; }
.v-orc-msg { min-height: 320px; line-height: 1.55; background: #EAF7EE; color: #0C1730; border-color: #BFE3CA; }
.v-orc-ed { font-size: 12.5px; font-weight: 700; color: var(--warn); }
.v-orc-para { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); margin: 0; }
.v-orc-para .ic { color: var(--good); }
.v-orc-falta { font-size: 13px; font-weight: 700; color: var(--warn); margin: 0; }
.v-orc-acts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.v-orc-acts .btn { min-height: 50px; font-size: 15px; justify-content: center; }
.v-orc-links { font-size: 13px; color: var(--muted); margin: 0; }
@media (max-width: 359px) { .v-orc-vals { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .v-orc-acts { grid-template-columns: 1fr; } .v-orc-val .v { font-size: 22px; } .v-orc-busca input { font-size: 16px; } }

.cfg-body .card > .chips + .form-g { margin-top: 10px; }
.v-lc-form h2 { margin-bottom: 8px; }
.rs-b li.v-rs-mais small { color: var(--muted); font-weight: 600; }

/* 2.4.1 · OS começada */
.v-os-desc-bt { margin-top: 8px; }
.v-os-rasc .ic { flex: none; }
