/* FazTudo Pro — app de campo e gestão. Layout: barra lateral fixa no desktop, barra inferior no celular. */
:root {
  --bg: #eef0ec; --surface: #ffffff; --surface-2: #f6f7f4; --line: #d9ddd5; --fg: #1d2420; --muted: #5b655e;
  --primary: #13574a; --primary-fg: #ffffff; --primary-soft: #dcebe6;
  --tape: #f2b705; --tape-fg: #2a2100;
  --ok: #1f7a3f; --warn: #a65f00; --bad: #b42318; --info: #1d4ed8; --violet: #6d3fc0;
  --ok-bg: #e2f3e7; --warn-bg: #fdf1d8; --bad-bg: #fde7e4; --info-bg: #e3ebfd; --violet-bg: #efe8fb; --neutral-bg: #eceee9;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 14px rgba(20, 30, 25, .06);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121614; --surface: #1a201d; --surface-2: #202723; --line: #2f3833; --fg: #e6ebe7; --muted: #9aa69f;
  --primary: #4fb39c; --primary-fg: #08130f; --primary-soft: #1c3a32; --tape: #f5c330; --tape-fg: #241c00;
  --ok: #5ccb83; --warn: #f0b04a; --bad: #ff7b6e; --info: #7da2ff; --violet: #b597f2;
  --ok-bg: #173323; --warn-bg: #3a2a0d; --bad-bg: #3d1915; --info-bg: #182544; --violet-bg: #2a1f42; --neutral-bg: #262d29;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #121614; --surface: #1a201d; --surface-2: #202723; --line: #2f3833; --fg: #e6ebe7; --muted: #9aa69f;
  --primary: #4fb39c; --primary-fg: #08130f; --primary-soft: #1c3a32; --tape: #f5c330; --tape-fg: #241c00;
  --ok: #5ccb83; --warn: #f0b04a; --bad: #ff7b6e; --info: #7da2ff; --violet: #b597f2;
  --ok-bg: #173323; --warn-bg: #3a2a0d; --bad-bg: #3d1915; --info-bg: #182544; --violet-bg: #2a1f42; --neutral-bg: #262d29;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: .01em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.15rem; }
a { color: var(--primary); }
.num, td.n, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
[hidden] { display: none !important; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--tape); color: var(--tape-fg); display: grid; place-items: center; font: 700 1.05rem var(--font-display); }
.brand b { font: 700 1.3rem var(--font-display); display: block; line-height: 1; }
.brand span { font-size: .75rem; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav .badge { margin-left: auto; }
.nav-sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.main { min-width: 0; padding: 20px clamp(16px, 3vw, 32px) 40px; }
.topbar { display: none; }
.bottom { display: none; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; }
  .topbar .brand { padding: 0; } .topbar .brand-mark { width: 30px; height: 30px; }
  .main { padding: 14px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .72rem; color: var(--muted); text-decoration: none; border-radius: 8px; }
  .bottom a.on { color: var(--primary); font-weight: 600; }
  .bottom svg.i { width: 22px; height: 22px; }
}

/* page header */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.crumb { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card h3 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font: 700 1.7rem var(--font-display); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* forms */
label.f, div.f { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 0; }
.fg { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.fg .span2 { grid-column: span 2; } .fg .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fg .span2 { grid-column: 1 / -1; } }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--fg); font-size: .9rem; }
.chks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; min-width: 0; }
legend { font: 700 1rem var(--font-display); padding: 0 6px; }

/* buttons */
.btn { font: 600 .92rem var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-tape { background: var(--tape); border-color: var(--tape); color: var(--tape-fg); }
.btn-tape:hover { background: var(--tape); filter: brightness(1.05); }
.btn-wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn-wa:hover { background: #1f9d55; filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 5px 9px; font-size: .82rem; }
.btn-icon { padding: 6px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* tables */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
tr.sub td { background: var(--surface-2); font-size: .85rem; } tr.sub td:first-child { padding-left: 28px; }
tr.seg td { background: var(--neutral-bg); font: 700 .9rem var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
tr.tot td { font-weight: 700; }
td input.q { width: 84px; text-align: right; padding: 5px 6px; }

/* composição de preço */
.comp { width: 100%; font-size: .9rem; }
.comp td { padding: 5px 8px; }
.comp tr.custo td { font-weight: 600; } .comp tr.sub td, .comp tr.res td { font-weight: 700; border-top: 2px solid var(--line); background: transparent; font-size: .9rem; }
.comp tr.res td { color: var(--ok); } .comp tr.neg td { color: var(--bad); }
.bar { height: 10px; border-radius: 5px; overflow: hidden; display: flex; background: var(--neutral-bg); }
.bar span { display: block; height: 100%; }

/* pills & chips */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--muted); }
.s-enviado { background: var(--info-bg); color: var(--info); }
.s-aguardando { background: var(--warn-bg); color: var(--warn); }
.s-aprovado, .s-concluido { background: var(--ok-bg); color: var(--ok); }
.s-reprovado, .s-cancelado { background: var(--bad-bg); color: var(--bad); }
.s-execucao { background: var(--violet-bg); color: var(--violet); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 700; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: 600 .82rem var(--font); color: var(--fg); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 4px; background: var(--neutral-bg); color: var(--muted); margin: 1px 2px 1px 0; }
.tape-label { display: inline-block; background: var(--tape); color: var(--tape-fg); font: 700 .78rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font: 600 .92rem var(--font); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }

/* listas mobile */
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 600; } .li .s { font-size: .82rem; color: var(--muted); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--fg); margin-bottom: 4px; }

/* alertas */
.alert { border-radius: var(--r); padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

/* fotos */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.foto { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; background: var(--surface-2); max-width: 100%; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto button { position: absolute; top: 4px; right: 4px; }
.foto .cap { position: absolute; left: 0; right: 0; bottom: 0; font-size: .7rem; padding: 2px 6px; background: rgba(0,0,0,.55); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumbs { display: flex; gap: 4px; flex-wrap: wrap; } .thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

/* agenda */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .h { background: var(--surface-2); text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 6px 0; }
.cal .d { background: var(--surface); min-height: 86px; padding: 4px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; border: 0; font: inherit; color: inherit; text-align: left; }
.cal .d.out { background: var(--surface-2); color: var(--muted); }
.cal .d.today .dn { background: var(--primary); color: var(--primary-fg); }
.cal .d.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .dn { font-size: .78rem; font-weight: 700; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.cal .ev { font-size: .7rem; padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); color: var(--primary); }
.cal .ev.retorno { background: var(--warn-bg); color: var(--warn); } .cal .ev.execucao { background: var(--violet-bg); color: var(--violet); }
.cal .more { font-size: .68rem; color: var(--muted); }
@media (max-width: 640px) { .cal .d { min-height: 54px; } .cal .ev { display: none; } .cal .d .dots { display: flex; gap: 2px; } }
.cal .d .dots { display: none; }
.timeline .li .hr { font: 700 1.05rem var(--font-display); font-variant-numeric: tabular-nums; width: 64px; flex: none; }

/* modal */
#modal, #dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
#dialog { z-index: 60; }
.modal-layer { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px; }
.modal-back { position: absolute; inset: 0; background: rgba(10, 16, 13, .55); }
.modal-box { position: relative; background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: calc(100% - 20px); overflow-y: auto; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.modal-box.wide { width: min(980px, 100%); }
.modal-box.small { width: min(460px, 100%); }
.modal-box h3 { font-size: 1.3rem; }
.mh { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dlg-text { color: var(--fg); }
@media (max-width: 640px) { #modal, .modal-layer { padding: 0; align-items: end; } #modal .modal-box { border-radius: 14px 14px 0 0; max-height: 92%; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); } }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100% - 32px)); }
@media (max-width: 860px) { #toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }
.toast { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; }
.toast.t-erro { background: var(--bad); color: #fff; } .toast.t-alerta { background: var(--tape); color: var(--tape-fg); cursor: pointer; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  repeating-linear-gradient(135deg, var(--bg) 0 22px, var(--surface-2) 22px 44px); }
.login .card { width: min(400px, 100%); padding: 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.ruler { height: 14px; background: var(--tape); border-radius: 3px; position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, var(--tape-fg) 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, var(--tape-fg) 0 2px, transparent 2px 50px);
  background-size: 100% 5px, 100% 9px; background-repeat: no-repeat; }

/* orçamento */
.orc-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.orc-total { font: 700 1.6rem var(--font-display); font-variant-numeric: tabular-nums; }
.sticky-actions { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 8px 0; }
@media (max-width: 860px) { .sticky-actions { top: calc(50px + env(safe-area-inset-top, 0px)); } }
.picker-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.picker-list .li { padding: 10px 12px; cursor: pointer; }
.picker-list .li:hover, .picker-list .li.on { background: var(--primary-soft); }
.rev { font: 700 .8rem var(--font-display); background: var(--fg); color: var(--bg); border-radius: 4px; padding: 1px 7px; letter-spacing: .04em; }
.public { max-width: 820px; margin: 0 auto; padding: 24px 16px 60px; }
.logo-prev { width: 120px; height: 80px; object-fit: contain; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); }
@media (prefers-reduced-motion: no-preference) { .modal-box { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(12px); opacity: .6; } } }
.sm-only { display: none; }
@media (max-width: 640px) {
  .hm { display: none; } .sm-only { display: inline; }
  td input.q { width: 62px; }
  .sticky-actions { position: static; }
  .sticky-actions .row > .grow { display: none; }
  .ph h1 { font-size: 1.5rem; }
  td, th { padding: 7px 6px; }
  tr.sub td:first-child { padding-left: 14px; }
}
#app { min-height: 100%; }
.login { min-height: 100vh; min-height: 100dvh; }
.kpi .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .kpi .v { font-size: 1.25rem; } .card.kpi { padding: 12px; } }

.so-celular { display: none; }
@media (max-width: 640px) { .so-celular { display: flex; } .so-pc { display: none; } }
.tag svg.i { width: 12px; height: 12px; vertical-align: -2px; }
/* ocultar valores na tela do orçamento (mostrar ao cliente) */
/* valores ocultos: o texto fica embaçado e um olho mostra o valor ao tocar */
.ocultar-valores td.n:not(:has(input,select,button)):not(.ver), .ocultar-valores .num:not(.ver), .ocultar-valores #hdTotal:not(.ver), .ocultar-valores .orc-total:not(.ver), .ocultar-valores .kpi .v:not(.ver), .ocultar-valores .money:not(.ver) { color: transparent !important; text-shadow: 0 0 9px var(--fg); user-select: none; cursor: pointer; white-space: nowrap; }
.ocultar-valores td.n:not(:has(input,select,button)):not(.ver) *, .ocultar-valores .num:not(.ver) *, .ocultar-valores #hdTotal:not(.ver) *, .ocultar-valores .orc-total:not(.ver) *, .ocultar-valores .kpi .v:not(.ver) *, .ocultar-valores .money:not(.ver) * { color: transparent !important; text-shadow: 0 0 9px var(--fg); }
.ocultar-valores td.n:not(:has(input,select,button)):not(.ver)::after, .ocultar-valores .num:not(.ver)::after, .ocultar-valores #hdTotal:not(.ver)::after, .ocultar-valores .orc-total:not(.ver)::after, .ocultar-valores .kpi .v:not(.ver)::after, .ocultar-valores .money:not(.ver)::after { content: '👁'; color: var(--muted); text-shadow: none; font-size: .8em; margin-left: 4px; opacity: .8; }

.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.btn-ok:hover { filter: brightness(1.08); }

.mais-casas { color: var(--warn); cursor: help; margin-left: 1px; font-weight: 700; }

.custo-destaque { border: 2px solid var(--brand, #13574a); background: color-mix(in srgb, var(--ok) 6%, transparent); }
.in-destaque { font-size: 1.15rem; font-weight: 700; }

/* menu de contexto das linhas do orçamento e grupos */
.ctx-menu{position:fixed;z-index:400;background:var(--card,#fff);border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.18);padding:4px;min-width:200px;display:flex;flex-direction:column}
.ctx-menu button{all:unset;cursor:pointer;padding:9px 12px;border-radius:7px;font-size:.92rem}
.ctx-menu button:hover,.ctx-menu button:focus{background:var(--soft,#eef4f1)}
.ctx-menu button.perigo{color:var(--danger,#b91c1c)}
.ctx-menu hr{border:0;border-top:1px solid var(--line);margin:3px 0}
tr.grp-lin td{background:rgba(19,87,74,.06);border-top:1px solid var(--line)}
tr.em-grupo td:first-child{padding-left:22px}
tr.sel td{background:rgba(242,183,5,.14)}
tr[data-linha]{-webkit-touch-callout:none}
@media (max-width:700px){.sm-hide{display:none}}

/* relatórios e DRE */
.rel-grid{display:grid;grid-template-columns:260px 1fr;gap:12px;align-items:start}
.rel-nav{position:sticky;top:12px;max-height:calc(100vh - 40px);overflow:auto}
.rel-item{display:block;padding:7px 10px;border-radius:8px;color:var(--fg);text-decoration:none;font-size:.9rem}
.rel-item:hover{background:var(--surface-2)}.rel-item.on{background:var(--primary);color:#fff}
@media (max-width:800px){.rel-grid{grid-template-columns:1fr}.rel-nav{position:static;max-height:none}}
.dre table td,.dre table th{white-space:nowrap;font-size:.85rem}
.dre tr.grp td{background:var(--surface-2);cursor:pointer}.dre tr.dre-cat td,.dre tr.dre-cr td{cursor:pointer}
.dre tr.dre-l td{color:var(--muted)}

/* 1.0.0: cabeçalho da página (título e botões) fixo no topo ao rolar */
.main > .ph { position: sticky; top: 0; z-index: 15; background: var(--bg); margin: -8px -4px 16px; padding: 10px 4px 10px; box-shadow: 0 6px 10px -10px rgba(0,0,0,.25); }
@media (max-width: 860px) { .main > .ph { top: calc(50px + env(safe-area-inset-top, 0px)); } }
/* busca digitando (combobox) */
.cbx { position: relative; }
.cbx > input.cbx-in { width: 100%; }
.cbx-lista { position: absolute; left: 0; right: 0; top: 100%; z-index: 450; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16); max-height: 280px; overflow: auto; margin-top: 2px; }
.cbx-lista div { padding: 8px 10px; cursor: pointer; font-size: .92rem; }
.cbx-lista div:hover, .cbx-lista div.on { background: var(--surface-2); }
.cbx-lista div.nada { color: var(--muted); cursor: default; }
input.invalido { border-color: var(--bad) !important; box-shadow: 0 0 0 2px rgba(180,35,24,.15); }
.rateio-saldo { font-weight: 700; } .rateio-saldo.zero { color: var(--ok); } .rateio-saldo.resta { color: var(--warn); }

/* ---------- app do técnico (tela de campo) ---------- */
.campo { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.campo-top { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px; }
.campo-top b { display: block; font: 700 1rem var(--font-display); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campo-top span { font-size: .75rem; color: var(--muted); }
.campo-main { width: 100%; max-width: 720px; margin: 0 auto; padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px)); }
.campo-nav { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
.campo-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; font-size: .78rem; color: var(--muted); text-decoration: none; border-radius: 10px; min-height: 52px; justify-content: center; }
.campo-nav a.on { color: var(--primary); font-weight: 700; background: var(--primary-soft); }
.campo-nav svg.i { width: 26px; height: 26px; }
.campo-nav .badge { position: absolute; top: 2px; right: calc(50% - 22px); }
.campo-ola h1 { margin: 2px 0 0; font-size: 1.5rem; } .campo-ola p { margin: 2px 0 12px; }
.campo-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.campo-sec h2 { margin: 0; font-size: 1.1rem; }
.campo-card { padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.campo-card.feito { opacity: .65; }
.campo-card .btn { min-height: 40px; }
.campo-hora { font: 700 1.05rem var(--font-display); min-width: 50px; color: var(--primary); }
.campo-chips { margin-bottom: 12px; } .campo-chips .chip { padding: 8px 14px; }
.campo-semana { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.campo-dia { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.campo-dia span { font-size: .68rem; color: var(--muted); text-transform: uppercase; } .campo-dia b { font-size: 1.05rem; } .campo-dia i { font-style: normal; font-size: .65rem; color: var(--primary); min-height: .8rem; }
.campo-dia.hoje { border-color: var(--primary); } .campo-dia.on { background: var(--primary); color: #fff; } .campo-dia.on span, .campo-dia.on i { color: #fff; }
.assist-passos { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 4px; }
.assist-passos button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .82rem; white-space: nowrap; cursor: pointer; }
.assist-passos button b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); font-size: .75rem; }
.assist-passos button.on { border-color: var(--primary); color: var(--primary); font-weight: 600; } .assist-passos button.on b { background: var(--primary); color: #fff; }
.assist-passos button.ok b { background: var(--ok); color: #fff; }

/* 1.6.0: relatórios com linhas que abrem e guias */
tr.rel-sub td { background: var(--surface-2); }
tr.rel-sub td:first-child { font-size: .92em; }
.rel-seta { display: inline-block; width: 1em; color: var(--muted); }
.card.guia + .card.guia { margin-top: 0; }
