:root {
  /* Paleta Argos: azul-marinho + cinza */
  --bg: #0f2038;          /* marinho escuro (fundos escuros/login) */
  --bg-soft: #17324f;
  --surface: #ffffff;
  --text: #12233b;        /* texto marinho */
  --muted: #64748b;       /* cinza */
  --primary: #1e3a5f;     /* azul-marinho */
  --primary-600: #16304d; /* marinho + escuro (hover) */
  --steel: #64748b;       /* cinza aço (para degrades/detalhes) */
  --border: #e2e8f0;
  --erro: #dc2626;
  --graf-plan: #29abe2;   /* azul bebê — planejado */
  --graf-real: #16a34a;   /* verde — realizado/executado */
  --graf-custo: #dc2626;  /* vermelho — custo (futuro) */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 6, 23, .12);
  --topbar-h: 68px;       /* altura da barra superior (para a lateral full-height) */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
/* CRITICO: garante que elementos com [hidden] fiquem realmente escondidos
   (senao .modal-overlay/.login-wrap com display:grid anulam o hidden e o modal
   aparece sozinho por cima da tela de login). */
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: #f1f5f9; }
h1, h2 { margin: 0; }
.muted { color: var(--muted); }
.flex-1 { flex: 1; }
button, input { font: inherit; }

/* ---- Login ---- */
/* tela cheia com imagem de fundo + cartao (estilo PPC, marinho) */
#tela-login {
  position: fixed; inset: 0; padding: 4vh 6vw;
  background: var(--bg) url('/login-bg.png') center center / 100% 100% no-repeat;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 16px;
}
/* logotipo acima do card, alinhado a largura do card (centralizado sobre ele) */
.login-logo {
  display: block; width: 392px; max-width: 92vw; height: auto;
  border-radius: 16px; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35));
}
@media (max-width: 720px) {
  #tela-login { align-items: center; justify-content: center; padding: 24px 16px; }
  .login-logo { width: 240px; max-width: 72vw; }
}
.login-card {
  width: 392px; max-width: 92vw; border-radius: 20px; padding: 28px 26px;
  /* membrana de vidro: 60% transparente (40% branco) */
  background: rgba(255,255,255,0.40);
  border: 1px solid rgba(255,255,255,0.55);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 24px 60px rgba(2,6,23,0.35);
  display: grid; gap: 14px;
}
.login-langs { display: flex; justify-content: center; gap: 10px; margin-bottom: 4px; }
.login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-ic {
  width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.login-title { font-size: 18px; font-weight: 800; letter-spacing: .5px; color: var(--primary); }
.login-sub { font-size: 13px; color: #475569; margin-top: 2px; }
.login-field {
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: rgba(255,255,255,0.55); border: 1px solid rgba(255,255,255,0.7); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.login-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.18); }
.login-field .lf-ic { color: var(--muted); display: flex; flex: none; }
.login-field input { flex: 1; min-width: 0; background: transparent; border: none; color: #111; padding: 13px 0; font-size: 15px; }
.login-field input::placeholder { color: #94a3b8; }
.login-field input:focus { outline: none; }
.lf-eye { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; display: flex; flex: none; }
.lf-eye:hover { color: var(--primary); }
.login-btn {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #fff;
  font-weight: 800; font-size: 16px; letter-spacing: .5px;
  box-shadow: 0 10px 24px rgba(15,32,56,.45);
  transition: filter .15s;
}
.login-btn:hover { filter: brightness(1.1); }
#tela-login .erro { color: #b3261e; font-weight: 700; text-align: center; margin: 2px 0 0; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-content: center;
  background: linear-gradient(135deg, var(--primary), var(--steel));
  color: #fff; font-weight: 800; font-size: 22px;
}
.brand-mark.small { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
.brand h1 { font-size: 22px; }

.field { display: grid; gap: 6px; font-size: 14px; }
.field span { color: var(--muted); font-weight: 600; }
.field input {
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.18); }

.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.erro { color: var(--erro); font-size: 14px; margin: 0; }

.lang-flags { display: inline-flex; gap: 6px; align-items: center; }
.flag-btn {
  width: 28px; height: 19px; padding: 0; border: 0; border-radius: 4px;
  overflow: hidden; cursor: pointer; background: none; line-height: 0;
  opacity: .45; filter: grayscale(.35);
  box-shadow: 0 0 0 1px rgba(2, 6, 23, .18);
  transition: opacity .15s, transform .1s, box-shadow .15s, filter .15s;
}
.flag-btn svg { width: 100%; height: 100%; display: block; }
.flag-btn:hover { opacity: .9; transform: translateY(-1px); }
.flag-btn.active { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--primary); }
.rodape { text-align: center; color: #94a3b8; font-size: 13px; }

/* ---- App ---- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
/* Logo Argo recortado via CSS (mostra só a região do logo do PNG cheio, sem espaço em branco) */
.topbar-logo { display: block; flex: none; width: 200px; height: 56px;
  background: url(/argo-logo.png?v=4) no-repeat; background-size: 209px 140px; background-position: -4px -36px; }
.conteudo { padding: 24px 20px; max-width: 1100px; margin: 0 auto; }
.conteudo h2 { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; transition: transform .12s, box-shadow .12s;
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.item-card h3 { margin: 0 0 4px; font-size: 16px; }
.item-card .sub { font-size: 13px; color: var(--muted); }

.secao-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.secao-topo h2 { margin: 0; }

.card-acoes { display: flex; gap: 8px; margin-top: 12px; }
.btn-mini {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 8px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.btn-mini-perigo:hover { border-color: var(--erro); color: var(--erro); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(2, 6, 23, .55);
  display: grid; place-items: center; padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(660px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
/* modais de cadastro (empresa/construtora/empreendimento) maximizados */
#modal-cadastro .modal-card, #modal-empreendimento .modal-card { width: min(1080px, 96vw); max-height: 94vh; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-x {
  border: 0; background: none; color: var(--muted); font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 4px; border-radius: 8px;
}
.modal-x:hover { color: var(--text); }
/* o form precisa ser coluna flexivel para o corpo rolar e o rodape ficar fixo */
#modal-cadastro form, #modal-empreendimento form, #modal-item form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-item-card { width: min(520px, 96vw); }

/* ---- Orçamento (tabela de itens) ---- */
.orc-wrap { overflow-x: auto; }
.orc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.orc-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 0 12px 10px; border-bottom: 2px solid var(--border); }
.orc-table th.num, .orc-table td.num { text-align: right; }
.orc-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.orc-table tbody tr:hover { background: #f8fafc; }
.orc-table tfoot td { padding: 12px; font-weight: 800; border-top: 2px solid var(--border); background: #f8fafc; }
.orc-acoes { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.orc-acoes .btn-mini { padding: 5px 8px; }
.orc-peso-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-weight: 700; font-size: 13px; }
.orc-peso-ok { background: #dcfce7; color: #166534; }
.orc-peso-warn { background: #fef3c7; color: #92400e; }
.orc-total-linha { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }

/* ---- Vista de obra: menu lateral + modulo ---- */
.obra-layout { display: flex; gap: 22px; align-items: flex-start; }
#obra-menu { flex: 0 0 236px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px; position: sticky; top: 78px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }

/* MODO OBRA: barra lateral encostada à esquerda, em altura total (estilo app-shell) */
body.modo-obra .conteudo { max-width: none; padding: 0; margin: 0; }
body.modo-obra .obra-layout { gap: 0; align-items: stretch; }
body.modo-obra #obra-menu {
  flex: 0 0 240px; border: 0; border-right: 1px solid var(--border); border-radius: 0;
  padding: 14px 10px; position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  box-shadow: 1px 0 3px rgba(15,23,42,.05);
}
body.modo-obra #obra-main { flex: 1 1 auto; min-width: 0; padding: 22px 28px 40px; max-width: 1600px; }
body.modo-obra #obra-main #breadcrumb { margin-bottom: 14px; }
.menu-obra-titulo { font-weight: 800; font-size: 15px; letter-spacing: -.01em; padding: 4px 12px 14px; color: var(--primary); border-bottom: 1px solid var(--border); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-nav { display: flex; flex-direction: column; gap: 3px; }
/* Base única: itens, cabeçalhos de grupo e sub-itens seguem o mesmo padrão */
.menu-item, .menu-grupo-titulo {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; position: relative; user-select: none;
  transition: background .13s ease, color .13s ease;
}
.menu-ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .75; transition: opacity .13s; }
.menu-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item:hover, .menu-grupo-titulo:hover { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); color: var(--primary); }
.menu-item:hover .menu-ico, .menu-grupo-titulo:hover .menu-ico { opacity: 1; }
.menu-item.ativo { background: var(--primary); color: #fff; box-shadow: 0 3px 8px color-mix(in srgb, var(--primary) 30%, transparent); }
.menu-item.ativo .menu-ico { opacity: 1; }
.menu-soon { color: var(--muted); cursor: default; font-weight: 500; }
.menu-soon .menu-ico { opacity: .45; }
.menu-soon:hover { background: transparent; color: var(--muted); }
.soon-badge { margin-left: auto; font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; background: #f1f5f9; color: var(--muted); padding: 2px 7px; border-radius: 10px; font-weight: 700; }
/* Grupos recolhíveis (acordeão): sub-itens indentados com guia à esquerda */
.menu-grupo { margin-top: 3px; }
.menu-grupo-seta { margin-left: auto; font-size: 10px; opacity: .5; transition: transform .18s ease; }
.menu-grupo.aberto > .menu-grupo-titulo { color: var(--primary); }
.menu-grupo.aberto > .menu-grupo-titulo .menu-grupo-seta { transform: rotate(90deg); opacity: .85; }
.menu-grupo-itens { display: none; margin: 2px 0 5px 19px; padding-left: 12px; border-left: 1.5px solid var(--border); }
.menu-grupo.aberto .menu-grupo-itens { display: flex; flex-direction: column; gap: 2px; }
.menu-grupo-itens .menu-ico { display: none; }
.menu-grupo-itens .menu-item { padding: 8px 11px; font-size: 13px; font-weight: 500; }
.menu-grupo-itens .menu-item.ativo { font-weight: 600; }
#modulo-conteudo { flex: 1 1 auto; min-width: 0; }
.modulo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.modulo-head h2 { margin: 0; }
.modulo-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.orc-moeda { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-weight: 600; background: var(--surface); cursor: pointer; }
.orc-moeda-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font-weight: 600; font-size: 13px; color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); cursor: default; }
.campo-hint { display: block; margin-top: 3px; font-size: 12px; }
.orc-in { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 14px; outline: none; }
.orc-in:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.orc-in.num { text-align: right; }
.orc-num { color: var(--muted); font-weight: 700; }
/* Peso: alternar automático/manual + edição */
.orc-peso-th { display: inline-flex; align-items: center; gap: 6px; }
.orc-peso-modo { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 1px 5px; font-size: 12px; cursor: pointer; line-height: 1.4; }
.orc-peso-modo:hover { border-color: var(--primary); }
.orc-peso-modo.ativo { background: var(--primary); border-color: var(--primary); }
.orc-peso-wrap { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.orc-peso-input { width: 84px; }
.orc-peso-suf { color: var(--muted); font-weight: 600; }
.orc-peso-aviso { margin: 10px 2px 0; font-size: 13px; }

/* Cronograma (Medição N: %Mês + %Acum) */
.cron-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.cron-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.cron-table th, .cron-table td { padding: 7px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; }
.cron-table thead th { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); color: var(--primary); font-weight: 700; }
.cron-med { text-align: center; border-left: 2px solid var(--border); }
.cron-mesmed { text-align: center; font-weight: 600; color: var(--text); border-left: 2px solid var(--border); }
.cron-sub { font-size: 12px; }
.cron-acum-col { border-right: 1px dashed var(--border); background: color-mix(in srgb, var(--primary) 3%, transparent); }
.cron-sub.cron-acum-col { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.cron-col-num { width: 42px; text-align: left; }
.cron-col-item { min-width: 210px; text-align: left; }
.cron-col-peso { width: 74px; }
.cron-item-nome { text-align: left; font-weight: 600; }
.cron-cell { width: 62px; text-align: right; border: 1px solid var(--border); border-radius: 7px; padding: 5px 6px; font-size: 13px; outline: none; }
.cron-cell:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,.15); }
.cron-acum { color: var(--muted); font-variant-numeric: tabular-nums; }
.cron-row-over .cron-cell { border-color: var(--erro); }
/* Linha Consolidado (curva S planejada) */
.cron-consol td { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); font-weight: 700; color: var(--primary); }
.cron-consol-lbl { text-align: left; }
.cron-acum-100 { color: #166534 !important; }
/* Botão Reprogramar obra */
.btn-reprogramar { background: #c2410c; color: #fff; border: 1px solid #c2410c; }
.btn-reprogramar:hover { background: #9a3412; border-color: #9a3412; }
/* Cronograma obsoleto (linhas de base arquivadas) */
.baseline-lista { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.baseline-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.baseline-info { display: flex; flex-direction: column; gap: 2px; }
.baseline-info strong { color: var(--primary); }
.baseline-info .muted { font-size: 13px; }

/* Tipologias */
.tipo-lista { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.tipo-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; background: var(--surface); }
.tipo-card-prod { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); border-style: dashed; }
.tipo-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tipo-card-info strong { color: var(--primary); }
.tipo-card-info .muted { font-size: 13px; }
.tipo-card-acoes { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tipo-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; background: var(--primary); color: #fff; padding: 1px 7px; border-radius: 10px; font-weight: 700; vertical-align: middle; }
.tipo-grade th.tipo-col-pav { text-align: left; min-width: 120px; }
.tipo-grade .tipo-cod-pav, .tipo-grade .tipo-cod-uni { width: 100%; min-width: 70px; border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 13px; outline: none; }
.tipo-grade .tipo-cod-pav { font-weight: 600; }
.tipo-grade .tipo-cod-pav:focus, .tipo-grade .tipo-cod-uni:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,.15); }
.tipo-grade .tipo-dup { border-color: var(--erro) !important; background: #fee2e2; color: #b91c1c; font-weight: 700; }

/* Parametrização de vistorias */
.vist-table th, .vist-table td { text-align: left; vertical-align: top; padding: 16px 16px; }
.vist-table th { padding-top: 12px; padding-bottom: 12px; }
.vist-ordem { font-weight: 600; color: var(--primary); white-space: nowrap; }
.vist-mes { white-space: nowrap; }
.vist-virada { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 13px; outline: none; }
.vist-virada:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,.15); }
.vist-virada-row { display: flex; align-items: center; gap: 12px; }
.vist-weekday { font-size: 13px; text-transform: capitalize; white-space: nowrap; }
.vist-vist-td { min-width: 420px; }
/* Grade: data | dia da semana | retroativa | remover */
.vist-grid { display: grid; grid-template-columns: max-content max-content 1fr max-content; gap: 12px 16px; align-items: center; }
.vist-dow { color: var(--muted); text-transform: capitalize; font-size: 13px; white-space: nowrap; }
.vist-retro { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.vist-retro input { cursor: pointer; }
.vist-edit { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; outline: none; }
.vist-edit:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(30,58,95,.15); }
.vist-rem { border: none; background: transparent; color: var(--erro); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; justify-self: end; }
.vist-add { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.vist-nova { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.vist-nova[hidden] { display: none; }

/* Itens de medição */
.med-nome-lin { font-weight: 600; }
.med-lin td { vertical-align: middle; }
.med-table select.med-in, .med-table input.med-in { width: 100%; }
.med-table td { vertical-align: middle; }
.med-obra { color: var(--muted); font-weight: 600; }
.med-table .orc-in { padding: 6px 8px; }
select.orc-in { background: var(--surface); cursor: pointer; }
.med-sub-locked { opacity: .55; background: color-mix(in srgb, var(--muted) 8%, var(--surface)); }
.med-sub-locked .orc-in { text-decoration: line-through; }
/* Tabela de subitens: larguras fixas por coluna (Nome flexível, resto cabe o texto) */
.med-table { table-layout: fixed; min-width: 1202px; }
.med-table th, .med-table td { vertical-align: top; }
.med-table td { overflow: hidden; }
.med-table thead th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.med-table select.orc-in, .med-table input.med-peso { width: 100%; }
.med-table select.orc-in { text-overflow: ellipsis; }
/* Campo Nome: largura automática (coluna flexível) e quebra de linha */
.med-nome { width: 100%; resize: none; min-height: 34px; line-height: 1.35; white-space: normal; overflow: hidden; font-family: inherit; box-sizing: border-box; }
/* Arrastar para reordenar + seleção múltipla */
.med-drag { cursor: grab; color: var(--muted); font-size: 16px; user-select: none; display: inline-block; padding: 0 2px; }
.med-drag:active { cursor: grabbing; }
.med-dragging { opacity: .5; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.med-drag-td, .med-table .med-sel { text-align: center; }
.med-sel { cursor: pointer; }
.btn-excluir-sel { background: var(--erro); color: #fff; border: 1px solid var(--erro); }
.btn-excluir-sel:hover { background: #b91c1c; border-color: #b91c1c; }

/* Lançamento da Medição */
.medlan-head { display: flex; align-items: center; gap: 12px; }
.medlan-selects { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 16px; }
.medlan-sel { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.medlan-sel select { min-width: 200px; padding: 7px 9px; }
.medlan-filtro { display: inline-flex; align-items: center; gap: 8px; align-self: flex-end; padding-bottom: 8px; font-size: 14px; color: var(--text); cursor: pointer; user-select: none; }
.medlan-filtro input { width: 16px; height: 16px; cursor: pointer; }
.medlan-realizado { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; }
.medlan-subs { display: flex; flex-direction: column; gap: 12px; }
.medlan-sub { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
/* Cabeçalho estilo referência */
.medlan-cab { padding: 10px 14px; background: color-mix(in srgb, var(--muted) 6%, var(--surface)); border-bottom: 1px solid var(--border); }
.medlan-cab-nome { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.medlan-cab-linhas { display: flex; gap: 10px 24px; flex-wrap: wrap; font-size: 13px; color: var(--text); }
.medlan-cab-bloco { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.medlan-cab-bloco b { color: var(--text); }
.medlan-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #ea7a12; }
.medlan-tag-med { color: #ea7a12; font-weight: 700; }
.medlan-cab-med { display: inline-flex; align-items: center; gap: 6px 22px; flex-wrap: wrap; }
.medlan-cab-n { display: inline-block; min-width: 18px; text-align: center; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); font-weight: 700; font-size: 12px; }
.medlan-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--muted); }
.medlan-badge-prod { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary); }
/* Corpo: controle (células/input) + donut à direita */
.medlan-corpo { display: flex; align-items: flex-start; gap: 16px; padding: 12px 14px; }
.medlan-corpo-main { flex: 1; min-width: 0; }
.medlan-pct { display: flex; align-items: center; gap: 8px; }
.medlan-pct label { font-size: 13px; color: var(--muted); }
.medlan-pct-in { width: 110px; text-align: right; }
.medlan-pct-in:disabled { background: color-mix(in srgb, var(--muted) 8%, var(--surface)); color: var(--muted); }
.medlan-hint { font-size: 12px; font-style: italic; }
.medlan-cells { display: flex; flex-wrap: wrap; gap: 6px; }
/* Grade na mesma ordem da tipologia: uma linha por pavimento (topo primeiro), colunas alinhadas */
.medlan-grid { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.medlan-grid-row { display: flex; gap: 6px; }
.medlan-cell-empty { flex: 0 0 auto; min-width: 66px; min-height: 40px; border-radius: 7px; border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent); background: color-mix(in srgb, var(--muted) 4%, transparent); }
.medlan-cell { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 66px; min-height: 40px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text); transition: background .12s, border-color .12s; line-height: 1.2; }
.medlan-cell:hover { border-color: var(--primary); }
.medlan-cell .cell-cod { font-weight: 600; }
.medlan-cell .cell-med, .medlan-cell .cell-data { font-size: 10px; font-weight: 500; opacity: .95; white-space: nowrap; }
/* Medição ATUAL (vistoria selecionada) = verde · medições ANTERIORES = azul */
.medlan-cell.cell-vist { background: var(--ok, #16a34a); border-color: var(--ok, #16a34a); color: #fff; }
.medlan-cell.cell-prev { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Donut do % executado */
.medlan-donut { flex: 0 0 auto; }
.medlan-donut-txt { font-size: 19px; font-weight: 800; fill: var(--text); letter-spacing: -.02em; }

/* Gráficos (curva S) */
.graf-resumo { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.graf-card { flex: 1 1 140px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.graf-card-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.graf-card strong { font-size: 22px; font-weight: 800; }
.graf-plan-txt { color: var(--graf-plan); }
.graf-real-txt { color: var(--graf-real); }
.graf-card-face { flex: 0 0 auto; align-items: center; justify-content: center; }
.graf-card-face .graf-face { margin: 0; }
.graf-pos { color: #16a34a; }
.graf-neg { color: var(--erro); }
.graf-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.graf-tab { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.graf-tab:hover { border-color: var(--primary); color: var(--primary); }
.graf-tab.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.graf-opts { display: flex; gap: 18px 24px; flex-wrap: wrap; align-items: center; margin: 2px 0 8px; }
.graf-opt-grp { display: inline-flex; align-items: center; gap: 6px; }
.graf-opt-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.graf-opt { padding: 5px 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.graf-opt:first-of-type { border-radius: 8px 0 0 8px; }
.graf-opt:last-of-type { border-radius: 0 8px 8px 0; border-left: none; }
.graf-opt.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.graf-sel-med { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.graf-sel-med select { padding: 6px 9px; }
.graf-barlbl { font-size: 11px; font-weight: 700; text-anchor: middle; fill: var(--text); }
.graf-barlbl.graf-plan-txt { fill: var(--graf-plan); }
.graf-barlbl.graf-real-txt { fill: var(--graf-real); }
.graf-legenda { display: flex; gap: 18px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.graf-leg { display: inline-flex; align-items: center; gap: 6px; }
.graf-sw { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.graf-sw-plan { background: var(--graf-plan); }
.graf-sw-real { background: var(--graf-real); }
.graf-wrap { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 10px; overflow-x: auto; }
.graf-svg { display: block; height: auto; max-width: none; }
.graf-vlbl { font-size: 9px; font-weight: 400; text-anchor: middle; fill: var(--text); }
.graf-vlbl.graf-plan-txt { fill: var(--primary); }
.graf-vlbl.graf-real-txt { fill: #16a34a; }
.graf-grid { stroke: var(--border); stroke-width: 1; }
.graf-axy, .graf-axx { fill: var(--muted); font-size: 10px; font-weight: 400; }
.graf-axy { text-anchor: end; }
.graf-axx { text-anchor: middle; }
.graf-axv { text-anchor: end; }   /* meses na vertical: ancorado no fim (junto ao eixo) */
.graf-linha { stroke-width: 3; }
.graf-plan { stroke: var(--graf-plan); }
.graf-real { stroke: var(--graf-real); }
.graf-pt-plan circle { fill: var(--graf-plan); }
.graf-pt-real circle { fill: var(--graf-real); }
.graf-bar { rx: 2; }
.graf-plan-bar { fill: var(--graf-plan); }
.graf-real-bar { fill: var(--graf-real); }
/* Custo (vermelho) */
.graf-custo { stroke: var(--graf-custo); }
.graf-pt-custo circle { fill: var(--graf-custo); }
.graf-custo-bar { fill: var(--graf-custo); }
.graf-custo-txt { color: var(--graf-custo); }
.graf-barlbl.graf-custo-txt { fill: var(--graf-custo); }
.graf-vlbl.graf-custo-txt { fill: var(--graf-custo); }
.graf-sw-custo { background: var(--graf-custo); }
/* Linha do "hoje" */
.graf-hoje { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 5 3; }
.graf-hoje-lbl { fill: #b45309; font-size: 10px; font-weight: 700; text-anchor: middle; }
.graf-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.graf-chk input { width: 15px; height: 15px; cursor: pointer; }
/* Tabelas (Medição Física / Custo) com carinhas */
.graf-tabela-tit { font-weight: 700; margin: 18px 0 6px; }
.graf-tabela-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.graf-tabela { border-collapse: collapse; font-size: 12px; white-space: nowrap; width: 100%; }
.graf-tabela th, .graf-tabela td { border: 1px solid var(--border); padding: 6px 12px; text-align: center; }
.graf-tabela th { background: color-mix(in srgb, var(--muted) 7%, var(--surface)); font-weight: 700; color: var(--text); }
.graf-tab-lbl { text-align: left !important; font-weight: 700; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.graf-dif-v { font-weight: 600; }
.graf-face { display: inline-block; vertical-align: middle; margin-top: 3px; }
/* Detalhamento */
.det-sel { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.det-sel select { padding: 6px 9px; margin-left: 4px; }
.det-table td { white-space: nowrap; }
.det-table th { white-space: normal; vertical-align: bottom; line-height: 1.25; max-width: 130px; }
.det-table .det-nome { white-space: normal; min-width: 220px; }
.det-table .det-exec { font-weight: 700; }
.det-face { text-align: center; }
.det-acao { text-align: center; }
.det-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: border-color .12s, color .12s, background .12s; }
.det-btn:hover { border-color: var(--primary); color: var(--primary); }
.det-btn svg { display: block; }
.det-olho:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.card-topo { position: relative; }
.card-carinha { position: absolute; top: 0; right: 0; }

/* Modal do Gantt */
.modal-gantt-card { width: min(1120px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.gantt-print-head, .gantt-print-rod { display: none; }   /* só aparecem na impressão do Gantt */
.gantt-head-acoes { display: flex; align-items: center; gap: 10px; }
#gantt-body { overflow: auto; }
.gantt-cabec { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.gantt-cabec-txt { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.gantt-cabec-txt strong { font-size: 16px; color: var(--primary); }
.gantt-cabec-txt .muted { font-size: 13px; }
.gantt-logo { max-height: 52px; max-width: 180px; object-fit: contain; }
.gantt-scroll { overflow-x: auto; padding-bottom: 6px; }
.gantt { display: grid; gap: 2px; min-width: 520px; }
.gantt-corner { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; padding: 0 8px; }
.gantt-mes { font-size: 11px; font-weight: 700; color: var(--primary); text-align: center; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.gantt-item { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; padding-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gantt-cell { background: color-mix(in srgb, var(--primary) 3%, var(--surface)); border-radius: 3px; }
.gantt-bar { align-self: center; height: 20px; margin: 0 2px; background: linear-gradient(var(--primary), var(--primary-600)); border-radius: 5px; display: flex; align-items: center; justify-content: center; z-index: 1; box-shadow: 0 1px 2px rgba(2,6,23,.2); }
.gantt-bar span { color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.gantt-sub { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* Curva S (SVG) */
.gantt-scurve { display: block; }
.gs-grid { stroke: var(--border); stroke-width: 1; }
.gs-lbl-y { fill: var(--muted); font-size: 10px; text-anchor: end; }
.gs-lbl-x { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.gs-lbl-v { fill: var(--primary); font-size: 9px; font-weight: 700; text-anchor: middle; }
.gs-area { fill: color-mix(in srgb, var(--primary) 14%, transparent); }
.gs-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.gs-dot { fill: #fff; stroke: var(--primary); stroke-width: 2; }

/* Impressão do Gantt: mostra só o modal */
@media print {
  body.print-gantt > *:not(#modal-gantt) { display: none !important; }
  body.print-gantt #modal-gantt { position: static; display: block; background: none; padding: 0; }
  body.print-gantt #modal-gantt .modal-card { box-shadow: none; max-width: none; width: auto; max-height: none; border: 0; }
  body.print-gantt #gantt-body { overflow: visible; }
  body.print-gantt .gantt-scroll { overflow: visible !important; }
  body.print-gantt .gantt-head-acoes { display: none !important; }
  body.print-gantt #modal-gantt .modal-head { display: none !important; }
  body.print-gantt .gantt-print-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #1e3a5f; padding-bottom: 10px; margin-bottom: 12px; }
  body.print-gantt .gantt-print-head img { max-height: 46px; max-width: 150px; object-fit: contain; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-gantt .gantt-print-head .gph-tit { flex: 1; text-align: center; }
  body.print-gantt .gantt-print-head .gph-tit b { font-size: 16px; }
  body.print-gantt .gantt-print-rod { display: flex; justify-content: center; margin-top: 14px; padding-top: 8px; border-top: 1px solid #999; }
  body.print-gantt .gantt-print-rod img { max-height: 40px; max-width: 150px; object-fit: contain; }
  @page { size: landscape; margin: 10mm; }
}

/* Modal de importação */
.modal-import-card { width: min(520px, 94vw); }
.imp-passo { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.imp-passo + .imp-passo { border-top: 1px solid var(--border); }
.imp-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.imp-txt { flex: 1 1 auto; min-width: 0; }
.imp-txt strong { display: block; font-size: 14px; margin-bottom: 3px; }
.imp-txt p { margin: 0 0 10px; font-size: 13px; }
.imp-status { margin: 6px 0 0; font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.imp-status.imp-ok { background: #dcfce7; color: #166534; }
.imp-status.imp-erro { background: #fee2e2; color: #b91c1c; }
@media (max-width: 760px) {
  .obra-layout { flex-direction: column; }
  #obra-menu, body.modo-obra #obra-menu { width: 100%; position: static; flex-basis: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--border); box-shadow: none; }
  body.modo-obra #obra-main { padding: 16px; }
}
.tol-faixas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 16px; margin: 4px 0 8px; }
@media (max-width: 620px) { .tol-faixas { grid-template-columns: repeat(2, 1fr); } }
.tol-topo { display: flex; align-items: center; gap: 10px; }
.tol-face-svg { width: 44px; height: 44px; flex: 0 0 auto; filter: drop-shadow(0 3px 5px rgba(0,0,0,.22)); }
.tol-campo { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.tol-campo span { font-size: 12px; color: var(--muted); font-weight: 600; }
.tol-campo input {
  border: none; border-bottom: 1px solid var(--border); background: transparent;
  padding: 3px 0; font-size: 18px; font-weight: 700; color: var(--text); outline: none; width: 100%;
}
.tol-campo input:focus { border-bottom-color: var(--primary); }
.tol-campo-vazio { flex: 1 1 auto; }
.tol-desc { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.35; }
.check-obsoleta { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--text); cursor: pointer; }
.check-obsoleta input { width: 16px; height: 16px; accent-color: var(--primary); }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.form-secao {
  margin: 22px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary);
}
.form-secao:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .field span { color: var(--muted); font-weight: 600; font-size: 13px; }
.form-grid .field input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-grid .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.18); }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .grow3 { grid-column: span 1; }
.modal-acoes {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border); flex: 0 0 auto;
}
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ---- Breadcrumb ---- */
.crumb { margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.crumb b { color: var(--text); }
.crumb-sep { margin: 0 4px; color: var(--border); }
.link-crumb {
  border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600;
  cursor: pointer; padding: 0;
}
.link-crumb:hover { text-decoration: underline; }

/* ---- Cartao clicavel (empresas: entrar) ---- */
.item-card.clicavel { cursor: pointer; }

/* ---- Seletor de logo no cadastro ---- */
.logo-picker { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.logo-thumb {
  width: 72px; height: 72px; border-radius: 14px; flex: 0 0 auto;
  border: 1px dashed var(--border); background: #f8fafc;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  display: grid; place-content: center; overflow: hidden;
}
.logo-thumb.tem-logo { border-style: solid; background-color: #fff; }
#cad-logo-ph {
  width: 100%; height: 100%; display: grid; place-content: center;
  color: #fff; font-weight: 800; font-size: 30px;
  background: linear-gradient(135deg, var(--primary), var(--steel));
}
.campo-label { font-weight: 600; font-size: 13px; }
.cropper-botoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border: 1px solid var(--border); }
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Modal "Ajustar logotipo" (estilo PPC) ---- */
.modal-logo-card { width: min(340px, 96vw); }
.logo-hint { font-size: 13px; margin: 0 0 14px; }
#logoFrame {
  width: 260px; height: 260px; margin: 0 auto; border-radius: 14px; overflow: hidden;
  position: relative; cursor: grab; border: 1px solid var(--border); touch-action: none;
}
#logoFrame:active { cursor: grabbing; }
#logoCanvas { display: block; width: 260px; height: 260px; }
.logo-zoom-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.logo-zoom-row input { flex: 1; accent-color: var(--primary); }

/* ---- Logo/miniatura nos cartoes ---- */
.card-topo { display: flex; gap: 12px; align-items: center; }
.card-info { min-width: 0; }
.card-logo {
  width: 46px; height: 46px; border-radius: 10px; flex: 0 0 auto;
  background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #fff;
  border: 1px solid var(--border);
}
.card-logo-vazio {
  display: grid; place-content: center; color: #fff; font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, var(--primary), var(--steel));
}

/* ===== Seletor de Controle de Custos (cards) ===== */
.custo-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
@media (max-width: 640px) { .custo-cards { grid-template-columns: 1fr; } }
.custo-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 14px 14px; border: 1.5px solid var(--border); border-radius: 14px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s, transform .1s;
}
.custo-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(15,32,56,.08); }
.custo-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.custo-card-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-content: center;
  background: #f1f5f9; color: var(--muted); transition: background .15s, color .15s;
}
.custo-card-ico svg { width: 22px; height: 22px; }
.custo-card-tit { font-weight: 700; color: var(--text); font-size: 15px; }
.custo-card-desc { font-size: 12px; line-height: 1.35; color: var(--muted); }
.custo-card-badge {
  position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 2px 8px;
}
/* selecionado */
.custo-card:has(input:checked) {
  border-color: var(--primary); background: #f6f9fd;
  box-shadow: 0 0 0 3px rgba(30,58,95,.14);
}
.custo-card:has(input:checked) .custo-card-ico { background: var(--primary); color: #fff; }
.custo-card:has(input:checked) .custo-card-tit { color: var(--primary); }
/* foco por teclado */
.custo-card:focus-within { border-color: var(--primary); }
.custo-card-soon { cursor: not-allowed; opacity: .6; }
.custo-card-soon:hover { border-color: var(--border); box-shadow: none; }

/* ===== Custo analítico — livro de lançamentos ===== */
.lanc-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.lanc-form-grid { display: grid; grid-template-columns: 130px 150px 1fr 140px 1.2fr; gap: 10px; align-items: end; }
@media (max-width: 900px) { .lanc-form-grid { grid-template-columns: 1fr 1fr; } .lanc-form-grid .lanc-desc, .lanc-form-grid .lanc-aprop { grid-column: 1 / -1; } }
.lanc-form .field { gap: 4px; }
.lanc-form .field span { font-size: 12px; }
.lanc-form input, .lanc-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; }
.lanc-form input:focus, .lanc-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); outline: none; }
.lanc-form-acoes { display: flex; gap: 8px; margin-top: 12px; }
.lanc-busca-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.lanc-busca { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; min-width: 240px; }
.lanc-busca:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); outline: none; }
.lanc-total { font-size: 14px; }
.lanc-acoes { white-space: nowrap; }
.lanc-acoes .det-btn { margin: 0 2px; }

/* ===== Custo Sintético — grade matriz (item × mês, rolagem horizontal) ===== */
.custo-head-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.custo-acoes-topo { display: flex; gap: 8px; }
.custo-matriz-wrap { overflow-x: auto; }
.custo-matriz { min-width: max-content; }
.custo-matriz th, .custo-matriz td { border: 1px solid var(--border); }
.custo-col-fix {
  position: sticky; left: 0; z-index: 3; background: #fff; text-align: left;
  min-width: 220px; max-width: 320px; box-shadow: 1px 0 0 var(--border);
}
thead .custo-col-fix { z-index: 4; background: #f1f5f9; }
.custo-col-mes { min-width: 120px; }
.custo-col-med { font-size: 11px; font-weight: 600; color: var(--muted); }
.custo-consol-row th, .custo-consol-row td { background: #eef2f7; font-weight: 700; }
.custo-consol-cel { color: var(--primary); }
.custo-matriz input.custo-real { width: 100%; min-width: 96px; text-align: right; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: inherit; background: #fff; }
.custo-matriz input.custo-real:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); outline: none; }

/* ===== Vínculo de subitens ===== */
.med-chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.med-chip-vinc { background: #fef3c7; color: #b45309; }
.med-chip-prin { background: #e0e7ff; color: #3730a3; }
.med-sub-vinc { background: #fffdf5; }
.med-sub-vinc .med-nome, .med-sub-vinc .med-tip, .med-sub-vinc .med-rep, .med-sub-vinc .med-peso { opacity: .75; }
.vinc-card { max-width: 560px; width: 100%; }
.vinc-regra { background: #f1f5f9; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.vinc-lista { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 6px; }
.vinc-li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.vinc-li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vinc-empty { border: none; padding: 4px 2px; }
.modal-foot { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }

/* ===== Dashboard ===== */
.dash-grid { display: grid; grid-template-columns: auto repeat(4, 1fr); gap: 12px; margin-bottom: 14px; align-items: stretch; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.dash-grid .graf-card { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.dash-face { align-items: center; justify-content: center; }
.dash-face-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; text-align: center; }

/* ===== Detalhamento: botão + modal Pontos de atenção ===== */
.det-head-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.det-pontos-btn { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 700; }
.det-pontos-btn:hover { background: #fee2e2; }
.pa-card { max-width: 720px; width: 100%; }
.pa-regra { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.pa-impacto { font-weight: 800; color: #b91c1c; }
.pa-critico td { background: #fef2f2; }
.pa-critico .det-nome { font-weight: 700; }
.pa-foot { justify-content: space-between; }
.pa-foot-esq { display: flex; gap: 8px; }

/* ===== Simulação ===== */
.sim-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }

/* ===== Dashboard v2 ===== */
.dash-face-st { font-size: 15px; font-weight: 800; margin-top: 2px; }
.dash-st-verde { color: #16a34a; } .dash-st-amarelo { color: #ca8a04; } .dash-st-laranja { color: #ea580c; } .dash-st-vermelho { color: var(--erro); }
.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.dash-panel-tit { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.dash-panel-tit .btn { margin-left: auto; }
.dash-pt { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.dash-pt:last-child { border-bottom: none; }
.dash-pt-face { flex: none; display: flex; }
.dash-pt-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.dash-pt-imp { flex: none; font-weight: 800; color: #b91c1c; }
.dash-pt-mais { padding-top: 8px; font-size: 13px; color: var(--muted); }
.dash-ok { display: flex; align-items: center; gap: 10px; color: #16a34a; font-weight: 600; padding: 8px 0; }
.dash-cst { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dash-cst:last-child { border-bottom: none; }
.dash-cst span { color: var(--muted); }

/* ===== Dashboard: barras de itens executados ===== */
.dash-exec-wrap { overflow-x: auto; }
.dash-bars { display: block; height: auto; max-width: 100%; }
.dash-bar-lbl { font-size: 12px; fill: var(--text); }
.dash-bar-bg { fill: #eef2f7; }
.dash-bar-fill { fill: var(--graf-real); }
.dash-bar-val { font-size: 11px; font-weight: 700; fill: var(--graf-real); }

/* ===== Fotos da obra ===== */
.foto-form { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.foto-form-grid { display: grid; grid-template-columns: auto 200px 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 820px) { .foto-form-grid { grid-template-columns: 1fr 1fr; } .foto-cap-in { grid-column: 1 / -1; } }
.foto-pick { display: inline-flex; align-items: center; cursor: pointer; white-space: nowrap; }
.foto-status { margin-top: 8px; font-size: 13px; }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.foto-card { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.foto-img { width: 100%; height: 150px; object-fit: cover; display: block; cursor: zoom-in; }
.foto-cap { padding: 7px 10px; font-size: 12px; color: var(--text); }
.foto-data { color: var(--muted); font-weight: 600; }
.foto-del { position: absolute; top: 6px; right: 6px; border: none; background: rgba(2,6,23,.55); color: #fff; border-radius: 8px; padding: 3px 7px; cursor: pointer; font-size: 13px; }
.foto-del:hover { background: var(--erro); }
.foto-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(2,6,23,.85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.foto-lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.foto-lb-x { position: fixed; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.foto-lb-cap { position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
/* miniaturas no dashboard */
.dash-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dash-foto { height: 76px; border-radius: 8px; object-fit: cover; width: 100%; cursor: zoom-in; border: 1px solid var(--border); }

/* ===== Dashboard v3: guia de perguntas + card de decisão ===== */
.dash-guia { background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; border-radius: 10px; padding: 8px 14px; margin-bottom: 12px; font-size: 13px; }
.dash-guia b { font-weight: 700; }
.dash-grid { grid-template-columns: auto repeat(auto-fit, minmax(128px, 1fr)); }
.dash-sub { font-size: 11px; font-weight: 700; }
.dash-qtag { font-size: 11px; font-weight: 700; color: var(--primary); background: #eff6ff; border: 1px solid #dbeafe; border-radius: 999px; padding: 1px 8px; }
.dash-dec { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.dash-dec-alerta { background: #fff7ed; border: 1px solid #fed7aa; }
.dash-dec-ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.dash-dec-ic { font-size: 22px; line-height: 1; }
.dash-dec-tit { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.dash-dec-txt { font-size: 15px; font-weight: 600; color: var(--text); }

/* ===== Dashboard: cabeçalho de relatório + impressão ===== */
.dash-report-head { position: relative; display: flex; align-items: center; gap: 20px; margin-bottom: 14px; padding: 4px 150px 12px 0; border-bottom: 2px solid var(--border); }
.dash-rh-logos { display: flex; align-items: center; gap: 12px; flex: none; }
.dash-logo { height: 78px; max-width: 210px; object-fit: contain; flex: none; }
.dash-logo-l, .dash-logo-r { min-width: 60px; }   /* placeholders mantêm o título centralizado */
.dash-rh-info { flex: 1; min-width: 0; text-align: center; }
.dash-rh-info h2 { font-size: 20px; }
.dash-print-btn { position: absolute; top: 0; right: 0; }
@media print { .dash-report-head { padding-right: 0; } }
.dash-rh-sub { font-size: 13px; margin-top: 2px; }
@media print {
  .topbar, #obra-menu, #breadcrumb, .no-print { display: none !important; }
  body.modo-obra #obra-main { max-width: none !important; padding: 0 !important; }
  .conteudo { padding: 0 !important; max-width: none !important; }
  .obra-layout { display: block !important; }
  .dash-panel, .graf-card, .dash-dec, .foto-card { break-inside: avoid; page-break-inside: avoid; }
  .dash-cols { grid-template-columns: 1fr 1fr !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { margin: 12mm; size: A4 landscape; }
  /* Relatório da simulação imprime em RETRATO (dashboard continua paisagem) */
  @page retrato { margin: 12mm; size: A4 portrait; }
  .sim-report { page: retrato; }
  .sim-report .graf-wrap svg { max-width: 100% !important; height: auto !important; }
}

/* ===== Medição por produção ===== */
.orc-prod { filter: grayscale(1); opacity: .45; }
.orc-prod.ativo { filter: none; opacity: 1; background: #fde8c8; }
.det-badge-prod {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: #fde8c8; color: #8a5a12; vertical-align: middle;
}

/* ===== Toast (aviso rápido) ===== */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(18px);
  padding: 12px 22px; border-radius: 9px; color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); z-index: 9999; max-width: 90vw;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: #16a34a; }
.toast-ok::before { content: "✓"; font-weight: 800; }
.toast-erro { background: var(--erro); }

/* ===== Donut de % nos cards do dashboard ===== */
.dash-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px; }
.dash-donut { display: block; }
.dash-donut-val { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.dash-donut-txt { font-size: 16px; font-weight: 500; }

/* ===== Toggle Linhas/Barras nos gráficos do dashboard ===== */
.dash-graf-toggle { float: right; display: inline-flex; gap: 2px; }

/* ===== Aviso do modal de vínculo (quem fica x quem some) ===== */
.vinc-aviso {
  background: #fef3c7; border: 1px solid #fcd34d; color: #7c5410;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; line-height: 1.45;
}

/* ===== Subitem vinculado na Medição (só leitura) ===== */
.medlan-badge-vinc { background: #fde8c8; color: #8a5a12; }
.medlan-sub-vinc { background: #fffdf7; }
.medlan-grid-ro { pointer-events: none; }

/* ===== Botão imprimir por subitem (mapa do prédio A4) ===== */
.medlan-sub { position: relative; }
.medlan-cab { padding-right: 96px; }
.medlan-print {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  transition: border-color .12s, color .12s, background .12s;
}
.medlan-print:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }

/* ===== Relatórios (montador) ===== */
.rel-form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 6px; }
.rel-blocos-tit { font-weight: 700; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 8px; }
.rel-blocos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 18px; margin-bottom: 16px; }
.rel-check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; transition: border-color .12s, background .12s; }
.rel-check:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.rel-check input { width: 16px; height: 16px; }
.rel-form-acoes { display: flex; gap: 10px; }
.rel-acoes { text-align: right; white-space: nowrap; }
.rel-acoes .btn-mini { margin-left: 4px; }
@media (max-width: 640px) { .rel-form-grid { grid-template-columns: 1fr; } }

/* ===== Checklist por tipologia (matriz) ===== */
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cl-sel { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 6px 0 18px; padding: 14px 18px; background: color-mix(in srgb, var(--primary) 4%, var(--surface)); border: 1px solid var(--border); border-radius: 12px; }
.cl-filtro { display: inline-flex; flex-direction: column; gap: 6px; }
.cl-filtro-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.cl-sel select { padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 9px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; min-width: 140px; transition: border-color .12s, box-shadow .12s; }
.cl-sel select:hover { border-color: var(--primary); }
.cl-sel select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.cl-legenda { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cl-legenda i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 3px; }
.cl-lg-ok { background: #16a34a; }
.cl-lg-off { background: var(--surface); border: 1px solid var(--border); }
.cl-wrap { overflow-x: auto; }
.cl-table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.cl-table th, .cl-table td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; white-space: nowrap; }
/* nome do serviço: quebra em várias linhas em vez de cortar */
.cl-table .cl-nome, .cl-table .cl-nome-h { text-align: left !important; position: sticky; left: 0; z-index: 2; background: var(--surface); width: 260px; min-width: 220px; max-width: 300px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; vertical-align: middle; }
.cl-nome-h, .cl-pav, .cl-uni, .cl-tot-h { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-weight: 700; color: var(--text); }
.cl-pav { font-size: 11px; color: var(--muted); }
.cl-uni { min-width: 34px; font-size: 11px; }
.cl-ok { background: #16a34a; color: #fff; font-weight: 700; }
.cl-off { background: var(--surface); }
.cl-tot, .cl-tot-h { font-weight: 700; background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.cl-tot-full { color: #16a34a; }
.cl-tot-row td { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-weight: 700; }
.cl-tot-row .cl-nome { font-size: 12px; }
.cl-vinc { font-size: 10px; opacity: .7; }
@media print {
  .cl-sel, .cl-head .modulo-acoes { display: none !important; }
  .cl-table { font-size: 9px; }
  /* fundo 100% branco p/ economizar tinta: célula feita vira só o ✓ preto, sem azul/cinza */
  .cl-table th, .cl-table td,
  .cl-nome, .cl-nome-h, .cl-pav, .cl-uni, .cl-tot-h, .cl-tot, .cl-tot-row td, .cl-ok, .cl-off {
    background: #fff !important; background-color: #fff !important; color: #111 !important;
    border-color: #999 !important; padding: 2px 3px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .cl-nome, .cl-nome-h { position: static; }
  .cl-tot-full, .cl-vinc { color: #111 !important; }
}

/* ===== Checklist: seletor de pavimento + barras 0-100% ===== */
.cl-pav-sel select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; }
.cl-sofalta { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; cursor: pointer; user-select: none; }
.cl-sofalta input { width: 16px; height: 16px; }
.cl-secao-tit { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 10px; }
.cl-bars { max-width: 860px; }
.cl-bar-grp { font-weight: 700; font-size: 12px; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 6px; padding-bottom: 3px; border-bottom: 1px solid var(--border); }
.cl-bar-row { display: grid; grid-template-columns: 300px 1fr 52px; align-items: center; gap: 12px; padding: 4px 0; }
.cl-bar-nome { font-size: 13px; white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.cl-bar-track { height: 16px; background: color-mix(in srgb, var(--muted) 16%, var(--surface)); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.cl-bar-fill { height: 100%; border-radius: 9px 0 0 9px; transition: width .3s; }
.cl-bar-pct { font-size: 12px; font-weight: 600; text-align: right; color: var(--muted); }
@media (max-width: 640px) { .cl-bar-row { grid-template-columns: 40% 1fr 44px; } }
@media print {
  .cl-bar-track { background: #fff !important; border-color: #999 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cl-bar-fill { background: #bbb !important; }
  .cl-bar-pct { color: #111 !important; }
  .cl-bars { max-width: 100%; }
}

/* Rodapé da empresa nos relatórios de tela (Dashboard, Simulação) — só na impressão */
.rel-rodape-emp { display: none; }
@media print {
  .rel-rodape-emp { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; padding-top: 8px; border-top: 1px solid #999; font-size: 11px; color: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-rodape-emp img { max-height: 40px; max-width: 160px; object-fit: contain; }
}

/* Cabeçalho de relatório só-impressão (Gráficos, Consolidado): obra esq · construtora dir */
.graf-head-flex { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rel-head-print { display: none; }
@media print {
  .rel-head-print { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid #1e3a5f; padding-bottom: 10px; margin-bottom: 14px; }
  .rel-head-print img { max-height: 64px; max-width: 190px; object-fit: contain; flex: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-head-print .rhp-info { flex: 1; text-align: center; }
  .rel-head-print .rhp-info h2 { margin: 0; font-size: 18px; }
  .rel-head-print .rhp-sub { font-size: 12px; color: #333; margin-top: 3px; }
}

/* ===== Data Marco (milestones) ===== */
.mk-novo { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.mk-novo .orc-in { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 14px; }
.mk-novo .mk-n-evt { flex: 1; min-width: 220px; }
.mk-table td, .mk-table th { vertical-align: middle; }
.mk-table .orc-in { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 13px; }
.mk-table .mk-data { width: 140px; }
.mk-acoes { white-space: nowrap; text-align: center; }
.mk-acoes .btn-mini { margin: 0 2px; }
.mk-status.mk-st-ok { color: #16a34a; font-weight: 600; }
.mk-status.mk-st-cancel { color: var(--erro); font-weight: 600; }
.mk-status.mk-st-wait { color: var(--muted); font-weight: 600; }

/* ===== Impressão dos Gráficos: limpa e enquadrada em 1 folha (A3 se ficar pequeno) ===== */
@media print {
  .graf-opts, .graf-chk, .graf-tabs { display: none !important; }   /* controles não fazem sentido impressos */
  .graf-vlbl, .graf-barlbl-v { display: none !important; }          /* remove rótulos de % (poluição) */
  .graf-wrap, .orc-wrap { overflow: visible !important; }           /* sem barra de rolagem na impressão */
  .graf-svg { width: 100% !important; height: auto !important; max-width: 100% !important; max-height: 58vh; }
  .graf-tabelas { page-break-before: always; }                      /* tabelas numa folha separada do gráfico */
  .graf-resumo { gap: 8px !important; margin-bottom: 8px !important; }
  .graf-card { padding: 6px 10px !important; }
  .graf-resumo, .graf-legenda, .graf-wrap, .orc-wrap { break-inside: avoid; page-break-inside: avoid; }
  .graf-wrap { margin: 4px 0 8px !important; }
  .graf-table, .orc-table.det-table { font-size: 9.5px !important; }
  .graf-table th, .graf-table td, .orc-table.det-table th, .orc-table.det-table td { padding: 2px 5px !important; }
}

/* Datas marco no gráfico (linha vertical + rótulo do evento) */
.graf-marco { stroke-width: 1.4; stroke-dasharray: 4 3; opacity: .85; }
.graf-marco-lbl { font-size: 10px; font-weight: 700; }
.dash-marcos-chk { margin-left: 6px; }

/* ===== Relatório geral gerado (Fase 2): blocos, cada um numa página na impressão ===== */
.rel-gerado { max-width: 1000px; }
.rel-bloco { margin-bottom: 26px; }
.rel-bloco h3 { font-size: 15px; margin: 0 0 10px; padding-bottom: 5px; border-bottom: 2px solid var(--primary); color: var(--text); }
.rel-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.rel-foto { margin: 0; }
.rel-foto img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.rel-foto figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rel-det-tab td, .rel-det-tab th { font-size: 12px; }
.btn-mini-gerar { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
@media print {
  .rel-bloco { page-break-inside: avoid; }
  .rel-bloco + .rel-bloco { page-break-before: always; }   /* cada bloco em sua folha */
  .rel-foto img { height: 130px; }
}

/* ===== Gráfico Produção na Vistoria (barras por subitem) ===== */
.prod-wrap { max-width: 980px; }
.prod-grupo { margin-bottom: 18px; page-break-inside: avoid; }
.prod-grupo-tit { font-weight: 700; font-size: 13px; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.prod-row { display: grid; grid-template-columns: 340px 1fr; align-items: center; gap: 14px; padding: 3px 0; }
.prod-nome { font-size: 13px; }
.prod-track { position: relative; height: 20px; background: color-mix(in srgb, var(--muted) 14%, var(--surface)); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.prod-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px 0 0 5px; }
.prod-pct { position: absolute; right: 8px; top: 0; height: 100%; display: flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--text); }
.prod-pct.prod-100 { color: #fff; right: 50%; transform: translateX(50%); }
@media (max-width: 640px) { .prod-row { grid-template-columns: 45% 1fr; } }
@media print {
  .prod-track { background: #fff !important; border-color: #999 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prod-pct { color: #111 !important; }
}

/* Link Política de Privacidade (tela de login) */
.login-priv { text-align: center; margin: 14px 0 0; }
.login-priv a { font-size: 12px; color: var(--muted); text-decoration: underline; }
.login-priv a:hover { color: var(--primary); }

/* ===== Carrossel de fotos do Dashboard (últimas 20, auto-gira) ===== */
.dash-fotos-panel { margin-bottom: 18px; }
/* Hero do dashboard: KPIs à esquerda + fotos no canto direito */
.dash-hero { display: flex; gap: 16px; align-items: stretch; margin-bottom: 14px; }
.dash-hero-kpis { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
.dash-hero-fotos { flex: 0 0 340px; max-width: 340px; margin-bottom: 0; display: flex; flex-direction: column; }
.dash-hero-fotos .dash-carousel { flex: 1; }
@media (max-width: 900px) { .dash-hero { flex-wrap: wrap; } .dash-hero-kpis, .dash-hero-fotos { flex: 1 1 100%; max-width: none; } }
.dash-carousel { display: flex; align-items: center; gap: 10px; }
.caro-stage { flex: 1; position: relative; overflow: hidden; border-radius: 12px; background: #0b1220; min-width: 0; aspect-ratio: 4 / 3; }
.caro-img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.caro-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px; color: #fff; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.caro-nav { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(15,23,42,.12); transition: background .12s, border-color .12s; }
.caro-nav:hover { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.caro-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.caro-dot { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 45%, var(--surface)); border: 1px solid var(--border); cursor: pointer; transition: background .12s, transform .12s; }
.caro-dot.ativo { background: var(--primary); transform: scale(1.2); }
@media (max-width: 640px) { .caro-img { height: 220px; } }
@media print { .dash-carousel .caro-nav, .caro-dots { display: none; } .caro-img { height: 260px; object-fit: contain; } }

/* ===== "MÓDULO 2 | CONTROLE DE OBRAS" (centro do topo) — visual metálico ===== */
.topbar { position: relative; }
.topbar-mod2 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; white-space: nowrap; pointer-events: none; }
.topbar-mod2 span { font-family: 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 800; font-size: 19px; letter-spacing: 2.5px; }
.topbar-mod2 .mod2-a { background: linear-gradient(180deg, #4f8bf0 0%, #1e40af 55%, #0f2a6b 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 1px 0 rgba(255,255,255,.15); }
.topbar-mod2 .mod2-b { background: linear-gradient(180deg, #c7d0da 0%, #7b8794 52%, #454f5b 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-mod2 .mod2-sep { color: #b8c1cc; font-weight: 300; font-size: 24px; -webkit-text-fill-color: initial; }
@media (max-width: 1080px) { .topbar-mod2 { display: none; } }
:root[data-theme="dark"] .topbar-mod2 .mod2-b { background: linear-gradient(180deg, #e2e8f0, #94a3b8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar-mod2 .mod2-b { background: linear-gradient(180deg, #e2e8f0, #94a3b8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; } }

/* Dias + Previsão pareados (linha própria abaixo dos donuts) */
.dash-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.dash-pair .graf-card { align-items: center; text-align: center; }
@media (max-width: 520px) { .dash-pair { grid-template-columns: 1fr; } }

/* Fotos na IMPRESSÃO do Dashboard: todas, no fim, 2 por linha (some na tela) */
.dash-fotos-print { display: none; }
@media print {
  .dash-hero-fotos { display: none !important; }   /* esconde o carrossel na impressão */
  .dash-fotos-print { display: block; page-break-before: always; }
  .dash-fotos-print .dfp-tit { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
  .dash-fotos-print .dfp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .dfp-item { margin: 0; page-break-inside: avoid; }
  .dfp-item img { width: 100%; height: 230px; object-fit: contain; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dfp-item figcaption { font-size: 11px; color: #333; margin-top: 3px; }
}

/* Logo da empresa cliente no topo (dentro da obra) — bom tamanho e legível */
.topbar-logo-emp { height: 118px; max-width: 500px; width: auto; object-fit: contain; display: none; flex: none; align-self: center;
  mix-blend-mode: multiply; /* funde o fundo branco do logo com o topo branco */ }
/* no tema escuro o multiply escureceria o logo — desliga */
:root[data-theme="dark"] .topbar-logo-emp { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar-logo-emp { mix-blend-mode: normal; } }

/* ===== Foto: botão "cliente pode ver" ===== */
.foto-card { position: relative; }
.foto-cli { position: absolute; top: 6px; left: 6px; border: 0; border-radius: 8px; width: 30px; height: 30px; cursor: pointer;
  background: rgba(255,255,255,.9); font-size: 15px; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.foto-cli:hover { background: #fff; }
.foto-card.foto-cli-on { outline: 3px solid var(--ok, #16a34a); outline-offset: -3px; }
.foto-card.foto-cli-on .foto-cli { background: var(--ok, #16a34a); }
.foto-cli-tag { display: inline-block; background: var(--ok, #16a34a); color: #fff; font-weight: 700; font-size: 10px; padding: 1px 6px; border-radius: 6px; }

/* ===== Tela "Avanço para o cliente" ===== */
.cli-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.cli-desc { margin-bottom: 12px; max-width: 720px; }
.cli-link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cli-url { flex: 1 1 320px; min-width: 220px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #f1f5f9; color: var(--text); }
.cli-revogar { color: #c0392b; }
.cli-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; cursor: pointer; }
.cli-check input { width: 17px; height: 17px; }
.cli-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.cli-preview-tit { font-weight: 800; color: var(--primary, #1e3a5f); letter-spacing: .5px; text-transform: uppercase; font-size: 13px; margin-bottom: 14px; }
.cli-preview-body { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.cli-donut { flex: 0 0 auto; text-align: center; }
.cli-donut-lbl { font-weight: 700; color: var(--text); margin-top: 2px; }
.cli-fotos { flex: 1 1 300px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; min-width: 0; }
.cli-foto { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.cli-foto img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.cli-foto figcaption { font-size: 11px; color: #444; padding: 4px 6px; }
.cli-nota { margin-top: 12px; }
.cli-itens { display: flex; flex-direction: column; gap: 8px; }
.cli-item { display: grid; grid-template-columns: 34px minmax(140px, 260px) 1fr; gap: 12px; align-items: center; }
.cli-item-eye { border: 1px solid var(--border); background: #f1f5f9; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; }
.cli-item-eye:hover { background: #e2e8f0; }
.cli-item-nome { font-weight: 600; font-size: 14px; }
.cli-item-bar { position: relative; background: #eef2f7; border-radius: 6px; height: 24px; }
.cli-item-fill { background: #2c5aa0; height: 100%; border-radius: 6px; }
.cli-item-pct { position: absolute; top: 50%; left: 8px; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #1f2937; }
.cli-item-off { opacity: .45; }
.cli-item-off .cli-item-fill { background: #94a3b8; }
@media (max-width: 560px) { .cli-item { grid-template-columns: 30px 1fr; } .cli-item-bar { grid-column: 1 / -1; } }

/* ===== Controle de acessos: usuários, perfis, logs ===== */
.tabela { width: 100%; border-collapse: collapse; background: var(--surface); }
.tabela th, .tabela td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.tabela th { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.tabela tbody tr:hover { background: rgba(44,90,160,.04); }
.ta-c { text-align: center !important; }
.ta-r { text-align: right !important; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.tag-admin { background: #1e3a5f; color: #fff; }
.tag-on { background: #dcfce7; color: #166534; }
.tag-off { background: #fee2e2; color: #991b1b; }

/* Modal genérico (overlay + card) */
.modal-cad { position: fixed; inset: 0; background: rgba(15,32,56,.55); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px; }
.modal-box { background: var(--surface); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 90vh; overflow: auto; }
.modal-box.modal-lg { max-width: 620px; }
.modal-box h3 { margin: 0 0 16px; color: var(--primary, #1e3a5f); }
.modal-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-grid2 { grid-template-columns: 1fr; } }

/* Permissões (checkboxes) */
.perm-master { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: 14px; }
.perm-master input { width: 16px; height: 16px; }
/* Bloco das acoes da barra do Cronograma, dentro da grade de permissoes */
.perm-head.perm-sub { margin-top: 16px; padding-top: 12px; border-top: 1px solid #e6ecf5; font-size: 14px; }
.perm-nota { margin: -4px 0 10px; font-size: 12.5px; line-height: 1.4; }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; font-weight: 700; color: var(--primary, #1e3a5f); }
.perm-perfil { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.perm-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.perm-item .perm-lbl { flex: 1; min-width: 0; }
.perm-sel { padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 12.5px; background: var(--surface); color: var(--text); flex: none; }

/* Logs */
.tabela-logs td { font-size: 13px; }
.log-data { white-space: nowrap; color: var(--muted); }
.log-path { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.log-acao { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #eef2f7; color: #334155; }
.log-login { background: #dcfce7; color: #166534; }
.log-logout { background: #f1f5f9; color: #475569; }
.log-post { background: #dbeafe; color: #1e40af; }
.log-delete { background: #fee2e2; color: #991b1b; }

.secao-acoes { display: flex; gap: 10px; align-items: center; }

.login-forgot { text-align:center; margin:10px 0 0; }
.login-forgot a { color:#9cc3f0; font-size:13.5px; text-decoration:none; }
.login-forgot a:hover { text-decoration:underline; }

/* ======================= DIÁRIO DE OBRA ======================= */
/* Tabelas rolam na horizontal em tela estreita (sem mudar a aparencia) */
.tabela-wrap { overflow-x: auto; }

.diario-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diario-acoes input[type="date"] {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 14px; background: var(--surface); color: var(--text); outline: none;
}
.diario-acoes input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }

/* Navegacao de mes da lista */
.mes-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 14px; }
/* So a primeira letra: "agosto de 2026" -> "Agosto de 2026" (capitalize maiusculiza toda palavra) */
.mes-atual { font-weight: 700; color: var(--primary); min-width: 190px; text-align: center; }
.mes-atual::first-letter { text-transform: uppercase; }

/* Lista de dias */
.dia-linha { cursor: pointer; }
.dia-data { white-space: nowrap; }
.dia-sem { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.dia-sem::first-letter { text-transform: uppercase; }
.dia-obs { max-width: 380px; }

/* Cabecalho do dia aberto */
.dia-head h2 { margin-top: 6px; font-size: 20px; }
/* inline-block: ::first-letter so vale em caixa de bloco */
.dia-head .dia-sem { display: inline-block; margin-left: 8px; font-size: 14px; }

/* Cartao de servico */
.serv-lista { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.serv-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 2px 8px rgba(2,6,23,.05);
}
.serv-topo { display: flex; align-items: center; gap: 10px; }
.serv-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-content: center; font-size: 13px; font-weight: 700;
}
/* Descricao do servico: editor com negrito, italico e listas */
.serv-editor {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); overflow: hidden; transition: border-color .12s, box-shadow .12s;
}
.serv-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.serv-tools {
  display: flex; align-items: center; gap: 3px; padding: 5px 7px;
  border-bottom: 1px solid var(--border); background: #f8fafc;
}
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent;
  background: none; border-radius: 7px; cursor: pointer; color: var(--muted);
  transition: background .12s, color .12s, border-color .12s;
}
.st-btn:hover { background: #e2e8f0; color: var(--primary); }
.st-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.st-sep { width: 1px; height: 20px; background: var(--border); margin: 0 5px; }
/* Ditado por voz: rotulo ao lado e pulso vermelho enquanto escuta */
.st-voz { border-color: var(--border); background: var(--surface); }
.st-voz-txt { font-size: 12.5px; font-weight: 600; }
@media (max-width: 720px) { .st-voz-txt { display: none; } }
.st-voz.ouvindo {
  background: #fee2e2; border-color: var(--erro); color: var(--erro);
  animation: voz-pulso 1.1s ease-in-out infinite;
}
@keyframes voz-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.45); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
/* Folha de caderno: pauta horizontal + margem vermelha a esquerda.
   line-height e o passo do gradiente TEM que ser o mesmo (28px) para o texto
   assentar em cima da linha; background-position acompanha o padding-top. */
.editor-caderno {
  min-height: 90px; max-height: 280px; overflow-y: auto; outline: none;
  padding: 7px 14px 9px 46px; font-size: 14.5px; line-height: 28px;
  background-color: #fffdf7;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 27px, #dbe6f0 27px 28px),
    linear-gradient(to right, transparent 0 34px, #f3c8c8 34px 35px, transparent 35px);
  background-position: 0 7px, 0 0;
  background-repeat: repeat, no-repeat;
  background-attachment: local, local;
}
.editor-caderno:empty::before { content: attr(data-ph); color: #a8b3c2; }
.editor-caderno ul, .editor-caderno ol { margin: 0; padding-left: 24px; }
.editor-caderno li { margin: 0; }
.editor-caderno p { margin: 0; }

/* ---- Ocorrencias do dia: numero | categoria | tipo | texto | lixeira ---- */
.oco-bloco { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.oco-cab, .oco-linha {
  display: grid; grid-template-columns: 26px minmax(140px, 1fr) minmax(140px, 1fr) minmax(260px, 2.2fr) 34px;
  gap: 10px; align-items: start;
}
.oco-cab {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
}
.oco-linha { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.oco-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 6px;
}
.oco-linha select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.oco-editor { margin: 0; }
.oco-desc { min-height: 62px; }
.oco-linha-del { margin-top: 4px; }
@media (max-width: 900px) {
  .oco-cab { display: none; }
  .oco-linha { grid-template-columns: 26px 1fr 34px; }
  .oco-linha .oco-tipo-sel { grid-column: 2 / 4; }
  .oco-linha .oco-editor { grid-column: 1 / 4; }
}

/* Linha "mao de obra: propria / terceirizada [+ empresa]" */
.serv-mo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0 0 36px; }
.serv-mo-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.radio input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.serv-terc { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.serv-terceira {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px;
  font-size: 14px; background: var(--surface); color: var(--text); max-width: 260px;
}
.serv-terceira:focus { border-color: var(--primary); outline: none; }

/* Efetivo dentro do servico */
.serv-efetivo { margin: 14px 0 0 36px; border-top: 1px dashed var(--border); padding-top: 10px; }
.serv-efetivo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.serv-efetivo-head span:first-child { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.serv-total { font-size: 13px; color: var(--muted); }
.serv-total b { color: var(--primary); font-size: 15px; }
.tabela-efetivo { max-width: 520px; }
.tabela-efetivo th, .tabela-efetivo td { padding: 6px 8px; }
.tabela-efetivo td:first-child { width: 100%; }
.ef-cargo, .ef-qtd {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 14px; outline: none; background: var(--surface);
}
.ef-cargo { width: 100%; }
.ef-qtd { width: 78px; text-align: center; }
.ef-cargo:focus, .ef-qtd:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.serv-efetivo .ef-add { margin-top: 8px; }

/* Efetivo proprio: pessoas do cadastro */
.ef-sel-abrir:disabled { opacity: .5; cursor: default; }

/* Modal de selecao MULTIPLA do efetivo */
.modal-efetivo { display: flex; flex-direction: column; max-height: 86vh; }
.efm-serv { margin: -8px 0 14px; font-size: 13.5px; }
.efm-topo { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.efm-topo input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; outline: none;
}
.efm-topo input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.efm-lista {
  flex: 1; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px;
  display: flex; flex-direction: column; gap: 2px; min-height: 180px;
}
.efm-item {
  display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background .1s;
}
.efm-item:hover { background: #f1f5f9; }
.efm-item.on { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.efm-item input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.efm-nome { font-weight: 600; }
.efm-item.usado .efm-nome { color: var(--erro); }
.efm-cargo { color: var(--muted); font-size: 13px; }
.efm-vazio { padding: 22px; text-align: center; }
.efm-contagem { margin-right: auto; font-size: 13.5px; font-weight: 600; color: var(--primary); }
.modal-efetivo .modal-acoes { align-items: center; }
/* Alerta: a pessoa ja foi lancada em outro servico do mesmo dia */
.ef-repetido td { background: #fef2f2; }
.ef-repetido td:first-child { color: var(--erro); font-weight: 600; }
.ef-alerta {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: #991b1b; background: #fee2e2; border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}
/* Dividido entre frentes, mas DENTRO da jornada: informativo, nao alarme */
.ef-nota {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600;
  color: #475569; background: #eef2f7; border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}
.ef-horas {
  width: 72px; text-align: center; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; font-size: 14px; outline: none; background: var(--surface);
}
.ef-horas:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.tabela-pessoas { max-width: 720px; }
/* Terceirizado: so a quantidade de gente da empreiteira */
.ef-terceiros { display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 4px 0; }
.ef-terceiros span { color: var(--muted); font-weight: 600; }
.ef-terceiros input {
  width: 96px; text-align: center; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; font-size: 15px; font-weight: 600; outline: none; background: var(--surface);
}
.ef-terceiros input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }
.serv-horas { color: var(--muted); font-weight: 600; }

/* Botao principal do diario: lancar servico e a acao do dia */
.btn-add-servico {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 2px dashed color-mix(in srgb, var(--primary) 45%, #fff);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  color: var(--primary); border-radius: var(--radius); padding: 16px 20px;
  font-size: 15.5px; font-weight: 700; cursor: pointer; letter-spacing: .2px;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn-add-servico:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: var(--primary); box-shadow: 0 4px 14px rgba(30,58,95,.14);
}
.btn-add-servico:active { transform: translateY(1px); }
/* Adicionar serviço + repetir de outro dia, lado a lado */
.serv-add-linha { display: flex; gap: 10px; flex-wrap: wrap; }
.serv-add-linha .btn-add-servico { flex: 1 1 260px; width: auto; }
.btn-add-sec { border-style: solid; border-color: var(--border); color: var(--texto); background: var(--surface); }
.btn-add-sec .bas-mais { background: var(--muted); }
.rep-equipe { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; white-space: nowrap; }
.efm-topo select { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: var(--surface); }
.bas-mais {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 21px; font-weight: 700;
  display: grid; place-content: center; line-height: 1; padding-bottom: 2px;
}
/* Versao menor, para dentro do cartao de servico */
.btn-add-sm { padding: 11px 16px; font-size: 14px; margin-top: 2px; }
.btn-add-sm .bas-mais { width: 23px; height: 23px; font-size: 17px; }
.btn-add-servico:disabled { opacity: .55; cursor: default; }
.btn-add-servico:disabled:hover { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); box-shadow: none; }

/* Rodape do dia */
.dia-obs-campo { margin-top: 18px; max-width: 720px; }
/* ---- Fotos do serviço (evidência) ---- */
.serv-fotos { margin: 12px 0 0 36px; border-top: 1px dashed var(--border); padding-top: 10px; }
.serv-fotos-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px;
}
.foto-add { cursor: pointer; }
.foto-grade { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.foto-item { position: relative; margin: 0; width: 116px; height: 116px; }
.foto-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border); background: #eef2f7; display: block;
}
.foto-del {
  position: absolute; top: 4px; right: 4px; border: 0; border-radius: 7px; cursor: pointer;
  background: rgba(15,23,42,.72); color: #fff; font-size: 13px; line-height: 1; padding: 4px 6px;
}
.foto-del:hover { background: var(--erro); }
.foto-vazio { margin: 0; font-size: 13px; }
@media (max-width: 640px) {
  .serv-fotos { margin-left: 0; }
  .foto-item { width: calc(33.33% - 6px); height: auto; aspect-ratio: 1; }
}

/* Observações do dia: mesmo editor de caderno dos serviços e das ocorrências */
.dia-obs-lbl { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.dia-obs-campo .serv-editor { margin: 0; }
.dia-total { margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.dia-total b { color: var(--primary); font-size: 20px; }

@media (max-width: 640px) {
  .serv-mo, .serv-efetivo { margin-left: 0; }
  .dia-obs { display: none; }
}

/* ---- Funcionarios ---- */
.filtro-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 12px; }
.filtro-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: border-color .12s, color .12s, background .12s;
}
.filtro-chip:hover { border-color: var(--primary); color: var(--primary); }
.filtro-chip.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.filtro-n {
  font-size: 12px; font-weight: 700; background: #eef2f7; color: #475569;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.filtro-chip.ativo .filtro-n { background: rgba(255,255,255,.22); color: #fff; }
.func-reg { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); white-space: nowrap; }
.func-inativo td:not(:last-child) { opacity: .55; }

/* ---- Cabecalho do relatorio diario ---- */
.rdo-cab {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(2,6,23,.05);
}
.rdo-cab-topo { display: flex; align-items: center; gap: 18px; }
.rdo-cab-logo { width: 74px; height: 54px; object-fit: contain; flex: none; }
.rdo-cab-vazio { display: block; }
.rdo-cab-tit { flex: 1; text-align: center; min-width: 0; }
.rdo-cab-tit h3 {
  margin: 0; font-size: 19px; font-weight: 800; color: var(--primary);
  letter-spacing: .6px; text-transform: uppercase;
}
.rdo-cab-sub { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 5px; font-size: 13.5px; }
.rdo-cab-sub b { color: var(--muted); font-weight: 600; }
.rdo-cab-caixas { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.cab-caixa { flex: 1; min-width: 132px; border: 1.5px solid var(--primary); border-radius: 10px; padding: 8px 12px; text-align: center; }
.cab-caixa-l { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.cab-caixa-n { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.15; }
.cab-atraso { border-color: var(--erro); }
.cab-atraso .cab-caixa-n { color: var(--erro); }

@media (max-width: 640px) {
  .rdo-cab-topo { flex-wrap: wrap; justify-content: center; }
  .rdo-cab-tit h3 { font-size: 16px; }
}

/* Permissao de nivel unico: caixa de marcacao em vez de "Nenhum/Ver" */
.perm-bool { justify-content: space-between; }
.perm-bool input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: none; }

/* ---- Escopo do contrato da terceirizada ---- */
.terc-escopo {
  display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.35;
  max-width: 460px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.modal-box textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  outline: none; font: inherit; resize: vertical; background: var(--surface); color: var(--text);
}
.modal-box textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15); }

/* Selo da gravacao automatica: nasce vazio e some da tela; so aparece quando
   ha algo a dizer (gravando, gravado, falhou). */
.dia-status:empty { display: none; }

/* Aviso com acao (desfazer) */
.toast-acao { display: flex; align-items: center; gap: 14px; }
.toast-acao button {
  border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: inherit;
  border-radius: 8px; padding: 4px 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.toast-acao button:hover { background: rgba(255,255,255,.3); }

/* ---- Tipos de ocorrencia (agrupados por categoria) ---- */
.oco-grupo {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px 14px; margin-bottom: 12px;
}
.oco-grupo-cab {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 13px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .4px;
}
.oco-ico { flex: none; }
.oco-grupo-cab .oco-cat-edit, .oco-grupo-cab .oco-cat-del {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 14px; line-height: 1; padding: 4px 6px; border-radius: 7px;
}
.oco-grupo-cab .oco-cat-del { font-size: 19px; }
.oco-grupo-cab .oco-cat-edit:hover { background: #eef2f7; color: var(--primary); }
.oco-grupo-cab .oco-cat-del:hover { background: #fee2e2; color: var(--erro); }
.oco-conta {
  margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: #eef2f7; border-radius: 999px; padding: 1px 9px; text-transform: none; letter-spacing: 0;
}
.oco-itens { display: flex; flex-wrap: wrap; gap: 7px; }
.oco-item {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 13px;
}
.oco-item button {
  border: 0; background: none; cursor: pointer; padding: 0 3px; line-height: 1;
  font-size: 12px; color: var(--muted); border-radius: 50%;
}
.oco-item .oco-del { font-size: 17px; }
.oco-item button:hover { color: var(--primary); }
.oco-item .oco-del:hover { color: var(--erro); }
.oco-vazio {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center;
}
.oco-vazio p { margin: 0 0 14px; }

/* ---- Aniversariantes do mes ---- */
.aniv-faixa {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(90deg, #fff7ed 0%, #fefce8 100%);
  border: 1px solid #fde68a; border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 16px;
}
.aniv-tit { font-size: 12px; font-weight: 700; color: #92400e; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.aniv-mes { text-transform: capitalize; }
.aniv-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.aniv-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #fff;
  border: 1px solid #fcd34d; border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--text);
}
.aniv-chip b { color: #b45309; font-weight: 800; }
.aniv-chip.hoje { background: #fbbf24; border-color: #d97706; font-weight: 600; }
.aniv-chip.hoje b { color: #7c2d12; }
.aniv-chip em { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; color: #7c2d12; }
/* Precisa vencer ".aniv-chip.hoje b" na especificidade — senao o texto herda a
   cor marrom e fica igual ao fundo da pilula, virando um bloco escuro ilegivel. */
.aniv-chip b.aniv-idade, .aniv-chip.hoje b.aniv-idade {
  background: #7c2d12; color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 1px 9px; margin-left: 2px; white-space: nowrap;
}

/* ---- Clima: faixa-resumo dentro do dia ---- */
.ico-clima { display: block; }
.clima-faixa {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px 14px; margin-bottom: 16px;
}
.clima-faixa-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.clima-titulo { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.prod-produtivo { background: #dcfce7; color: #166534; }
.prod-parcial { background: #fef3c7; color: #92400e; }
.prod-improdutivo { background: #fee2e2; color: #991b1b; }
/* Calendario + os tres periodos, lado a lado.
   minmax(0,1fr) para as quatro colunas ficarem do MESMO tamanho — com 1fr puro
   o calendario encolhia (min-content menor que o dos cartoes de clima). */
.cl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cl-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 12px; transition: border-color .15s, background .15s;
}
.cl-card.cl-sol { border-color: #fbbf24; background: #fffbeb; }
.cl-card.cl-nublado { border-color: #94a3b8; background: #f8fafc; }
.cl-card.cl-chuva_praticavel { border-color: #38bdf8; background: #f0f9ff; }
.cl-card.cl-chuva_impraticavel { border-color: #dc2626; background: #fef2f2; }
.cl-card-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cl-per { font-size: 14px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }
.cl-limpar { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 3px; }
.cl-limpar:hover { color: var(--erro); }
.cl-ops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cl-op {
  display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer;
  border: 2px solid transparent; border-radius: 12px; background: rgba(255,255,255,.75);
  padding: 10px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-align: center; line-height: 1.2; transition: transform .12s, border-color .12s, color .12s, box-shadow .12s;
}
.cl-op:hover { transform: translateY(-2px); color: var(--primary); box-shadow: 0 4px 12px rgba(2,6,23,.10); }
.cl-op.sel { border-color: var(--primary); color: var(--primary); background: #fff; box-shadow: 0 4px 14px rgba(30,58,95,.16); }
.cl-prods { display: flex; gap: 6px; margin-top: 12px; }
.cl-prod {
  flex: 1; border: 1.5px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 4px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .12s;
}
.cl-prod:disabled { opacity: .45; cursor: default; }
.cl-prod:not(:disabled):hover { border-color: var(--primary); }
.cl-prod.prod-produtivo.sel { background: #dcfce7; border-color: #16a34a; color: #166534; }
.cl-prod.prod-parcial.sel { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.cl-prod.prod-improdutivo.sel { background: #fee2e2; border-color: #dc2626; color: #991b1b; }

/* ---- Card do calendario (o 1o da fileira: e a data do diario) ---- */
.cl-card-cal { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.mini-cal { text-align: center; }
.mc-mes { font-size: 11.5px; font-weight: 700; color: var(--primary); text-transform: capitalize; margin-bottom: 6px; }
.mc-grade { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mc-cab { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; line-height: 18px; }
.mc-dia, .mc-vazio { font-size: 12px; line-height: 24px; height: 24px; border-radius: 6px; color: var(--text); }
.mc-dia.fds { color: var(--muted); }
.mc-dia.hoje { background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 2px 6px rgba(30,58,95,.3); }
.mc-data {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border);
  font-size: 17px; font-weight: 800; color: var(--primary); text-align: center;
}

@media (max-width: 1100px) { .cl-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cl-cards { grid-template-columns: 1fr; } }

/* ---- Mapa de chuva (relatorio mensal) ---- */
.mapa-wrap { display: flex; flex-direction: column; align-items: center; }
.mapa-chuva { width: 100%; max-width: 560px; height: auto; }
.mapa-rot { paint-order: stroke; stroke: #fff; stroke-width: 2.5px; stroke-linejoin: round; }
.mapa-legenda { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); }
.mapa-leg-item { display: inline-flex; align-items: center; gap: 6px; }
.mapa-leg-item i { width: 14px; height: 14px; border: 1px solid #0f172a; display: inline-block; border-radius: 3px; }
.leg-bolinha { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid #0f172a; margin-right: 7px; vertical-align: -1px; }
.tabela-clima tfoot td { background: #f8fafc; border-top: 2px solid var(--border); }

/* ---- Indicadores e grafico do clima ---- */
.kpi-secao { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 22px 0 10px; }
.kpi-linha { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 18px; min-width: 128px; flex: 1;
}
.kpi-n { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.kpi-l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi-chuva .kpi-n { color: #0284c7; }
.kpi-ruim .kpi-n { color: var(--erro); }
.graf-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.graf-chuva { width: 100%; min-width: 420px; height: auto; }
.graf-legenda { display: flex; gap: 18px; justify-content: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.graf-legenda i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 720px) {
  .clima-periodos { grid-template-columns: 1fr; }
}

/* ---- Assinatura do diario ---- */
.tag-espera { background: #fef3c7; color: #92400e; }
.dia-head h2 .tag { vertical-align: middle; margin-left: 10px; font-size: 11px; }
.dia-travado { margin: 0 0 14px; font-size: 13.5px; }
/* Situacao da gravacao automatica, no lugar do antigo botao Salvar */
.dia-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.dia-status::before { content: '●'; font-size: 9px; }
.st-ok { color: #166534; background: #dcfce7; }
.st-pend { color: #92400e; background: #fef3c7; }
.st-salvando { color: #1e40af; background: #dbeafe; }
.st-erro { color: #991b1b; background: #fee2e2; }

.assin-painel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px;
}
.assin-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.assin-lista { list-style: none; margin: 0; padding: 0; counter-reset: assin; }
.assin-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.assin-item:last-child { border-bottom: 0; }
.assin-ico {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-content: center;
  font-size: 12px; font-weight: 700; background: #e2e8f0; color: var(--muted);
}
.assin-ok .assin-ico { background: #dcfce7; color: #166534; }
.assin-vez .assin-ico { background: #fef3c7; color: #92400e; }
.assin-quem { display: flex; flex-direction: column; line-height: 1.3; }
.assin-quem .muted { font-size: 12.5px; }
.assin-quando { margin-left: auto; font-size: 12.5px; white-space: nowrap; }

.resp-crea { display: block; font-size: 12px; }

@media (max-width: 640px) {
  .assin-quando { display: none; }
}

/* ================= CRONOGRAMA (Gantt) ================= */
.crono-acoes { display: flex; gap: 8px; align-items: center; }
.crono-filtros {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--card, #fff); border: 1px solid var(--linha, #e2e8f0); border-radius: 10px;
}
.crono-filtros input[type="text"], .crono-filtros input:not([type]), .crono-filtros select { min-width: 150px; }
.crono-filtros .cf-data { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #64748b); }
.crono-filtros .cf-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }

.crono-legenda { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; font-size: 12.5px; }
.crono-legenda .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--muted, #64748b); }
.crono-legenda .lg::before { content: ''; width: 14px; height: 10px; border-radius: 3px; background: #cbd5e1; }
.crono-legenda .lg-concluida::before { background: #2563eb; }
.crono-legenda .lg-mes-corrente::before { background: #16a34a; }
.crono-legenda .lg-atrasada::before { background: #dc2626; }
.crono-legenda .lg-critica::before { background: transparent; border: 2px solid #dc2626; }

/* dois painéis lado a lado, rolando juntos */
.gantt { display: flex; border: 1px solid var(--linha, #e2e8f0); border-radius: 10px; overflow: hidden; background: var(--card, #fff); }
.gantt-tabela-wrap { flex: 0 0 auto; max-width: 62%; overflow: auto; max-height: 62vh; border-right: 2px solid var(--linha, #e2e8f0); }
.gantt-tempo-wrap { flex: 1 1 auto; overflow: auto; max-height: 62vh; }

.gantt-tabela { border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.gantt-tabela thead th {
  position: sticky; top: 0; z-index: 2; background: var(--fundo-2, #f8fafc);
  border-bottom: 1px solid var(--linha, #e2e8f0); padding: 6px 8px; text-align: left; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #64748b);
}
.gantt-tabela thead .g-cab-vazio th { height: 22px; top: 0; }
.gantt-tabela thead tr:last-child th { top: 22px; }
.gantt-tabela tbody td { padding: 0 8px; height: 30px; border-bottom: 1px solid var(--linha-fraca, #f1f5f9); }
.gantt-tabela .c-num { text-align: right; }
.gantt-tabela .c-nome { overflow: hidden; text-overflow: ellipsis; }
.gantt-tabela .c-pred, .gantt-tabela .c-pav, .gantt-tabela .c-tipo { color: var(--muted, #64748b); }
.gantt-tabela tbody tr { cursor: pointer; }
.gantt-tabela tbody tr:hover { background: var(--hover, #f8fafc); }
.gantt-tabela tbody tr.e-resumo { font-weight: 600; background: var(--fundo-2, #f8fafc); }
.gantt-tabela tbody tr.e-critica .c-nome { color: #b91c1c; }
.gantt-tabela tbody tr.sit-concluida .c-nome { color: #1d4ed8; }
.gantt-tabela tbody tr.sit-atrasada .c-nome { color: #b91c1c; font-weight: 600; }
.gantt-tabela tbody tr.sit-mes-corrente .c-nome { color: #15803d; }

/* faixa de tempo */
.gantt-tempo { position: relative; }
.g-cab-meses, .g-cab-dias { display: flex; position: sticky; z-index: 2; background: var(--fundo-2, #f8fafc); }
.g-cab-meses { top: 0; height: 22px; }
.g-cab-dias { top: 22px; height: 30px; border-bottom: 1px solid var(--linha, #e2e8f0); }
.g-mes {
  flex: 0 0 auto; font-size: 11.5px; text-transform: capitalize; color: var(--muted, #64748b);
  border-right: 1px solid var(--linha, #e2e8f0); padding-left: 6px; line-height: 22px; overflow: hidden;
}
.g-dia {
  flex: 0 0 26px; width: 26px; text-align: center; line-height: 30px; font-size: 11px;
  color: var(--muted, #64748b); border-right: 1px solid var(--linha-fraca, #f1f5f9);
}
.g-dia.g-folga { background: var(--fundo-3, #f1f5f9); }
.g-dia.g-hoje { background: #fde68a; color: #92400e; font-weight: 700; }

.g-corpo { position: relative; }
.g-linha { position: relative; height: 30px; border-bottom: 1px solid var(--linha-fraca, #f1f5f9); }
.g-barra {
  position: absolute; top: 6px; height: 18px; border-radius: 4px; background: #94a3b8;
  overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.g-barra.sit-concluida { background: #2563eb; }
.g-barra.sit-mes-corrente { background: #16a34a; }
.g-barra.sit-atrasada { background: #dc2626; }
.g-barra.sit-futura { background: #94a3b8; }
.g-barra.e-critica { box-shadow: inset 0 0 0 2px #b91c1c; }
.g-barra.e-resumo { height: 10px; top: 10px; border-radius: 2px; background: #334155; }
.g-prog { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, .45); }
.g-sup-alerta {
  position: absolute; right: 2px; top: 1px; width: 15px; height: 15px; border-radius: 50%;
  background: #f59e0b; color: #7c2d12; font-size: 11px; font-weight: 700; text-align: center; line-height: 15px;
}
.g-marco {
  position: absolute; top: 8px; width: 14px; height: 14px; background: #0f172a;
  transform: rotate(45deg); border-radius: 2px;
}

/* etiquetas de suprimento */
.sup-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: #e2e8f0; color: #475569; }
.sup-tag.sup-solicitado { background: #fef3c7; color: #92400e; }
.sup-tag.sup-cotacao { background: #dbeafe; color: #1e40af; }
.sup-tag.sup-comprado { background: #ddd6fe; color: #5b21b6; }
.sup-tag.sup-entregue { background: #dcfce7; color: #166534; }
.sup-tag.sup-atrasa { box-shadow: 0 0 0 2px #f59e0b; }

.pred-linha, .sup-linha { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pred-linha .pred-id { flex: 1 1 auto; }
.pred-linha .pred-tipo { flex: 0 0 70px; }
.pred-linha .pred-lag { flex: 0 0 70px; }
.cal-semana { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.cal-dia { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.cal-add { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }

@media (max-width: 900px) {
  .gantt { flex-direction: column; }
  .gantt-tabela-wrap { max-width: 100%; border-right: 0; border-bottom: 2px solid var(--linha, #e2e8f0); }
}

/* ---- EAP: numeração, menu da linha e edição sem modal (estilo planilha) ---- */
.gantt-tabela .c-eap { text-align: left; color: var(--muted, #64748b); font-variant-numeric: tabular-nums; padding-right: 10px; }
.gantt-tabela tbody tr.e-resumo .c-eap { color: #0f172a; }
.gantt-tabela tbody .c-nome { position: relative; }
.cr-menu {
  border: 0; background: transparent; cursor: pointer; color: var(--muted, #64748b);
  font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 4px;
  opacity: 0; transition: opacity .12s;
}
.gantt-tabela tbody tr:hover .cr-menu { opacity: 1; }
.cr-menu:hover { background: var(--linha, #e2e8f0); color: #0f172a; }
.cr-nome-txt { cursor: text; }

.cr-menu-flut {
  position: fixed; z-index: 60; background: #fff; border: 1px solid var(--linha, #e2e8f0);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); padding: 5px; min-width: 190px;
}
.cr-menu-flut button {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; text-align: left; color: #0f172a;
}
.cr-menu-flut button:hover { background: var(--fundo-2, #f1f5f9); }
.cr-menu-flut button.perigo { color: #b91c1c; }
.cr-menu-flut button.perigo:hover { background: #fef2f2; }
.cr-menu-flut .mi { width: 18px; text-align: center; }

.cr-inline {
  border: 1px solid #2563eb; border-radius: 5px; padding: 3px 7px; font-size: 13px;
  min-width: 260px; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.gantt-tabela tbody tr.cr-nova { background: #eff6ff; }
.cr-dica { margin-left: 10px; font-size: 11.5px; }
.crono-vazio { padding: 18px; border: 1px dashed var(--linha, #e2e8f0); border-radius: 10px; background: var(--card, #fff); }
.crono-vazio .cr-inline { margin-top: 4px; }

/* ---- Calendário completo e importar/exportar ---- */
.cal-copiar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: var(--fundo-2, #f8fafc); padding: 10px; border-radius: 8px; margin: 10px 0; }
.cal-copiar .field { flex: 1; min-width: 180px; margin: 0; }
.cal-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0 4px; }
.cal-add .field { margin: 0; }
.cal-add .cal-desc { flex: 1; min-width: 180px; }
.cal-planilha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ie-botoes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

/* ---- Edição na própria linha (planilha): campo sem moldura até receber foco ---- */
.gantt-tabela .ed {
  width: 100%; border: 1px solid transparent; background: transparent; border-radius: 4px;
  padding: 2px 5px; font: inherit; color: inherit; min-width: 0;
}
.gantt-tabela .ed:hover { border-color: var(--linha, #e2e8f0); background: #fff; }
.gantt-tabela .ed:focus { outline: none; border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.gantt-tabela .ed.gravando { opacity: .55; }
.gantt-tabela .ed[disabled] { color: var(--muted, #94a3b8); }
.gantt-tabela td.c-dur .ed, .gantt-tabela td.c-pct .ed { text-align: right; }
.gantt-tabela .c-dur, .gantt-tabela .c-pct { width: 78px; }
.gantt-tabela .c-data { width: 118px; white-space: nowrap; }
.gantt-tabela .c-eap { width: 62px; }
.gantt-tabela .calc { color: var(--muted, #64748b); padding: 2px 5px; display: inline-block; }
.gantt-tabela tbody tr.e-resumo .calc { color: #0f172a; font-weight: 600; }
.gantt-tabela .mk { margin-right: 4px; }
.sup-abrir { border: 0; background: transparent; cursor: pointer; padding: 0; }

/* painel do menu / colunas / suprimentos */
.cr-menu-flut .cm-tit { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted, #64748b); padding: 6px 10px 4px; }
.cr-menu-flut .cm-chk { display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.cr-menu-flut .cm-chk:hover { background: var(--fundo-2, #f1f5f9); }
.cr-menu-flut .cm-chk.fixa { opacity: .6; cursor: default; }
.sup-painel { min-width: 330px; max-width: 400px; max-height: 70vh; overflow: auto; padding: 8px 10px 10px; }
.sup-painel .sup-item { border-top: 1px solid var(--linha-fraca, #f1f5f9); padding: 8px 0; }
.sup-painel .sup-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sup-painel .sup-cab b { flex: 1; font-size: 13px; }
.sup-painel .sup-datas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.sup-painel .sup-datas label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted, #64748b); }
.sup-painel .sup-datas input { font-size: 12.5px; padding: 3px 5px; }
.sup-painel .sup-novo { display: flex; gap: 8px; margin-top: 10px; }
.sup-painel .sup-novo input { flex: 1; }

/* ---- Larguras de coluna arrastáveis (colgroup + table-layout fixo) ---- */
.gantt-tabela { table-layout: fixed; }
.gantt-tabela th { overflow: hidden; text-overflow: ellipsis; }
.gantt-tabela td { overflow: hidden; }
.gantt-tabela th { position: relative; }
.col-puxador {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 3; user-select: none;
}
.col-puxador:hover { background: #2563eb; opacity: .35; }
body.redimensionando { cursor: col-resize; user-select: none; }
body.redimensionando * { cursor: col-resize !important; }

/* divisor entre a tabela e o Gantt */
.gantt-divisor {
  flex: 0 0 6px; cursor: col-resize; background: var(--linha, #e2e8f0);
  border-left: 1px solid var(--linha, #e2e8f0); border-right: 1px solid var(--linha, #e2e8f0);
}
.gantt-divisor:hover { background: #2563eb; }
.gantt-tabela-wrap { border-right: 0; }

/* escala da linha do tempo */
.crono-escala {
  height: 30px; border: 1px solid var(--linha, #e2e8f0); border-radius: 8px;
  padding: 0 8px; font-size: 13px; background: var(--card, #fff); color: inherit;
}
.g-dia { flex: 0 0 auto; }
.cr-menu-flut .cm-reset {
  display: block; width: 100%; margin-top: 6px; border: 0; border-top: 1px solid var(--linha, #e2e8f0);
  background: transparent; padding: 8px 10px; cursor: pointer; font-size: 13px; text-align: left; color: #0f172a;
}
.cr-menu-flut .cm-reset:hover { background: var(--fundo-2, #f1f5f9); }

/* Cabeçalho fixo: garante que NENHUMA coluna perca o sticky por especificidade de outra
   regra (foi o que deslocava o cabeçalho "Atividade" 22px para baixo). */
.gantt-tabela thead th { position: sticky; }
.crono-versao { font-size: 11px; color: var(--muted, #94a3b8); padding: 0 2px; letter-spacing: .02em; }

/* Célula da Atividade: botão ⋮ e campo dividem a largura, sem ninguém transbordar. */
.gantt-tabela td.c-nome { padding-right: 4px; }
.nome-cel { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nome-cel .ed { flex: 1 1 auto; width: auto; min-width: 0; }
.nome-cel .cr-menu { flex: 0 0 auto; }

/* ---- Prazo de compra: dias antes do início + o dia de disparar ---- */
.sup-cel { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sup-cel .ed { flex: 0 0 54px; width: 54px; text-align: right; }
.sup-quando { font-size: 11.5px; color: var(--muted, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-quando.atrasado { color: #b91c1c; font-weight: 600; }

/* marco de compra no gráfico: losango no dia do disparo, tracejado até o serviço */
.g-compra { position: absolute; top: 13px; height: 4px; border-top: 2px dashed #f59e0b; pointer-events: auto; }
.g-compra.atrasado { border-top-color: #dc2626; }
.g-compra-mk {
  position: absolute; left: -5px; top: -6px; width: 11px; height: 11px;
  background: #f59e0b; transform: rotate(45deg); border-radius: 2px;
}
.g-compra.atrasado .g-compra-mk { background: #dc2626; }

/* ---- Recolher/expandir ramos; resumo só muda de cor ao fechar 100% ---- */
.cr-ramo {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer; padding: 0 2px;
  color: var(--muted, #64748b); font-size: 11px; line-height: 1; width: 16px;
}
.cr-ramo:hover { color: #0f172a; }
.cr-ramo-vazio { flex: 0 0 auto; display: inline-block; width: 16px; }
.cr-fechados { flex: 0 0 auto; font-size: 11px; color: var(--muted, #94a3b8); }

/* resumo neutro: vermelho e verde são das folhas, que é onde o serviço acontece */
.gantt-tabela tbody tr.sit-resumo .ed,
.gantt-tabela tbody tr.sit-resumo .calc { color: #0f172a; }
.g-barra.sit-resumo { background: #334155; }
/* resumo concluído: azul e em destaque, é o tópico que "fechou" */
.gantt-tabela tbody tr.e-resumo.sit-concluida .ed,
.gantt-tabela tbody tr.e-resumo.sit-concluida .calc { color: #1d4ed8; font-weight: 700; }
.gantt-tabela tbody tr.e-resumo.sit-concluida { background: #eff6ff; }

/* ---- Suprimento como linha neutra do cronograma ---- */
.sup-marca {
  border: 1px dashed var(--linha, #cbd5e1); background: transparent; border-radius: 999px;
  padding: 1px 9px; font-size: 11.5px; color: var(--muted, #64748b); cursor: pointer; white-space: nowrap;
}
.sup-marca:hover { border-color: #2563eb; color: #1d4ed8; }
.sup-marca.marcado { border-style: solid; border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.modal-box.modal-pq { max-width: 420px; }

/* a linha de compra: cinza listrado, para não se confundir com serviço executado */
.gantt-tabela tbody tr.e-neutra .ed,
.gantt-tabela tbody tr.e-neutra .calc { color: #7c5e10; font-style: italic; }
.gantt-tabela tbody tr.e-neutra { background: #fffdf5; }
.g-barra.e-neutra {
  background: repeating-linear-gradient(45deg, #fcd34d, #fcd34d 5px, #fde9b0 5px, #fde9b0 10px);
  box-shadow: inset 0 0 0 1px #f59e0b;
}
.g-barra.e-neutra.atrasado {
  background: repeating-linear-gradient(45deg, #fca5a5, #fca5a5 5px, #fee2e2 5px, #fee2e2 10px);
  box-shadow: inset 0 0 0 1px #dc2626;
}
.eap-alerta { color: #d97706; font-size: 13px; }

/* ---- Coluna Conclusão: valor centralizado com o símbolo de porcentagem ao lado ---- */
.gantt-tabela th.c-pct, .gantt-tabela td.c-pct { text-align: center; }
.pct-cel { display: flex; align-items: center; justify-content: center; gap: 1px; min-width: 0; }
.pct-cel .ed { flex: 0 1 46px; width: 46px; text-align: right; padding-right: 2px; }
.pct-sinal { flex: 0 0 auto; color: var(--muted, #64748b); font-size: 12px; }
.gantt-tabela td.c-pct .calc { display: block; text-align: center; }
/* o campo de duração também fica centrado, para a coluna não ficar torta */
.gantt-tabela th.c-dur, .gantt-tabela td.c-dur { text-align: center; }
.gantt-tabela td.c-dur .ed { text-align: center; }

/* ---- Predecessoras: digitar direto ou escolher pelo seletor ---- */
.pred-cel { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pred-cel .ed { flex: 1 1 auto; width: auto; min-width: 0; }
.pred-abrir {
  flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
  color: var(--muted, #94a3b8); padding: 0 3px; border-radius: 4px; line-height: 1;
}
.pred-abrir:hover { background: var(--linha, #e2e8f0); color: #0f172a; }
.pd-lista { max-height: 220px; overflow: auto; border: 1px solid var(--linha, #e2e8f0); border-radius: 8px; margin: 8px 0; }
.pd-item { display: flex; align-items: center; gap: 8px; padding: 5px 9px; font-size: 13px; cursor: pointer; }
.pd-item:hover { background: var(--fundo-2, #f1f5f9); }
.pd-eap { color: var(--muted, #64748b); min-width: 46px; font-variant-numeric: tabular-nums; }
.pd-nome { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-tipo { flex: 0 0 70px; }
.pd-lag { flex: 0 0 70px; }

/* o botão de escolher predecessora precisa se ver: borda e fundo próprios */
.pred-abrir {
  border: 1px solid var(--linha, #cbd5e1); background: var(--card, #fff);
  border-radius: 5px; padding: 1px 4px; font-size: 12px; color: var(--muted, #64748b);
}
.pred-abrir:hover { border-color: #2563eb; background: #eff6ff; }
/* item 0 — o totalizador do empreendimento */
.cr-raiz { font-weight: 700; color: #0f172a; letter-spacing: .01em; }
.gantt-tabela tbody tr:has(.cr-raiz) { background: var(--fundo-2, #f1f5f9); }

/* Primeiro acesso à obra: explica por que começar pelas tipologias */
.primeiro-acesso {
  border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 12px;
  padding: 16px 18px; margin: 4px 0 16px;
}
.primeiro-acesso strong { display: block; font-size: 15px; color: #1e3a5f; margin-bottom: 6px; }
.primeiro-acesso p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; }
.primeiro-acesso .pa-acoes { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Calha de numeração da linha (estilo MS Project): corrida, discreta, só leitura */
.gantt-tabela th.c-seq, .gantt-tabela td.c-seq {
  text-align: right; padding-right: 8px; color: var(--muted, #94a3b8);
  font-variant-numeric: tabular-nums; font-size: 12px;
  background: var(--fundo-2, #f8fafc); border-right: 1px solid var(--linha, #e2e8f0);
}
.gantt-tabela tbody tr:hover td.c-seq { background: var(--linha-fraca, #f1f5f9); }
.aviso-cartorio { margin: -4px 0 12px; font-size: 12.5px; }

/* Linha escolhida na tabela: é a tarefa que o botão "Rolar até a tarefa" procura. */
.gantt-tabela tbody tr.selecionada > td { background: #e8f0fb; }
.gantt-tabela tbody tr.selecionada > td:first-child { box-shadow: inset 3px 0 0 var(--primary, #1e3a5f); }

/* ===== Linha de balanço ===== */
.lb-ajuda { max-width: 900px; line-height: 1.45; margin: 4px 0 10px; }
.lb-legenda { columns: 3 260px; column-gap: 18px; margin: 14px 0 4px; }
.lb-leg { display: flex; align-items: baseline; gap: 7px; width: 100%; text-align: left; border: 0; background: none;
  padding: 3px 2px; font-size: 12.5px; cursor: pointer; color: #16233b; break-inside: avoid; line-height: 1.35; }
.lb-leg:hover { background: #f1f5f9; border-radius: 6px; }
.lb-leg b { min-width: 26px; text-align: right; color: #64748b; font-weight: 700; flex: none; }
.lb-leg i { width: 11px; height: 11px; border-radius: 3px; flex: none; align-self: center; }
.lb-leg.off { opacity: .4; text-decoration: line-through; }
.lb-ritmo { color: #64748b; font-size: 12px; }
.lb-quadro { overflow: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 8px 4px;
  max-height: calc(100vh - 330px); min-height: 320px; }
.lb-svg { display: block; }
.lb-faixa { fill: #fff; }
.lb-faixa.par { fill: #f8fafc; }
.lb-mes { stroke: #e2e8f0; stroke-width: 1; }
.lb-rot-pav { font-size: 13px; fill: #334155; text-anchor: end; font-weight: 600; }
.lb-rot-mes { font-size: 11px; fill: #64748b; text-anchor: end; }
.lb-rot-serie { font-size: 11.5px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
@media print {
  .menu-nav, #obra-menu, .topbar, .crumb, .crono-acoes, .lb-legenda button.off { display: none !important; }
  .lb-quadro { border: 0; overflow: visible; }
}

/* Exportar: cada opção com a sua explicação, para não escolher errado. */
.ie-opcao { margin: 10px 0; }
.ie-opcao p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.4; }



/* ===== Grupo da linha de balanço: dois painéis com arrastar ===== */
.lbg-box { max-width: 980px; }
.lbg-ajuda { margin: 10px 0 6px; font-size: 13px; }
.lbg-painéis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lbg-painel { display: flex; flex-direction: column; min-width: 0; }
.lbg-cab { display: flex; align-items: baseline; gap: 6px; font-size: 13px; margin-bottom: 6px; color: #16233b; }
.lbg-cab span { color: #64748b; font-size: 12px; }
#lbg-busca { width: 100%; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.lbg-lista { height: 42vh; min-height: 220px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 6px; background: #f8fafc; display: flex; flex-direction: column; gap: 5px; }
.lbg-lista.sobre { border-color: var(--primary, #1e3a5f); background: #eef4fb; box-shadow: inset 0 0 0 1px var(--primary, #1e3a5f); }
.lbg-alvo { background: #fff; }
.lbg-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 9px; cursor: grab; }
.lbg-item:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(15,32,56,.07); }
.lbg-item.arrastando { opacity: .45; }
.lbg-pega { color: #94a3b8; font-size: 13px; line-height: 1; }
.lbg-nome { font-size: 13.5px; color: #16233b; }
.lbg-item i { grid-column: 2; font-style: normal; font-size: 11.5px; color: #64748b; }
.lbg-vazio { margin: auto; text-align: center; font-size: 13px; padding: 12px; }
@media (max-width: 720px) { .lbg-painéis { grid-template-columns: 1fr; } .lbg-lista { height: 30vh; } }

/* Eixo dos pavimentos fixo, gráfico rolando ao lado */
.lb-quadro { display: flex; align-items: flex-start; }
.lb-eixo { flex: 0 0 150px; }
.lb-rolar { flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; }

/* ===== Master Plan ===== */
.mp-quadro { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: auto;
  max-height: calc(100vh - 260px); }
.mp-cab { display: flex; position: sticky; top: 0; z-index: 2; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
/* a faixa do cabeçalho precisa ser linha, senão cada mês vira um bloco e empilha */
.mp-cab .mp-faixa { display: flex; height: auto; }
.mp-cab .mp-mes { width: 62px; flex: none; text-align: center; font-size: 11px; color: #64748b; padding: 7px 0; border-left: 1px solid #eef2f7; }
.mp-linha { display: flex; align-items: center; border-bottom: 1px solid #f1f5f9; }
.mp-linha:last-child { border-bottom: 0; }
.mp-nome { flex: 0 0 300px; position: sticky; left: 0; background: #fff; z-index: 1; padding: 8px 12px;
  font-size: 13px; color: #16233b; border-right: 1px solid #e2e8f0; }
.mp-cab .mp-nome { background: #f8fafc; }
.mp-nome b { color: #64748b; margin-right: 6px; }
.mp-faixa { position: relative; height: 34px; flex: none; }
.mp-barra { position: absolute; top: 6px; height: 22px; border-radius: 6px; display: flex; align-items: center;
  padding: 0 8px; overflow: hidden; }
.mp-barra span { color: #fff; font-size: 11px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
/* matriz pacote x mês */
.mp-matriz { border-collapse: collapse; }
.mp-matriz th, .mp-matriz td { border: 1px solid #eef2f7; }
.mp-matriz thead th { background: #f8fafc; font-size: 11px; color: #64748b; font-weight: 600; height: 66px; padding: 0 2px; }
.mp-matriz thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); }
.mp-matriz td { width: 26px; height: 26px; }
.mp-th-nome { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; font-weight: 500;
  font-size: 12.5px; padding: 5px 10px; min-width: 280px; }
.mp-matriz thead .mp-th-nome { background: #f8fafc; }
.mp-th-nome b { color: #64748b; margin-right: 6px; }
.mp-on { border-radius: 3px; }
@media print { .crono-acoes, #obra-menu, .topbar, .crumb { display: none !important; } .mp-quadro { max-height: none; border: 0; } }

/* ===== Impressão: cabeçalho e rodapé padrão da suíte ===== */
.print-cab, .print-rod { display: none; }
.folhas { display: none; }   /* as folhas montadas para o papel não aparecem na tela */
@media print {
  .print-cab { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #1e3a5f;
    padding-bottom: 10px; margin-bottom: 12px; }
  .print-cab img { max-height: 46px; max-width: 150px; object-fit: contain; flex: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-cab .pc-tit { flex: 1; text-align: center; }
  .print-cab .pc-tit b { font-size: 16px; }
  .print-cab .pc-tit div { font-size: 12px; color: #475569; }
  .print-rod { display: flex; align-items: center; justify-content: space-between; gap: 14px;
    margin-top: 14px; padding-top: 8px; border-top: 1px solid #999; }
  .print-rod img { max-height: 38px; max-width: 150px; object-fit: contain; flex: none; }
  .print-rod .pr-data { flex: 1; text-align: center; font-size: 12px; color: #475569; }

  /* Tudo que e tela some: no papel vao so as folhas montadas pelo JS, cada uma com
     o cabecalho e o rodape padrao da suite. */
  body.imprimindo > *:not(.folhas) { display: none !important; }
  .folhas { display: block; }
  .folha { display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden;
    background: #fff; break-after: page; page-break-after: always; }
  .folha:last-of-type { break-after: auto; page-break-after: auto; }
  .folha .print-cab { flex: none; height: 78px; margin: 0 0 10px; padding-bottom: 8px; box-sizing: border-box; }
  .folha .print-rod { flex: none; height: 54px; margin: 10px 0 0; padding-top: 8px; box-sizing: border-box; }
  .folha-corpo { position: relative; overflow: hidden; flex: none; }
  .folha .lb-legenda { columns: 2 300px; }
  .folha .lb-leg { display: flex !important; }
  /* desenho e didatico: as cores tem de sair no papel */
  .folha, .folha * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Tela cheia do gráfico (mesmo botão do Gantt da Gestão de Tarefas) */
.em-tela-cheia { position: fixed; inset: 0; z-index: 3000; background: #fff; overflow: auto; padding: 16px 22px; }
.em-tela-cheia .lb-quadro, .em-tela-cheia .mp-quadro { max-height: calc(100vh - 210px); }
:fullscreen .lb-quadro, :fullscreen .mp-quadro { max-height: calc(100vh - 210px); }

/* ===== Quadro de amarrações ===== */
.rede-ov .rede-box { max-width: none; width: 96vw; height: 92vh; display: flex; flex-direction: column; padding: 0; }
.rede-topo { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #e2e8f0; }
.rede-topo h3 { margin: 0; }
.rede-dica { font-size: 12.5px; }
.rede-abas { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid #e2e8f0; overflow-x: auto; }
.rede-aba { border: 0; background: none; padding: 8px 14px; font-size: 13px; color: #64748b; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.rede-aba.ativa { color: var(--primary, #1e3a5f); border-bottom-color: var(--primary, #1e3a5f); font-weight: 700; }
.rede-tela { position: relative; flex: 1 1 auto; overflow: auto; background:
  radial-gradient(circle, #e2e8f0 1px, transparent 1px) 0 0 / 22px 22px, #fbfcfe; }
.rede-svg { position: absolute; inset: 0; }
.rede-caixa { position: absolute; background: #fff; border: 1px solid #cbd5e1; border-left: 5px solid var(--primary, #1e3a5f);
  border-radius: 8px; box-shadow: 0 2px 8px rgba(15,32,56,.10); padding: 6px 10px; cursor: grab;
  display: flex; flex-direction: column; justify-content: center; user-select: none; }
.rede-caixa:hover { box-shadow: 0 6px 18px rgba(15,32,56,.16); }
.rede-nome { font-size: 12.5px; color: #16233b; line-height: 1.25; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rede-dur { font-size: 11px; color: #64748b; }
.rede-pino { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 2px solid #94a3b8; }
.rede-pino-dir { right: -7px; cursor: crosshair; }
.rede-pino-dir:hover { border-color: var(--primary, #1e3a5f); background: var(--primary, #1e3a5f); }
.rede-pino-esq { left: -7px; }
.rede-lig-linha { stroke: #94a3b8; stroke-width: 2; }
.rede-lig-toque { stroke: transparent; stroke-width: 14; cursor: pointer; }
.rede-lig:hover .rede-lig-linha { stroke: var(--primary, #1e3a5f); stroke-width: 3; }
.rede-lig-rot { font-size: 11px; fill: #475569; text-anchor: middle; paint-order: stroke; stroke: #fbfcfe; stroke-width: 3px; }
.rede-fantasma { stroke: var(--primary, #1e3a5f); stroke-width: 2; stroke-dasharray: 5 4; }
.rede-vazio { padding: 30px; }

/* Serviço trazido de outro pacote: borda tracejada, para não confundir com os da aba */
.rede-caixa.de-fora { border-style: dashed; border-left-style: solid; border-left-color: #94a3b8; background: #f8fafc; }
.rede-caixa.de-fora .rede-dur { color: #94a3b8; }
.rede-buscar { width: 250px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; }

/* Cartão do diagrama de rede: nome, datas e duração; crítica em vermelho */
.rede-datas { font-size: 10.5px; color: #475569; white-space: nowrap; }
.rede-caixa.critica { border-color: #e11d48; border-left-color: #e11d48; }
.rede-caixa.critica .rede-dur { color: #be123c; font-weight: 700; }
.rede-caixa .rede-nome { -webkit-line-clamp: 2; }

/* ===== Diagrama de rede: cartões coloridos e legenda dos tipos ===== */
.rede-legenda { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; font-size: 12px; color: #475569; }
.rede-legenda b { color: var(--primary, #1e3a5f); letter-spacing: .02em; }
.rede-leg { display: inline-flex; align-items: center; gap: 6px; }
.rede-caixa { border-width: 2px; border-left-width: 2px; padding-left: 30px; border-radius: 10px; }
.rede-num { position: absolute; left: 7px; top: 7px; width: 17px; height: 17px; border-radius: 5px;
  color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-content: center; }
.rede-caixa.critica { box-shadow: 0 0 0 2px rgba(225,29,72,.18), 0 2px 8px rgba(15,32,56,.10); }
.rede-lig-linha { stroke-width: 2.4; }

/* Quadro como tela (não modal) */
.rede-tela-pagina { height: calc(100vh - 330px); min-height: 380px; border: 1px solid #e2e8f0; border-radius: 0 0 12px 12px; }
.rede-dica { margin: 6px 0 10px; font-size: 12.5px; }

/* ===== Reprogramação: versões ===== */
.ver-ajuda { max-width: 900px; line-height: 1.45; margin: 4px 0 14px; }
.ver-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ver-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 12px 14px; }
.ver-card.base { border-color: #1e3a5f; }
.ver-card.producao { box-shadow: 0 0 0 2px rgba(22,163,74,.25); }
.ver-topo { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.ver-selo { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.selo-base { background: #1e3a5f; color: #fff; }
.selo-repro { background: #eef2f7; color: #475569; }
.selo-prod { background: #16a34a; color: #fff; }
.ver-card h4 { margin: 2px 0 4px; font-size: 15px; }
.ver-meta { font-size: 12px; color: #64748b; }
.ver-obs { font-size: 12.5px; color: #475569; margin-top: 6px; font-style: italic; }
.ver-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ver-tabela { max-height: 55vh; overflow: auto; }
.ver-tabela table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ver-tabela th, .ver-tabela td { border-bottom: 1px solid #eef2f7; padding: 6px 8px; text-align: left; }
.ver-tabela thead th { position: sticky; top: 0; background: #f8fafc; }
.ver-atraso { color: #c0392b; font-weight: 700; }
.ver-adianta { color: #16a34a; font-weight: 700; }

/* Cronograma de suprimentos */
.sup-resumo { margin: 4px 0 12px; }
.sup-tabela { overflow: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; max-height: calc(100vh - 300px); }
.sup-tabela table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sup-tabela th, .sup-tabela td { border-bottom: 1px solid #f1f5f9; padding: 8px 12px; text-align: left; }
.sup-tabela thead th { position: sticky; top: 0; background: #f8fafc; color: #475569; font-size: 12px; }
.sup-vencido td { background: #fff1f2; }
.sup-vencido td:first-child b { color: #c0392b; }

/* Diagrama: contador do que está na tela */
.rede-conta { margin-left: auto; color: #64748b; font-size: 12px; }

/* Escolha da tipologia antes de abrir a linha de balanço */
.lb-pergunta { font-size: 14px; margin: 6px 0 14px; }
.lb-escolha { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-width: 900px; }
.lb-opcao { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  border: 1px solid #e2e8f0; border-left: 5px solid var(--primary, #1e3a5f); border-radius: 12px;
  background: #fff; padding: 14px 16px; cursor: pointer; }
.lb-opcao:hover { box-shadow: 0 6px 18px rgba(15,32,56,.12); border-color: #cbd5e1; }
.lb-opcao b { font-size: 15px; color: #16233b; }
.lb-opcao span { font-size: 12.5px; color: #64748b; }
.lb-opcao.vazia { border-left-color: #cbd5e1; opacity: .7; }

/* ===== Campos dos modais (label em cima, campo largo embaixo) =====
   Sem isso o <span> e o <input> ficam lado a lado e o formulário sai tumultuado. */
.modal-box .cf-campo { display: block; margin-bottom: 15px; }
.modal-box .cf-campo > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; }
.modal-box .cf-campo > input, .modal-box .cf-campo > select, .modal-box .cf-campo > textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  outline: none; font: inherit; background: var(--surface); color: var(--text); box-sizing: border-box;
}
.modal-box .cf-campo > input:focus, .modal-box .cf-campo > select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.15);
}
.modal-box .cf-linha { display: flex; gap: 14px; }
.modal-box .cf-linha > .cf-campo { flex: 1; }
.modal-box .modal-sub { margin: -6px 0 16px; font-size: 13.5px; line-height: 1.45; color: var(--muted);
  background: #f8fafc; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 9px 12px; }
.modal-box.modal-md { max-width: 560px; }

/* ===== Master plan: Gantt do cronograma ===== */
.mp-resumo .mp-nome { font-weight: 700; color: var(--primary); }
.mp-barra-res { height: 14px !important; top: 10px !important; border-radius: 3px; opacity: .95; }
.mp-esconder { border: 0; background: none; color: #cbd5e1; cursor: pointer; font-size: 12px; line-height: 1;
  padding: 2px 4px; margin-left: 6px; visibility: hidden; }
.mp-linha:hover .mp-esconder { visibility: visible; }
.mp-esconder:hover { color: var(--erro, #c0392b); }
.mp-nome { display: flex; align-items: center; gap: 2px; }
.mp-nome > span, .mp-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* lista de "quais tarefas aparecem" */
.mpo-box .mpo-acoes { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.mpo-box .mpo-acoes input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.mpo-lista { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.mpo-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-size: 13.5px; cursor: pointer; border-radius: 6px; }
.mpo-item:hover { background: #f8fafc; }
.mpo-item input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.mpo-pai { font-weight: 700; color: var(--primary); }

/* ===== Reprogramar: quadro de blocos (pavimento × tempo) ===== */
.qr-dica { margin: -4px 0 10px; }
.qr-quadro { display: flex; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden;
  max-height: calc(100vh - 250px); }
.qr-eixo { flex: 0 0 150px; border-right: 1px solid #e2e8f0; background: #f8fafc; overflow: hidden; }
.qr-eixo-cab { height: 26px; border-bottom: 1px solid #e2e8f0; }
.qr-pav { display: flex; align-items: center; padding: 0 10px; font-size: 12.5px; color: #334155;
  border-bottom: 1px solid #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-rolar { flex: 1; overflow: auto; }
.qr-tela { position: relative; }
.qr-cab { position: sticky; top: 0; height: 26px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; z-index: 2; }
.qr-mes { position: absolute; top: 0; font-size: 11px; color: #64748b; padding: 6px 0 0 4px; white-space: nowrap; }
.qr-guia { position: absolute; top: 26px; bottom: 0; width: 1px; background: #eef2f7; }
.qr-corpo { position: relative; }
.qr-bloco { position: absolute; border-radius: 5px; color: #fff; display: flex; align-items: center;
  padding: 0 6px; font-size: 11px; cursor: grab; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.2); user-select: none; }
.qr-bloco span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.qr-bloco:hover { filter: brightness(1.08); }
.qr-movendo { cursor: grabbing; opacity: .85; outline: 2px solid #0f172a; z-index: 5; }
.qr-pega { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize;
  background: rgba(255,255,255,.35); border-radius: 0 5px 5px 0; }
.qr-balao { position: absolute; background: #0f172a; color: #fff; font-size: 11px; padding: 2px 7px;
  border-radius: 5px; white-space: nowrap; z-index: 6; pointer-events: none; }
.em-tela-cheia .qr-quadro, :fullscreen .qr-quadro { max-height: calc(100vh - 190px); }

/* ===== Suprimentos: Gantt da compra + do serviço ===== */
.sup-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.sup-filtros input[type="text"], .sup-filtros #sup-q { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; min-width: 220px; }
.sup-filtros input[type="date"] { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.sup-filtros label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sup-legenda { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: #475569; margin-bottom: 8px; }
.sup-legenda span { display: flex; align-items: center; gap: 6px; }
.sup-cor { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
.sup-cor-compra { background: repeating-linear-gradient(45deg, #b45309, #b45309 4px, #f59e0b 4px, #f59e0b 8px); }
.sup-cor-servico { background: #1e3a5f; }
.sup-cor-vencido { background: repeating-linear-gradient(45deg, #991b1b, #991b1b 4px, #ef4444 4px, #ef4444 8px); }
.sup-conta { margin-left: auto; color: #64748b; }
.sup-quadro { max-height: calc(100vh - 330px); }
.sup-eixo { flex: 0 0 300px; }
.sup-barra { position: absolute; height: 18px; border-radius: 4px; display: flex; align-items: center;
  padding: 0 5px; font-size: 10.5px; color: #fff; overflow: hidden; }
.sup-barra span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.sup-compra { height: 12px; background: repeating-linear-gradient(45deg, #b45309, #b45309 4px, #f59e0b 4px, #f59e0b 8px); }
.sup-compra.venceu { background: repeating-linear-gradient(45deg, #991b1b, #991b1b 4px, #ef4444 4px, #ef4444 8px); }
.sup-servico { background: #1e3a5f; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sup-hoje { position: absolute; top: 0; bottom: 0; width: 2px; background: #16a34a; z-index: 3; }
.sup-hoje span { position: absolute; top: -1px; left: 3px; font-size: 10px; color: #16a34a; background: #fff; padding: 0 3px; }
.lbg-btn { margin-left: auto; border: 1px solid var(--border); background: #fff; color: var(--primary);
  width: 26px; height: 26px; border-radius: 7px; font-size: 16px; line-height: 1; cursor: pointer; flex: none; }
.lbg-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
/* campo de digitação vira texto na folha, com a mesma cor e alinhamento da tela */
.imp-campo { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-campo.ed { border: 0; background: none; padding: 0; font: inherit; color: inherit; }

/* ===== Biblioteca da obra ===== */
.bib-trilha { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 13.5px; }
.bib-trilha span { color: var(--muted); }
.bib-crumb { border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.bib-crumb:hover { background: #eef2f7; }
.bib-lista { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; min-height: 160px; }
.bib-lista.bib-sobre { outline: 2px dashed var(--primary); outline-offset: -6px; background: #f8fafc; }
.bib-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.bib-item:last-child { border-bottom: 0; }
.bib-item:hover { background: #f8fafc; }
.bib-ico { font-size: 18px; flex: none; }
.bib-nome { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-pasta .bib-nome, .bib-pasta .bib-ico { cursor: pointer; font-weight: 600; color: var(--primary); }
.bib-pasta .bib-nome:hover { text-decoration: underline; }
.bib-meta { color: var(--muted); font-size: 12.5px; flex: none; min-width: 70px; text-align: right; }
.bib-acoes { display: flex; gap: 6px; flex: none; visibility: hidden; }
.bib-item:hover .bib-acoes { visibility: visible; }
.bib-vazio { padding: 40px 16px; text-align: center; }
.mp-data { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.mp-data input { padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.mp-corpo { position: relative; }
.mp-hoje { position: absolute; top: 0; width: 2px; background: #16a34a; z-index: 3; margin-left: 300px; }
.mp-hoje span { position: absolute; top: 0; left: 3px; font-size: 10px; color: #16a34a; background: #fff; padding: 0 3px; border-radius: 3px; }
.crono-acoes .btn.ativo { border-color: var(--primary); color: var(--primary); }

/* Exportar: dois botões grandes, sem texto no meio */
.exp-botoes { display: flex; gap: 14px; margin: 6px 0 4px; }
.exp-grande { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 12px; border: 2px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--primary); }
.exp-grande span { font-size: 34px; line-height: 1; }
.exp-grande:hover { border-color: var(--primary); background: #f8fafc; }
.mp-recolher { border: 0; background: none; color: #64748b; cursor: pointer; font-size: 11px; line-height: 1;
  width: 16px; padding: 0; flex: none; }
.mp-recolher:hover { color: var(--primary); }
.mp-sem-seta { width: 16px; flex: none; display: inline-block; }
/* cronograma sem as barras: a lista de tarefas ocupa a tela toda */
.gantt-so-tabela .gantt-tabela-wrap { flex: 1 1 auto !important; max-width: none !important; }
/* faixa do pavimento: o nome fica no topo da faixa, não no meio das pistas */
.qr-pav { align-items: flex-start; padding-top: 6px; border-bottom: 1px solid #e2e8f0; }
.qr-corpo .qr-bloco { font-size: 10.5px; }

/* Caixas de diálogo da casa (no lugar do alert/confirm/prompt do navegador) */
.dlg-box h3 { margin-bottom: 12px; }
.dlg-texto { margin: 0 0 4px; font-size: 14px; line-height: 1.5; color: var(--text); }
.btn-perigo { background: var(--erro, #c0392b); color: #fff; border: 1px solid var(--erro, #c0392b); }
.btn-perigo:hover { filter: brightness(1.08); }

/* Planejamento trancado */
.trava-faixa { display: flex; align-items: center; gap: 8px; background: #fef3c7; border: 1px solid #fcd34d;
  border-left: 4px solid #b45309; color: #7c2d12; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.trava-faixa b { color: #7c2d12; }
.modal-box .cf-campo > textarea { min-height: 90px; resize: vertical; }
.qr-feitos { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 14px; font-size: 13px; }
.qr-feitos > b { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.qr-link { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--text); }
.qr-link:hover { background: #f8fafc; }
.qr-link span { flex: 1; }
.qr-link i { font-style: normal; font-size: 11.5px; color: var(--muted); background: #f1f5f9; padding: 2px 7px; border-radius: 999px; }
.qr-link b { color: var(--primary); font-size: 12.5px; }
/* botão só de ícone: quadrado, sem o texto empurrando a barra */
.btn-ico { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 33px; padding: 0; align-self: center; }
.btn-ico.ativo { border-color: var(--primary); color: var(--primary); background: #eef2f7; }

/* Janela grande (QR dos pavimentos e afins) */
.modal-box.modal-grande { max-width: 900px; width: 92vw; max-height: 92vh; }
.qr-tps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.qr-tp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; font-size: 13.5px; }
.qr-tp:hover { background: #f8fafc; }
.qr-tp input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.qr-tp b { flex: 1; color: var(--text); }
.qr-tp i { font-style: normal; font-size: 12px; color: var(--muted); }

/* ===== Barra de filtros modernizada =====
   Campo alto, canto arredondado, foco visível, e as caixas de marcação viram
   "pastilhas" que acendem quando estão ligadas — dá para ler o filtro de longe. */
.crono-filtros, .sup-filtros {
  gap: 10px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #e6ecf3; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.crono-filtros input[type="text"], .crono-filtros input:not([type]),
.crono-filtros input[type="date"], .crono-filtros select,
.sup-filtros input, .sup-filtros select {
  height: 40px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font: inherit; font-size: 13.5px; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.crono-filtros select, .sup-filtros select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
  -webkit-appearance: none; appearance: none;
}
/* a busca ganha a lupa dentro do campo */
#cf-texto, #sup-q {
  min-width: 240px; padding-left: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>");
  background-repeat: no-repeat; background-position: 12px center; background-size: 17px;
}
.crono-filtros input:hover, .crono-filtros select:hover,
.sup-filtros input:hover, .sup-filtros select:hover { border-color: #cbd5e1; }
.crono-filtros input:focus, .crono-filtros select:focus,
.sup-filtros input:focus, .sup-filtros select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 58, 95, .12);
}
/* De / Até viram um par colado, com o rótulo por cima do campo */
.crono-filtros .cf-data, .sup-filtros label:has(input[type="date"]) {
  flex-direction: column; align-items: flex-start; gap: 3px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; color: #94a3b8;
}
/* caixas de marcação como pastilha */
.crono-filtros .cf-chk, .sup-filtros .crono-check {
  height: 40px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 999px;
  background: #fff; cursor: pointer; user-select: none; color: #475569;
  transition: border-color .15s, background .15s, color .15s;
}
.crono-filtros .cf-chk:hover, .sup-filtros .crono-check:hover { border-color: #cbd5e1; background: #f8fafc; }
.crono-filtros .cf-chk:has(input:checked), .sup-filtros .crono-check:has(input:checked) {
  border-color: var(--primary); background: #eef3f9; color: var(--primary); font-weight: 600;
}
.crono-filtros .cf-chk input, .sup-filtros .crono-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
#cf-limpar, #sup-limpar { height: 40px; border-radius: 10px; color: #64748b; }
#cf-limpar:hover, #sup-limpar:hover { color: var(--erro, #c0392b); }
/* selo de versão: sai de perto dos botões e vira uma marca discreta no pé do menu */
.menu-versao { padding: 10px 16px 14px; font-size: 11px; color: #b6c2d1; letter-spacing: .03em; }
/* Biblioteca: marcação múltipla */
.bib-sel { width: 17px; height: 17px; accent-color: var(--primary); flex: none; cursor: pointer; }
.bib-selbarra { display: flex; align-items: center; gap: 14px; padding: 10px 14px; margin-bottom: 8px;
  background: #eef3f9; border: 1px solid #cfe0f0; border-radius: 12px; font-size: 13.5px; }
.bib-selbarra .bib-todos { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--primary); font-weight: 600; }
.bib-selbarra .bib-todos input { width: 16px; height: 16px; accent-color: var(--primary); }
.bib-selbarra #bib-sel-conta { flex: 1; color: #475569; }
.btn-perigo.btn-sm { background: var(--erro, #c0392b); color: #fff; border-color: var(--erro, #c0392b); }
/* dia da semana ao lado do campo de data (o campo do navegador não mostra sozinho) */
.ed-semana { margin-left: 6px; font-size: 11.5px; color: #94a3b8; white-space: nowrap; }

/* Cronograma em tela cheia: a lista ocupa tudo, com a barra de comandos por cima */
.em-tela-cheia .gantt-tabela-wrap { max-height: calc(100vh - 250px) !important; }
.em-tela-cheia .crono-legenda { margin-bottom: 6px; }

/* ===== Cronograma % (físico por mês) ===== */
.pct-dica { margin: -4px 0 10px; }
.pct-quadro { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: auto; max-height: calc(100vh - 290px); }
.pct-tabela { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
.pct-tabela th, .pct-tabela td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.pct-tabela thead th { position: sticky; top: 0; background: #f8fafc; z-index: 2; font-weight: 600; color: #475569; text-align: center; }
.pct-tabela thead tr:nth-child(2) th { top: 44px; font-size: 11.5px; color: #64748b; }
.pct-mes { border-left: 1px solid #e2e8f0; }
.pct-mes span { display: block; font-weight: 400; font-size: 11px; color: #94a3b8; }
.pct-sub { font-weight: 500; }
.pct-n { width: 44px; text-align: right; color: #94a3b8; position: sticky; left: 0; background: #fff; z-index: 1; }
.pct-nome { min-width: 300px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 44px; background: #fff; z-index: 1; }
.pct-tabela thead .pct-n, .pct-tabela thead .pct-nome { background: #f8fafc; z-index: 3; }
.pct-num { text-align: right; font-variant-numeric: tabular-nums; }
.pct-acum { color: #64748b; background: #fbfdff; }
.pct-zero { color: #cbd5e1; }
.pct-tabela tbody tr:hover td { background: #f8fafc; }
.pct-tabela tbody tr:hover .pct-acum { background: #f1f6fb; }
/* a data e o dia da semana dividem a célula sem espremer um ao outro */
.gantt-tabela td.c-data { white-space: nowrap; }
.gantt-tabela td.c-data input[type="date"] { width: auto; max-width: 118px; }

/* ===== Barra de comandos das telas (mesma linguagem dos filtros) ===== */
.crono-acoes { gap: 8px; align-items: center; }
.crono-acoes select.crono-escala {
  height: 40px; padding: 0 34px 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  font: inherit; font-size: 13.5px; color: var(--text); background-color: #fff; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.crono-acoes select.crono-escala:hover { border-color: #cbd5e1; }
.crono-acoes select.crono-escala:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.12); }
.crono-acoes .btn.btn-sm {
  height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid #e2e8f0;
  font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, background .15s, color .15s;
}
.crono-acoes .btn.btn-ghost.btn-sm { background: #fff; color: #475569; }
.crono-acoes .btn.btn-ghost.btn-sm:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--primary); }
.crono-acoes .btn.btn-sm.ativo {
  border-color: var(--primary); background: #eef3f9; color: var(--primary); font-weight: 600;
}
.crono-acoes .btn.btn-primary.btn-sm { border-color: var(--primary); }
.crono-acoes .btn-ico { width: 42px; padding: 0; justify-content: center; }
/* rótulo dos campos de data na barra (De / Até) */
.crono-acoes .mp-data { flex-direction: column; align-items: flex-start; gap: 3px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; color: #94a3b8; }
.crono-acoes .mp-data input { height: 40px; border-radius: 10px; border: 1.5px solid #e2e8f0; padding: 0 10px; font-size: 13px; }
.crono-acoes .mp-data input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,.12); }
