:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7180;
  --line: #e6e2dc;
  --primary: #23324d;
  --primary-2: #2f4366;
  --accent: #c8553d;
  --ok: #2e7d4f;
  --ok-bg: #e5f3ea;
  --warn: #a86a00;
  --warn-bg: #fdf1dc;
  --bad: #b3261e;
  --bad-bg: #fbe6e4;
  --info-bg: #e7edf7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 35, .06), 0 2px 8px rgba(20, 24, 35, .05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--primary-2); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  background: var(--primary); color: #fff;
  padding: .7rem 1rem;
}
.topbar .brand { font-weight: 700; letter-spacing: .2px; }
.topbar .brand span { color: #f2b8a8; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .9rem; opacity: .9; }
.icon-btn {
  background: transparent; border: 0; color: inherit; cursor: pointer;
  padding: .35rem .5rem; border-radius: 8px; font-size: 1.2rem; line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- Abas ---------- */
.tabs {
  display: flex; gap: .25rem; overflow-x: auto;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 .5rem; position: sticky; top: 52px; z-index: 15;
}
.tabs button {
  background: none; border: 0; padding: .8rem .9rem; cursor: pointer;
  font: inherit; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs button.ativo { color: var(--primary); border-bottom-color: var(--accent); font-weight: 600; }
.subtabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.subtabs button {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .35rem .85rem; cursor: pointer; font: inherit; font-size: .9rem;
}
.subtabs button.ativo { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Layout ---------- */
main { padding: 1rem; max-width: 1100px; margin: 0 auto; }
.grid { display: grid; gap: .8rem; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1rem; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 0; }
.section { margin-bottom: 1.5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.kpi .rotulo { color: var(--muted); font-size: .82rem; }
.kpi .valor { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.destaque { background: var(--primary); color: #fff; border-color: var(--primary); }
.kpi.destaque .rotulo { color: #cfd6e4; }

/* ---------- Lote ---------- */
.lote-topo { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.lote-titulo { font-weight: 700; }
.lote-linha { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.lote-linha:last-of-type { border-bottom: 0; }
.lote-total { margin-top: .6rem; padding: .6rem .75rem; border-radius: 10px; background: var(--info-bg); display: flex; justify-content: space-between; font-weight: 700; }
.progresso { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .6rem 0 .3rem; display: flex; }
.progresso .ap { background: var(--ok); }
.progresso .co { background: #e0a43a; }
.legenda { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.acoes { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .75rem; }

/* ---------- Selos ---------- */
.selo { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.selo.enviado { background: var(--info-bg); color: var(--primary-2); }
.selo.recebido { background: #ece7f7; color: #57407f; }
.selo.em_producao { background: var(--warn-bg); color: var(--warn); }
.selo.concluido, .selo.pago, .selo.conferida { background: var(--ok-bg); color: var(--ok); }
.selo.cancelado, .selo.atrasado, .selo.inativo { background: var(--bad-bg); color: var(--bad); }
.selo.pendente, .selo.aberto { background: var(--warn-bg); color: var(--warn); }

/* ---------- Tabela ---------- */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- Formulários ---------- */
.linha { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: .7rem; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .2rem; font-weight: 500; }
input, select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #d6d1c9; border-radius: 9px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 67, 102, .25); border-color: var(--primary-2); }
textarea { min-height: 70px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: .55rem .95rem; border-radius: 9px; border: 1px solid transparent;
  background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--primary); border-color: #cfd5e0; }
.btn.sec:hover { background: #f2f4f8; }
.btn.ok { background: var(--ok); }
.btn.perigo { background: #fff; color: var(--bad); border-color: #efc4c0; }
.btn.acento { background: var(--accent); }
.btn.peq { padding: .35rem .65rem; font-size: .82rem; }
.btn.bloco { width: 100%; }

/* ---------- Modal ---------- */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(20, 24, 35, .45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 1.1rem 1.1rem 1.4rem;
}
@media (min-width: 640px) {
  .modal-fundo { align-items: center; padding: 1rem; }
  .modal { border-radius: 16px; }
}
.modal-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }

/* ---------- Avisos ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: .7rem 1rem; border-radius: 10px;
  z-index: 100; max-width: 92vw; box-shadow: var(--shadow); font-size: .92rem;
}
#toast.erro { background: var(--bad); }
.vazio { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.alerta { padding: .7rem .9rem; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-bottom: 1rem; font-size: .9rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card .marca { text-align: center; margin-bottom: 1.2rem; }
.login-card .marca .ponto { font-size: 2rem; }

/* ---------- Menu lateral (mão de obra) ---------- */
.lateral {
  position: fixed; top: 0; left: 0; bottom: 0; width: 320px; max-width: 88vw;
  background: var(--card); z-index: 40; overflow-y: auto;
  transform: translateX(-100%); transition: transform .22s ease;
  border-right: 1px solid var(--line); padding: 1rem;
}
.lateral.aberta { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
.lateral-fundo { position: fixed; inset: 0; background: rgba(20,24,35,.35); z-index: 35; }
.lateral .bloco { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin-bottom: .7rem; }
.lateral .bloco h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); margin-bottom: .35rem; }
.lateral .par { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.lateral .grande { font-size: 1.3rem; font-weight: 700; }
.lateral .acumulado { background: var(--primary); color: #fff; border-color: var(--primary); }
.lateral .acumulado h3 { color: #cfd6e4; }
.lateral ul { list-style: none; margin: .4rem 0 0; padding: 0; }
.lateral li { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; padding: .3rem 0; border-top: 1px dashed var(--line); }

@media (min-width: 1000px) {
  body.com-lateral .lateral { transform: none; box-shadow: none; top: 52px; }
  body.com-lateral main { margin-left: 320px; max-width: none; }
  body.com-lateral .lateral-fundo { display: none; }
  body.com-lateral.lateral-recolhida .lateral { transform: translateX(-100%); }
  body.com-lateral.lateral-recolhida main { margin-left: auto; max-width: 1100px; }
}

@media print {
  .topbar, .tabs, .subtabs, .acoes, .btn, .nao-imprimir { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* =====================================================================
   PAINEL DO DONO — versão 2
   ===================================================================== */
:root { --amarelo: #f5c518; --cinza-btn: #9ca0a8; }
.nav-dono {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .25rem; flex-wrap: wrap;
  background: var(--primary); color: #fff; padding: .35rem 1rem; min-height: 52px;
  border-bottom: 3px solid #1a2640;
}
.nav-dono .abas { display: flex; gap: .2rem; overflow-x: auto; flex: 1; }
.nav-dono .abas button {
  background: none; border: 0; color: #fff; font: inherit; font-weight: 700; font-size: .86rem;
  letter-spacing: .3px; text-transform: uppercase; padding: .7rem .85rem; cursor: pointer; white-space: nowrap;
  border-radius: 8px;
}
.nav-dono .abas button:hover { background: rgba(255,255,255,.08); }
.nav-dono .abas button.ativo { color: var(--amarelo); }
.nav-dono .usuario { display: flex; align-items: center; gap: .35rem; font-size: .88rem; opacity: .95; }
body.dono { background: #fff; min-height: 100vh; }
html:has(body.dono) { background: #fff; }
body.dono main { max-width: 1150px; }
.titulo-pagina { text-align: center; font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin: 1.2rem 0 .3rem; }
.data-hoje { font-weight: 700; font-size: .92rem; margin-bottom: .5rem; }

.grade-nomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.1rem; margin: .4rem 0 1.5rem; }
.btn-nome {
  background: var(--primary); color: #fff; border: 0; border-radius: 9px; min-height: 60px;
  font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; cursor: pointer; padding: .6rem;
  box-shadow: 0 2px 6px rgba(20,24,35,.12); transition: transform .08s ease, box-shadow .15s ease;
}
.btn-nome:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(20,24,35,.18); }
.btn-nome small { display: block; font-weight: 500; text-transform: none; font-size: .76rem; opacity: .85; margin-top: .15rem; letter-spacing: 0; }
.btn-nome.inativo { background: var(--cinza-btn); color: #1f2430; font-weight: 600; box-shadow: none; }

.modal.largo { max-width: 860px; }
.ficha-topo { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ficha-contato { font-size: .88rem; color: var(--muted); }
.ficha-contato a { color: var(--ok); font-weight: 600; text-decoration: none; }
.totais { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.total { border-radius: 10px; padding: .7rem .85rem; background: #f4f6fa; border: 1px solid var(--line); }
.total .r { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }
.total .v { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.total.escuro { background: var(--primary); color: #fff; border-color: var(--primary); }
.total.escuro .r { color: #cfd6e4; }
.total.amarelo { background: #fff8db; border-color: #f2d978; }

.mini-lote { border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: 10px; padding: .65rem .8rem; margin-bottom: .55rem; background: #fff; }
.mini-lote .linha1 { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; font-weight: 700; }
.mini-lote .linha1 .valor { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-lote .linha2 { font-size: .84rem; color: var(--muted); margin-top: .15rem; }
.mini-lote .acoes { margin-top: .5rem; }
.btn.pronto { background: var(--ok); text-transform: uppercase; letter-spacing: .3px; }
.lista-final { list-style: none; padding: 0; margin: 0; }
.lista-final li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.lista-final li:last-child { border-bottom: 0; }
.soma-final { display: flex; justify-content: space-between; margin-top: .6rem; padding: .7rem .9rem; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-weight: 800; font-size: 1.05rem; }
.selo.pronto { background: var(--ok-bg); color: var(--ok); }
.selo.parcial { background: var(--info-bg); color: var(--primary-2); }

.produto-card .servico-linha { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr auto; gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.produto-card .servico-linha.cab { font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; padding-bottom: .2rem; }
.produto-card .servico-linha.cab span:last-child { width: 58px; }
.produto-card .servico-linha:last-of-type { border-bottom: 0; }
.produto-card .novo-servico { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: .45rem; margin-top: .6rem; }
.produto-card .inativo { opacity: .5; }

.calc { max-width: 320px; }
.calc .visor { background: var(--primary); color: #fff; border-radius: 10px; padding: .7rem .9rem; text-align: right; margin-bottom: .6rem; min-height: 76px; }
.calc .visor .conta { font-size: .85rem; opacity: .7; min-height: 1.2em; word-break: break-all; }
.calc .visor .numero { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.calc .teclas { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.calc .teclas button { font: inherit; font-size: 1.15rem; font-weight: 600; padding: .8rem 0; border-radius: 10px; border: 1px solid var(--line); background: #f4f6fa; cursor: pointer; }
.calc .teclas button:hover { background: #e9edf4; }
.calc .teclas .op { background: #e7edf7; color: var(--primary); }
.calc .teclas .igual { background: var(--amarelo); border-color: var(--amarelo); }
.calc .teclas .limpar { color: var(--bad); }
.grid-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.item-lote { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .75rem .5rem; margin-bottom: .6rem; background: #fafbfd; }
.item-lote .linha { margin-bottom: .5rem; }
.item-sub { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.item-sub .item-total { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.grid.cards-largos { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
@media (max-width: 560px) { .grid.cards-largos { grid-template-columns: 1fr; } .produto-card .servico-linha { grid-template-columns: 1fr 1fr 1fr; } .produto-card .servico-linha > :nth-child(4) { display: none; } .produto-card .novo-servico { grid-template-columns: 1fr 1fr; } }
.lucro-pos { color: var(--ok); font-weight: 700; }
.lucro-neg { color: var(--bad); font-weight: 700; }
.total.verde { background: var(--ok-bg); border-color: #bfe3cb; }
.total.verde .v { color: var(--ok); }
.mini-lote.entrada { border-left-color: var(--amarelo); }

/* Fechamentos em cartões (nome em cima, valor embaixo) */
.grade-fech { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.4rem 1.2rem; margin: .8rem 0 1.5rem; }
.cartao-fech { position: relative; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; transition: transform .08s ease; }
.cartao-fech:hover { transform: translateY(-2px); }
.cartao-fech .nome, .cartao-fech .valor { background: var(--primary); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(20,24,35,.14); }
.cartao-fech .nome { min-height: 58px; font-weight: 700; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .3px; padding: .4rem; text-align: center; }
.cartao-fech .valor { min-height: 50px; font-size: 1.35rem; font-weight: 800; gap: .35rem; font-variant-numeric: tabular-nums; }
.cartao-fech .valor b { color: #22e33f; }
.cartao-fech.zerado .valor b { color: #c9d1de; }
.cartao-fech .tag-pago { position: absolute; top: -9px; right: -6px; background: var(--amarelo); color: #1f2430; font-size: .68rem; font-weight: 800; padding: .15rem .45rem; border-radius: 99px; letter-spacing: .4px; }

/* Nota de pagamento */
.nota-previa { border: 1px dashed #c7cfdc; border-radius: 12px; padding: .8rem .9rem; background: #fbfcfe; }
.nota-previa .nota-topo { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; border-bottom: 2px solid var(--primary); padding-bottom: .35rem; margin-bottom: .45rem; }
.check-whats { display: flex; gap: .5rem; align-items: center; margin: .2rem 0 .8rem; font-size: .9rem; color: var(--text); }
.check-whats input { width: auto; }
.check-whats.desab { color: var(--muted); }
.nota-item { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; margin-bottom: .55rem; background: #fff; display: flex; justify-content: space-between; gap: .6rem; align-items: center; flex-wrap: wrap; }
.nota-item.nao-lida { border-color: #f2d978; background: #fffbea; }
.barra-periodo { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .3rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.ativo { background: var(--primary); color: var(--amarelo); }
.nav-periodo { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.nav-periodo strong { min-width: 160px; text-align: center; }
.cartao-fech .nome { flex-direction: column; }
.cartao-fech .nome small { font-size: .66rem; font-weight: 600; opacity: .7; letter-spacing: .3px; margin-top: .1rem; }
.cartao-fech .extra { font-size: .74rem; color: var(--muted); text-align: center; min-height: 1.1em; }
tr.subtotal td { font-weight: 600; background: #f6f8fb; font-size: .88rem; }
@media print { #cardPagamentos, .grid-admin { display: none; } }

/* =====================================================================
   PAINEL DA MÃO DE OBRA — celular
   ===================================================================== */
body.mo { background: #f3f4f7; }
body.mo main { max-width: 640px; padding: 1rem .9rem 2rem; }
.mo-ola { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .7rem; }
.mo-ola h1 { margin: 0; font-size: 1.35rem; }
.mo-hero { background: var(--primary); color: #fff; border-radius: 16px; padding: 1rem 1.1rem 1.05rem; box-shadow: 0 6px 18px rgba(35,50,77,.25); }
.mo-hero .r { font-size: .78rem; font-weight: 700; letter-spacing: .6px; opacity: .8; }
.mo-hero .v { font-size: 2.3rem; font-weight: 800; color: #22e33f; font-variant-numeric: tabular-nums; line-height: 1.15; margin: .1rem 0 .7rem; }
.mo-hero-linha { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; border-top: 1px solid rgba(255,255,255,.15); padding-top: .65rem; }
.mo-hero-linha span { display: block; font-size: .7rem; opacity: .75; line-height: 1.2; }
.mo-hero-linha strong { font-size: .98rem; font-variant-numeric: tabular-nums; }
.mo-alerta { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: .8rem; padding: .8rem 1rem; border-radius: 12px;
  border: 1px solid #f2d978; background: #fff8db; font: inherit; font-weight: 600; color: #6b5200; cursor: pointer; text-align: left; }
.mo-alerta span { font-weight: 800; }
.mo-abas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; background: #e4e7ee; padding: .3rem; border-radius: 12px; margin: 1rem 0 .8rem; }
.mo-abas button { border: 0; background: none; padding: .6rem .3rem; border-radius: 9px; font: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; }
.mo-abas button.ativo { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(20,24,35,.12); }
.mo-abas b { display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 99px; background: var(--primary); color: #fff; font-size: .75rem; }
.mo-abas b.novo { background: var(--accent); }
.mo-lote { background: #fff; border-radius: 14px; padding: .95rem 1rem; margin-bottom: .75rem; box-shadow: 0 1px 4px rgba(20,24,35,.08); border-left: 6px solid var(--primary); }
.mo-lote.avisado { border-left-color: var(--amarelo); }
.mo-lote-topo { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.mo-lote .prod { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.mo-lote .serv { font-size: 1.3rem; font-weight: 800; text-transform: uppercase; line-height: 1.15; }
.mo-lote .valor { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mo-lote-info { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.mo-lote-info strong { color: var(--text); }
.mo-barra { height: 10px; background: #e7eaf0; border-radius: 99px; overflow: hidden; margin: .6rem 0 .1rem; }
.mo-barra div { height: 100%; background: var(--ok); border-radius: 99px; }
.mo-obs { margin-top: .5rem; font-size: .88rem; background: #f6f7fa; border-radius: 8px; padding: .45rem .6rem; }
.mo-btn-terminei { width: 100%; margin-top: .8rem; padding: .8rem; font-size: 1rem; background: var(--ok); }
.mo-btn-terminei:hover { background: #276b44; }
.mo-avisado { margin-top: .8rem; padding: .65rem .75rem; border-radius: 10px; background: #fff8db; color: #6b5200; font-size: .9rem; font-weight: 600; }
.mo-avisado .link { display: block; margin-top: .3rem; background: none; border: 0; padding: 0; color: var(--bad); font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; }
@media (max-width: 380px) { .mo-hero .v { font-size: 2rem; } .mo-lote .serv { font-size: 1.15rem; } }

/* Aviso "terminou" no painel do dono */
.aviso-terminou { margin-top: .45rem; padding: .45rem .6rem; border-radius: 8px; background: #fff8db; color: #6b5200; font-size: .86rem; font-weight: 600; display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-nome .bandeira { display: inline-block; margin-top: .25rem; background: var(--amarelo); color: #1f2430; border-radius: 99px; font-size: .68rem; font-weight: 800; padding: .08rem .45rem; text-transform: none; letter-spacing: 0; }
.lista-avisos { margin-bottom: 1rem; }
.lista-avisos .card { border-color: #f2d978; background: #fffcf0; }

/* =====================================================================
   PAINEL DO DONO — versão celular
   ===================================================================== */
.marca-celular, .nav-baixo, .fab { display: none; }
.menu-mais { display: flex; flex-direction: column; gap: .5rem; }
.menu-mais button { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .95rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font: inherit; font-weight: 700; font-size: 1rem; text-align: left; cursor: pointer; color: var(--text); }
.menu-mais button i { font-style: normal; font-size: 1.3rem; width: 1.6rem; text-align: center; }
.menu-mais button.sair { color: var(--bad); }

@media (max-width: 760px) {
  body.dono { padding-bottom: 84px; }
  body.dono main { padding: .8rem .8rem 1.5rem; }
  .nav-dono { padding: .55rem .9rem; min-height: 54px; }
  .nav-dono .abas { display: none; }
  .marca-celular { display: block; flex: 1; font-weight: 800; color: var(--amarelo); letter-spacing: .3px; }
  .nav-dono .usuario #quem { font-weight: 600; }
  .titulo-pagina { font-size: 1.1rem; margin: .6rem 0 .2rem; }

  /* Barra de baixo */
  .nav-baixo { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--primary); padding: .3rem .3rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(20,24,35,.18); }
  .nav-baixo button { background: none; border: 0; color: #c9d1de; font: inherit; font-size: .72rem; font-weight: 700; padding: .35rem 0; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; gap: .1rem; cursor: pointer; }
  .nav-baixo button i { font-style: normal; font-size: 1.35rem; line-height: 1.2; }
  .nav-baixo button.ativo { color: var(--amarelo); background: rgba(255,255,255,.07); }

  /* Botão flutuante */
  .fab { display: block; position: fixed; right: 1rem; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31; border: 0; border-radius: 99px;
    padding: .85rem 1.2rem; background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 1rem; box-shadow: 0 6px 16px rgba(200,85,61,.45); cursor: pointer; }
  .fab.hidden { display: none; }
  #btnNovoLote { display: none; }

  /* Início */
  .grade-nomes { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .btn-nome { min-height: 74px; font-size: .95rem; }
  .grade-fech { grid-template-columns: 1fr 1fr; gap: 1rem .7rem; }
  .cartao-fech .valor { font-size: 1.15rem; }
  .totais { grid-template-columns: 1fr 1fr; }
  .total .v { font-size: 1.1rem; }

  /* Janelas: a ficha e as janelas largas ocupam a tela toda */
  .modal.largo { max-width: none; height: 100%; max-height: 100%; border-radius: 0; padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); }
  .modal-fundo:has(.modal.largo) { align-items: stretch; }
  .mini-lote .acoes .btn { flex: 1; padding: .7rem .6rem; font-size: .9rem; }
  .btn.pronto { min-height: 44px; }

  /* Tabelas viram listas */
  body.dono .tabela-wrap { overflow: visible; }
  body.dono table, body.dono thead, body.dono tbody, body.dono tfoot, body.dono tr, body.dono td { display: block; width: 100%; }
  body.dono thead { display: none; }
  body.dono tr { border: 1px solid var(--line); border-radius: 10px; padding: .35rem .7rem; margin-bottom: .5rem; background: #fff; }
  body.dono tr.subtotal, body.dono tfoot tr { background: #f6f8fb; }
  body.dono td { display: flex; justify-content: space-between; gap: .8rem; border: 0; padding: .3rem 0; text-align: right; }
  body.dono td.right { text-align: right; }
  body.dono td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 700; text-align: left; flex-shrink: 0; }
  body.dono td:not([data-label])::before { content: none; }
  body.dono td:empty { display: none; }
  body.dono td input { max-width: 120px; }
}

/* =====================================================================
   VISUAL NOVO (v6) — menu lateral, Início em 3 seções
   ===================================================================== */
body.v2 {
  --sb: #172238; --navy: #23324d; --navy-2: #2f4366; --cinza-tile: #a3abb9;
  --amarelo: #f5c518; --verde-v: #3ee05a; --fundo: #f3f5f9; --borda: #e3e7ee; --txt: #172238; --txt-2: #5b6478;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo); color: var(--txt); min-height: 100vh;
}
html:has(body.v2) { background: #f3f5f9; }
body.v2 h1, body.v2 h2, body.v2 h3 { font-family: Manrope, Inter, sans-serif; color: var(--txt); }
body.v2 .card { border: 1px solid var(--borda); border-radius: 14px; box-shadow: 0 1px 2px rgba(23,34,56,.04); }
body.v2 .btn { border-radius: 10px; font-weight: 600; }
body.v2 .btn.acento { background: var(--amarelo); color: var(--sb); border-color: var(--amarelo); }
body.v2 .btn.acento:hover { background: #e9ba0c; }
body.v2 .btn:not(.sec):not(.perigo):not(.ok):not(.acento):not(.pronto):not(.mo-btn-terminei) { background: var(--navy); }
body.v2 input, body.v2 select, body.v2 textarea { border-color: #dfe3ea; border-radius: 10px; }
body.v2 button.link { background: none; border: 0; padding: 0; color: var(--navy-2); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--sb); color: #c9d1de; display: flex; flex-direction: column; padding: 1.2rem .9rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-marca { display: flex; align-items: center; gap: .7rem; padding: 0 .4rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .6rem; }
.sb-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--amarelo); display: grid; place-items: center; flex-shrink: 0; }
.sb-logo.pequeno { width: 36px; height: 36px; border-radius: 10px; }
.sb-nome { font-family: Manrope, sans-serif; font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: .4px; }
.sb-sub { font-size: .74rem; color: #8f9ab0; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sb-grupo { font-size: .66rem; font-weight: 700; letter-spacing: 1.1px; color: #6f7b93; padding: .9rem .7rem .35rem; }
.sidebar nav button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .62rem .75rem; border: 0; border-radius: 10px; background: none;
  color: #c9d1de; font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-align: left; position: relative; }
.sidebar nav button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav button.ativo { background: rgba(245,197,24,.12); color: var(--amarelo); font-weight: 700; }
.sidebar nav button.ativo::before { content: ""; position: absolute; left: -.9rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amarelo); }
.sb-usuario { display: flex; align-items: center; gap: .55rem; padding: .7rem .6rem; margin-top: .8rem; border-radius: 12px; background: rgba(255,255,255,.05); }
.sb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-2); color: var(--amarelo); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.sb-quem { flex: 1; min-width: 0; line-height: 1.2; }
.sb-quem div { color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-quem span { font-size: .72rem; color: #8f9ab0; }
.sb-icone { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: #8f9ab0; cursor: pointer; display: grid; place-items: center; }
.sb-icone:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.area { flex: 1; min-width: 0; }
body.v2 main { max-width: 1240px; padding: 1.6rem 2rem 2.5rem; margin: 0; }
.topo-celular { display: none; }

.topo-pagina { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.topo-pagina h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.topo-pagina p { margin: .2rem 0 0; color: var(--txt-2); font-size: .9rem; max-width: 640px; }
.topo-pagina p::first-letter { text-transform: uppercase; }
.topo-acoes { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.busca { display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 0 .7rem; margin: 0; height: 40px; }
.busca svg { width: 17px; height: 17px; fill: none; stroke: var(--txt-2); stroke-width: 2; stroke-linecap: round; }
.busca input { border: 0 !important; outline: 0 !important; padding: 0; width: 190px; background: none; font-size: .9rem; }
.sino { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--borda); background: #fff; cursor: pointer; display: grid; place-items: center; }
.sino svg { width: 19px; height: 19px; fill: none; stroke: var(--txt); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sino b { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: .7rem; display: grid; place-items: center; }
body.v2 #btnNovoLote { height: 40px; }

.kpis-v2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi-v2 { background: #fff; border: 1px solid var(--borda); border-radius: 14px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi-v2 span { font-size: .78rem; color: var(--txt-2); font-weight: 600; }
.kpi-v2 strong { font-family: Manrope, sans-serif; font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-v2 small { font-size: .76rem; color: var(--txt-2); }
.kpi-v2.escuro { background: var(--navy); border-color: var(--navy); }
.kpi-v2.escuro span, .kpi-v2.escuro small { color: #aeb8cb; }
.kpi-v2.escuro strong { color: var(--verde-v); }
.kpi-v2.amarelo { background: #fff8db; border-color: #f2d978; }

.secao-inicio { background: #fff; border: 1px solid var(--borda); border-radius: 16px; padding: 1.1rem 1.2rem 1.2rem; margin-bottom: 1.1rem; }
.secao-cab { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.secao-cab h2 { font-size: 1.05rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .5rem; }
.secao-cab h2 + span { font-size: .8rem; color: var(--txt-2); margin-left: 1.15rem; }
.secao-acoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.secao-total { font-size: .85rem; color: var(--txt-2); }
.secao-total strong { color: var(--txt); font-family: Manrope, sans-serif; font-size: 1rem; margin-left: .3rem; }
.ponto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.ponto.externa { background: var(--navy); } .ponto.interna { background: #5b7bb5; } .ponto.fixos { background: var(--amarelo); }
.secao-vazia { padding: 1rem; border: 1px dashed #d4dae4; border-radius: 12px; text-align: center; color: var(--txt-2); font-size: .9rem; }

body.v2 .grade-nomes { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin: 0; }
body.v2 .btn-nome { position: relative; background: var(--navy); color: #fff; border: 0; border-radius: 12px; min-height: 82px; padding: .7rem .6rem;
  font-family: Manrope, sans-serif; font-weight: 800; font-size: 1rem; letter-spacing: .3px; box-shadow: 0 2px 6px rgba(23,34,56,.16); cursor: pointer; }
body.v2 .btn-nome small { font-family: Inter, sans-serif; color: #c9d1de; opacity: 1; }
body.v2 .btn-nome.interna { background: var(--navy-2); }
body.v2 .btn-nome.fixo { background: #fff; color: var(--txt); border: 1.5px solid var(--borda); box-shadow: none; }
body.v2 .btn-nome.fixo small { color: var(--txt-2); }
body.v2 .btn-nome.inativo { background: var(--cinza-tile); color: #fff; box-shadow: none; }
body.v2 .btn-nome.inativo small { color: #eef1f5; }
.tag-hora { position: absolute; top: 6px; right: 8px; font-size: .8rem; opacity: .85; }

/* Fechamentos v2 */
body.v2 .grade-fech { margin: 0; gap: 1.1rem 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
body.v2 .cartao-fech .nome, body.v2 .cartao-fech .valor { background: var(--navy); border-radius: 10px; }
body.v2 .cartao-fech.interna .nome, body.v2 .cartao-fech.interna .valor { background: var(--navy-2); }
body.v2 .cartao-fech .nome { font-family: Manrope, sans-serif; }
body.v2 .cartao-fech .valor b { color: var(--verde-v); }
body.v2 .cartao-fech.zerado .valor b { color: #c9d1de; }
body.v2 .seg { border-color: var(--borda); background: #fff; }
body.v2 .seg button.ativo { background: var(--navy); color: var(--amarelo); }
body.v2 .barra-periodo { margin-bottom: 1rem; }

/* Cadastro */
.filtros-cad { margin-bottom: 1rem; }
.filtros-cad b { display: inline-block; min-width: 1.5em; padding: 0 .4em; margin-left: .25rem; border-radius: 99px; background: #eef1f6; color: var(--txt-2); font-size: .72rem; }
.filtros-cad button.ativo b { background: rgba(245,197,24,.2); color: var(--amarelo); }
.chip-tipo { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 700; background: #e7edf7; color: var(--navy); }
.chip-tipo.interna { background: #e3eafa; color: #3d5a94; }
.sub-cad { font-size: 1.05rem; margin: 1.4rem 0 .6rem; }

/* Administrativo: tipos de mão de obra */
.tipos-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.tipo-card { border: 1.5px solid var(--borda); border-radius: 14px; padding: .95rem 1rem; background: #fafbfd; transition: border-color .15s, background .15s; }
.tipo-card.on { border-color: var(--navy); background: #fff; box-shadow: 0 2px 8px rgba(23,34,56,.08); }
.tipo-card:not(.on) > :not(.tipo-topo) { opacity: .45; }
.tipo-topo { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.tipo-topo strong { font-family: Manrope, sans-serif; font-size: .98rem; }
.tipo-card p { font-size: .84rem; color: var(--txt-2); margin: .35rem 0 .7rem; }
.tipo-card label.mini { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.tipo-nota { font-size: .8rem; background: #fff8db; color: #6b5200; border-radius: 8px; padding: .45rem .6rem; }
.switch { position: relative; display: inline-block; width: 44px; height: 25px; margin: 0; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfd5df; border-radius: 99px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: #2e9d55; }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:focus-visible + span { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.seg-radio { display: flex; width: 100%; }
.seg-radio label { flex: 1; margin: 0; cursor: pointer; }
.seg-radio label + label { border-left: 1px solid var(--borda); }
.seg-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-radio span { display: block; text-align: center; padding: .5rem .4rem; font-size: .84rem; font-weight: 600; color: var(--txt-2); }
.seg-radio input:checked + span { background: var(--navy); color: var(--amarelo); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--navy-2); outline-offset: -2px; }

@media (max-width: 1100px) {
  .kpis-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { width: 216px; }
}
@media (max-width: 900px) { .tipos-grade { grid-template-columns: 1fr; } }

/* ---------- Celular do dono ---------- */
@media (max-width: 760px) {
  .sidebar { display: none; }
  body.v2 main { padding: .9rem .85rem 1.5rem; }
  .topo-celular { display: flex; align-items: center; gap: .7rem; position: sticky; top: 0; z-index: 25; background: var(--sb); color: #fff;
    padding: calc(.65rem + env(safe-area-inset-top)) .95rem .7rem; }
  .tc-texto { flex: 1; line-height: 1.2; min-width: 0; }
  .tc-texto strong { display: block; font-family: Manrope, sans-serif; font-size: 1.02rem; }
  .tc-texto span { font-size: .75rem; color: #aeb8cb; }
  .tc-texto span::first-letter { text-transform: uppercase; }
  .tc-sino { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); display: grid; place-items: center; cursor: pointer; }
  .tc-sino svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tc-sino i { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: #e5484d; border: 2px solid var(--sb); }

  .topo-pagina { margin-bottom: .9rem; align-items: stretch; }
  .topo-pagina h1 { font-size: 1.3rem; }
  .topo-pagina p { font-size: .82rem; }
  .topo-acoes { width: 100%; }
  .topo-acoes .busca { flex: 1; }
  .busca input { width: 100%; }
  body.v2 .sino, body.v2 #btnNovoLote { display: none; }
  .topo-acoes:empty { display: none; }

  .kpis-v2 { grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
  .kpi-v2 { padding: .75rem .8rem; border-radius: 12px; }
  .kpi-v2 strong { font-size: 1.2rem; }
  .kpi-v2 small { display: none; }
  .secao-inicio { padding: .85rem .8rem .9rem; border-radius: 14px; }
  .secao-cab { margin-bottom: .7rem; }
  body.v2 .grade-nomes { grid-template-columns: 1fr 1fr; gap: .6rem; }
  body.v2 .btn-nome { min-height: 74px; font-size: .92rem; }
  body.v2 .grade-fech { grid-template-columns: 1fr 1fr; gap: .9rem .6rem; }
  .tipos-grade { grid-template-columns: 1fr; }

  /* Barra de baixo clara com ícones */
  body.v2 .nav-baixo { background: #fff; border-top: 1px solid var(--borda); box-shadow: 0 -4px 14px rgba(23,34,56,.08); }
  body.v2 .nav-baixo button { color: #8a93a6; }
  body.v2 .nav-baixo button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body.v2 .nav-baixo button.ativo { color: var(--navy); background: #eef2f8; }
  body.v2 .fab { background: var(--amarelo); color: var(--sb); box-shadow: 0 6px 16px rgba(245,197,24,.45); }
}
@media print { .sidebar, .topo-celular, .nav-baixo, .fab { display: none !important; } }
body.v2 td a { white-space: nowrap; }
@media (max-width: 760px) { .pg-inicio .so-pc { display: none; } }

/* ---------- Painel da mão de obra (visual novo) ---------- */
body.mo2 { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.mo2-topo { background: var(--sb); color: #fff; padding: calc(.8rem + env(safe-area-inset-top)) 1rem 1.1rem; border-radius: 0 0 22px 22px; }
.mo2-topo > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.mo2-linha { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.mo2-linha .tc-texto { flex: 1; line-height: 1.2; }
.mo2-linha .tc-texto strong { display: block; font-family: Manrope, sans-serif; font-size: 1.08rem; }
.mo2-linha .tc-texto span { font-size: .74rem; color: #aeb8cb; }
.mo2-data { font-size: .8rem; font-weight: 700; color: var(--amarelo); background: rgba(255,255,255,.08); padding: .3rem .6rem; border-radius: 99px; }
.mo2-hero { background: var(--navy); border-radius: 16px; padding: 1rem 1.1rem; }
.mo2-hero .r { font-size: .72rem; font-weight: 700; letter-spacing: .8px; color: #aeb8cb; }
.mo2-hero .v { display: block; font-family: Manrope, sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--verde-v); line-height: 1.15; margin: .1rem 0 .75rem; font-variant-numeric: tabular-nums; }
.mo2-hero-linha { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: .65rem; }
.mo2-hero-linha span { display: block; font-size: .68rem; color: #aeb8cb; line-height: 1.2; }
.mo2-hero-linha strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.mo2-topo .mo-alerta { margin-top: .7rem; }
body.mo2 main { max-width: 640px; padding: 1rem .9rem 1.5rem; margin: 0 auto; }
.mo2-titulo { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .2rem 0 .7rem; }
.mo2-titulo h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
body.mo2 .mo-lote { border-left-color: var(--navy); border-radius: 14px; }
body.mo2 .mo-lote.avisado { border-left-color: var(--amarelo); }
body.mo2 .mo-lote .serv { font-family: Manrope, sans-serif; }
body.mo2 .mo-btn-terminei { background: #2e9d55; border-color: #2e9d55; }
.mo2-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff;
  border-top: 1px solid var(--borda); padding: .35rem .4rem calc(.4rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(23,34,56,.08); }
.mo2-nav button { position: relative; background: none; border: 0; color: #8a93a6; font: inherit; font-size: .72rem; font-weight: 700; padding: .35rem 0; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: .15rem; cursor: pointer; }
.mo2-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mo2-nav button.ativo { color: var(--navy); background: #eef2f8; }
.mo2-nav i { position: absolute; top: 4px; left: calc(50% + 6px); width: 9px; height: 9px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }
.mo2-perfil { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.mo2-perfil strong { display: block; font-family: Manrope, sans-serif; font-size: 1.05rem; }
.mo2-perfil span { display: block; font-size: .82rem; color: var(--txt-2); }
.mo2-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: var(--amarelo); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex-shrink: 0; }
.mo2-resumos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.mo2-resumo { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: .7rem .75rem; display: flex; flex-direction: column; gap: .1rem; }
.mo2-resumo span { font-size: .74rem; font-weight: 700; color: var(--txt-2); text-transform: uppercase; letter-spacing: .4px; }
.mo2-resumo small { font-size: .74rem; color: var(--txt-2); }
.mo2-resumo strong { font-family: Manrope, sans-serif; font-size: 1rem; font-variant-numeric: tabular-nums; }
.par-linha { display: flex; justify-content: space-between; gap: .5rem; }
@media (max-width: 380px) { .mo2-hero .v { font-size: 1.9rem; } .mo2-resumos { grid-template-columns: 1fr; } }

/* Menu "Mais" com ícones de linha (visual sóbrio) */
body.v2 .menu-mais { gap: 0; border: 1px solid var(--borda); border-radius: 14px; overflow: hidden; background: #fff; }
body.v2 .menu-mais button { border: 0; border-radius: 0; border-bottom: 1px solid var(--borda); padding: 1rem 1rem; gap: .9rem; font-weight: 600; font-size: .98rem; color: var(--txt); }
body.v2 .menu-mais button:last-child { border-bottom: 0; }
body.v2 .menu-mais button:active { background: #f3f5f9; }
body.v2 .menu-mais span { flex: 1; }
body.v2 .menu-mais .ic { width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: #eef2f8; flex-shrink: 0;
  fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.v2 .menu-mais .seta { width: 18px; height: 18px; fill: none; stroke: #a3abb9; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.v2 .menu-mais button.sair { color: #b3261e; }
body.v2 .menu-mais button.sair .ic { background: #fbeceb; stroke: #b3261e; }

/* Logotipo (agulha e linha) */
.logo-bcra { width: 44px; height: 44px; flex-shrink: 0; display: block; }
.logo-bcra.pequeno { width: 38px; height: 38px; }
.logo-bcra.grande { width: 84px; height: 84px; margin: 0 auto .7rem; }
.login-v2 .login-wrap { background: linear-gradient(#172238 0 42%, #f3f5f9 42%); }
.login-v2 .login-card { border-radius: 18px; padding: 1.8rem 1.5rem 1.4rem; box-shadow: 0 10px 30px rgba(23,34,56,.15); }
.marca-nome { font-family: Manrope, sans-serif; font-weight: 800; font-size: 2.1rem; line-height: 1; letter-spacing: 1px; color: #172238; }
.marca-sub { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: .35rem 0 .9rem; font-weight: 600; font-size: .8rem; letter-spacing: 4px; color: #5b6478; }
.marca-sub i { width: 18px; height: 3px; border-radius: 2px; background: #f5c518; }

/* ===================== Versão 7 ===================== */
.btn-lixo { width: 34px; height: 34px; flex-shrink: 0; display: inline-grid; place-items: center; border: 1px solid #f0d4d2; border-radius: 9px;
  background: #fdf3f2; color: #b3261e; cursor: pointer; padding: 0; vertical-align: middle; }
.btn-lixo:hover { background: #fbe4e2; }
.btn-lixo svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.v2 .btn.perigo { background: #fdf3f2; color: #b3261e; border: 1px solid #f0d4d2; }
body.v2 .btn.perigo:hover { background: #fbe4e2; }
.neg { color: #b3261e; }
.chip-lanc { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 700; margin: 0 .25rem; }
.chip-lanc.hs { background: #eef2f8; color: #23324d; } .chip-lanc.he { background: #e3eafa; color: #2f4366; }
.chip-lanc.bo { background: #e6f4ea; color: #1e6b3a; } .chip-lanc.va { background: #fff3cd; color: #6b5200; } .chip-lanc.de { background: #fdecea; color: #b3261e; }
.ff-mes { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .8rem 0 .4rem; }
.ff-mes strong { min-width: 140px; text-align: center; }
.ff-resumo { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin: .9rem 0; padding: .8rem; border-radius: 12px; background: #f3f5f9; font-size: .78rem; color: var(--txt-2); }
.ff-resumo.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ff-resumo strong { display: block; margin-top: .15rem; font-size: 1rem; color: var(--txt); font-variant-numeric: tabular-nums; }
.ff-resumo .liq strong { color: #2e9d55; font-size: 1.1rem; }
.ff-resumo strong.neg { color: #b3261e; }
body.v2 .btn-nome.func-mensal { background: var(--navy-2); }
body.v2 .btn-nome.func-hora { background: #fff; color: var(--txt); border: 1.5px solid #cfd6e2; box-shadow: none; }
body.v2 .btn-nome.func-hora small { color: var(--txt-2); }
body.v2 .bandeira.ok { background: #e6f4ea; color: #1e6b3a; }
.ponto.funcionarios { background: var(--amarelo); }
.legenda-func { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: .8rem; font-size: .78rem; color: var(--txt-2); }
.legenda-func i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; }
.lg-mensal { background: var(--navy-2); } .lg-hora { background: #fff; border: 1.5px solid #cfd6e2; }
.topo-acoes .nav-periodo { display: flex; align-items: center; gap: .4rem; }
.topo-acoes .nav-periodo strong { min-width: 130px; text-align: center; }
.grade-gastos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.grade-gastos .card { margin: 0; }
.barra-cat { display: grid; grid-template-columns: 1fr auto; gap: .3rem; margin-bottom: .8rem; font-size: .9rem; }
.barra-cat i { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.barra-cat b { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.grade-equip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
.grade-equip .card { margin: 0; }
.lista-equip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.equip-card { display: flex; flex-direction: column; gap: .35rem; text-align: left; padding: .9rem 1rem; border: 1px solid var(--borda); border-radius: 14px;
  background: #fff; cursor: pointer; font: inherit; color: var(--txt); }
.equip-card:hover { border-color: #b9c3d3; }
.equip-card.sel { border: 2px solid var(--navy); box-shadow: 0 4px 12px rgba(23,34,56,.10); }
.eq-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.eq-topo strong { font-family: Manrope, sans-serif; font-size: 1rem; }
.kpi-v2 strong.kpi-txt { font-size: 1.15rem; line-height: 1.3; }
.rank-linha { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px 110px; align-items: center; gap: .7rem; padding: .5rem 0; font-size: .9rem; }
.rank-linha i { display: block; height: 9px; border-radius: 99px; background: #eef1f5; margin-top: .35rem; overflow: hidden; }
.rank-linha b { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.rank-linha b.um { background: var(--amarelo); }
.rank-pos { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: #eef1f5; color: var(--txt-2); }
.rank-pos.um { background: var(--amarelo); color: var(--sb); }
body.v2 .menu-mais small { font-weight: 500; font-size: .78rem; }
@media (max-width: 1100px) { .grade-gastos, .grade-equip { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .ff-resumo { grid-template-columns: 1fr 1fr; }
  .ff-resumo .liq { grid-column: 1 / -1; }
  .rank-linha { grid-template-columns: 26px minmax(0, 1fr) 70px; }
  .rank-linha > strong { display: none; }
  .topo-acoes .nav-periodo { width: 100%; justify-content: space-between; }
  .lista-equip { grid-template-columns: 1fr; }
}
@media print { .barra-periodo, .acoes, .topo-acoes { display: none !important; } }
