/* =============================================================================
 * styles.css — Identidade visual do KAIRO
 * -----------------------------------------------------------------------------
 * Tema claro e moderno. Cor primária: violeta-índigo.
 * As cores ficam em "variáveis" (:root) — mude lá para reestilizar tudo.
 * ===========================================================================*/

:root {
  /* Paleta da marca */
  --primary: #5b46e5;
  --primary-dark: #4734c4;
  --primary-soft: #ece9fc;

  /* Neutros */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e7e8ef;
  --text: #1c1e2b;
  --muted: #767a8a;

  /* Status */
  --backlog: #8b90a3;
  --andamento: #2f6df6;
  --concluida: #18a558;
  --atrasada: #e0413e;

  /* Prioridade */
  --pr-baixa: #6b7280;
  --pr-media: #d08700;
  --pr-alta: #e0413e;

  --shadow: 0 1px 3px rgba(20, 22, 40, 0.08), 0 4px 16px rgba(20, 22, 40, 0.05);
  --radius: 14px;
}

* { box-sizing: border-box; }

/* celular: a página não aumenta/diminui com os dedos nem com toque duplo; janelas como o 3D e a planta têm zoom próprio (ver js/sem-zoom.js) */
html { touch-action: pan-x pan-y; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2 { margin: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---- Marca / logo ---------------------------------------------------------*/
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 700;
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.brand-lg .brand-name { font-size: 30px; }
.brand-lg { justify-content: center; }

/* ===========================================================================
   LOGIN
=========================================================================== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #efeafc 0%, var(--bg) 60%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 34px 30px;
  box-shadow: var(--shadow);
}
.login-sub { text-align: center; color: var(--muted); margin: 4px 0 26px; }
.abrindo-card { text-align: center; }
.abrindo-card .brand { justify-content: center; }
.abrindo-spin { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 22px auto 10px; animation: abrindo-gira 0.8s linear infinite; }
@keyframes abrindo-gira { to { transform: rotate(360deg); } }
#abrindo-falha .btn + .btn { margin-top: 8px; }
.login-erro { color: var(--atrasada); min-height: 20px; margin: 8px 0 0; font-size: 13.5px; }
.login-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px; line-height: 1.6; }

/* ===========================================================================
   CAMPOS / BOTÕES
=========================================================================== */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: #444a5e; margin-bottom: 6px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

input, textarea, select, .input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14.5px; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
input:focus, textarea:focus, select:focus, .input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f0f1f6; }
.btn-danger { background: var(--atrasada); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 7px 11px; font-size: 13px; }

.btn-icon {
  background: transparent; border: none; font-size: 15px; padding: 4px 7px;
  border-radius: 7px; color: var(--muted);
}
.btn-icon:hover { background: #f0f1f6; color: var(--text); }
.btn-icon-danger:hover { background: #fdeaea; color: var(--atrasada); }
.btn-icon:disabled { opacity: .3; cursor: not-allowed; }

/* ===========================================================================
   APP / TOPO
=========================================================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; border: none; padding: 8px 14px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.nav-btn:hover { background: #f0f1f6; color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 8px; border-left: 1px solid var(--border); margin-left: 4px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.user-nome { font-size: 13.5px; font-weight: 700; }
.user-papel { font-size: 11.5px; color: var(--muted); }

/* ===========================================================================
   CONTEÚDO
=========================================================================== */
.main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
/* No board, usa a largura cheia (a tabela tem muitas colunas) */
body.board-mode .main { max-width: 1600px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin: 4px 0 22px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card.no-pad { padding: 0; overflow: hidden; }
.card-head { font-weight: 700; font-size: 15px; margin-bottom: 14px; }

/* ---- Toolbar de filtros ---- */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: auto; flex: 1; min-width: 160px; }
.toolbar #filter-status, .toolbar #filter-assignee { flex: 0 0 auto; min-width: 180px; }

/* ===========================================================================
   TABELAS
=========================================================================== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfd;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfd; }
.col-acoes { width: 1%; white-space: nowrap; text-align: right; }
.cell-strong { font-weight: 600; }
.link-title { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); text-align: left; }
.link-title:hover { color: var(--primary); text-decoration: underline; }
.muted-sm { color: var(--muted); font-size: 12.5px; }
.prazo-vencido { color: var(--atrasada); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.tag-voce { font-size: 11px; background: var(--primary-soft); color: var(--primary); padding: 1px 7px; border-radius: 20px; font-weight: 700; margin-left: 4px; }

/* ---- Badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; line-height: 1.6;
}
.st-backlog   { background: #f0f1f4; color: var(--backlog); }
.st-andamento { background: #e7f0ff; color: var(--andamento); }
.st-concluida { background: #e3f6ec; color: var(--concluida); }
.st-atrasada  { background: #fdeaea; color: var(--atrasada); }
.pr-baixa { background: #f0f1f4; color: var(--pr-baixa); }
.pr-media { background: #fdf3e0; color: var(--pr-media); }
.pr-alta  { background: #fdeaea; color: var(--pr-alta); }
.badge-admin  { background: var(--primary-soft); color: var(--primary); }
.badge-membro { background: #f0f1f4; color: var(--muted); }

/* ===========================================================================
   DASHBOARD
=========================================================================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat-valor { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; background: transparent; padding: 0; border-radius: 0; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-total { color: var(--primary); }

.progress-row { display: flex; align-items: center; gap: 14px; }
.progress-bar { flex: 1; height: 12px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s; }
.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Gráfico de barras */
.bars { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-valor { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 8px 8px 0 0; min-height: 4px; transition: height .4s; }
.bar.st-backlog   { background: var(--backlog); }
.bar.st-andamento { background: var(--andamento); }
.bar.st-concluida { background: var(--concluida); }
.bar.st-atrasada  { background: var(--atrasada); }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* Por responsável */
.resp-list { display: flex; flex-direction: column; gap: 14px; }
.resp-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 5px; }
.resp-nome { font-weight: 600; }
.resp-num { color: var(--muted); }
.resp-bar { height: 8px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.resp-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s; }

/* ===========================================================================
   MODAIS
=========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 22, 40, 0.45);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 80; /* acima do painel de detalhes (70) */
}
.modal-overlay.open { display: flex; animation: fade .15s ease; }
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(20, 22, 40, 0.25); max-height: 90vh; overflow: auto;
}
.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; font-weight: 700; }
.modal-x { background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ===========================================================================
   TOASTS
=========================================================================== */
.toast-box { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  padding: 12px 18px; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; transform: translateX(20px); transition: all .3s; max-width: 320px;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { background: var(--concluida); }
.toast-erro { background: var(--atrasada); }
.toast-info { background: var(--text); }

/* ===========================================================================
   ABAS / PÍLULAS / TOGGLE
=========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-num { opacity: .7; font-weight: 700; margin-left: 2px; }

.view-toggle, .toggle-btn { display: inline-flex; }
.view-toggle { background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; }
.toggle-btn { background: transparent; border: none; padding: 6px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.toggle-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ===========================================================================
   PROJETOS
=========================================================================== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .1s; }
.proj-card[data-open-proj]:not([data-open-proj=""]) { cursor: pointer; }
.proj-card:hover { border-color: #d6d8e4; }
.proj-card-top { display: flex; align-items: center; gap: 10px; }
.proj-dot { width: 14px; height: 14px; border-radius: 5px; flex: 0 0 auto; }
.proj-card-titles { min-width: 0; }
.proj-card-title { font-weight: 700; font-size: 15.5px; }
.proj-card-code { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.proj-card-desc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.proj-card-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.proj-card-actions .btn-sm { margin-right: auto; }

/* ===========================================================================
   BOARD (detalhe do projeto)
=========================================================================== */
.board-back { margin-bottom: 14px; }
.board-header { margin-bottom: 18px; }
.board-head-top { display: flex; align-items: center; gap: 10px; }
.board-dot { width: 18px; height: 18px; border-radius: 6px; }
.board-head-top .page-title { font-size: 24px; }
.board-desc-wrap { margin-top: 8px; position: relative; }
.board-desc { border: 1px dashed var(--border); background: #fcfcfe; border-radius: 10px; font-size: 14px; color: var(--text); resize: vertical; }
.board-desc:focus { border-style: solid; }
.save-status { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-toolbar-right { display: flex; gap: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border: 1px solid #d8d3f7; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-count { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.input-sm { width: auto; padding: 6px 10px; font-size: 13px; }

/* ---- Tabela estilo planilha ---- */
.table-sheet td { padding: 5px 8px; }
.table-sheet th { padding: 9px 8px; }
.c-check, .c-grip, .c-done { width: 30px; text-align: center; }
.c-acoes { width: 1%; white-space: nowrap; text-align: right; }
.c-title { min-width: 200px; }
.grip { cursor: grab; color: #c2c5d2; user-select: none; }
.grip:active { cursor: grabbing; }
.cell-input, .cell-select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 13.5px; }
.cell-input:hover, .cell-select:hover { background: #f5f6fa; }
.cell-input:focus, .cell-select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cell-select.badge { font-weight: 700; border: none; -webkit-appearance: none; appearance: none; padding-right: 8px; }
.done-text { text-decoration: line-through; color: var(--muted); }
.row-sel td { background: var(--primary-soft) !important; }
.mini { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; }

/* ===========================================================================
   KANBAN
=========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kb-col { background: #eef0f5; border-radius: 14px; padding: 10px; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kb-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-empty { color: #c2c5d2; text-align: center; padding: 8px; font-size: 13px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; }
.kb-card:active { cursor: grabbing; }
.kb-card-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.kb-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kb-due { font-size: 12px; color: var(--muted); }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; }
.kb-resp { font-size: 12px; color: var(--muted); }

/* ===========================================================================
   DRAWER (painel de detalhe)
=========================================================================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,22,40,.4); display: none; z-index: 60; }
.drawer-overlay.show, .drawer.open ~ .drawer-overlay { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); box-shadow: -8px 0 40px rgba(20,22,40,.18); transform: translateX(100%); transition: transform .22s ease; z-index: 70; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { padding: 22px; overflow: auto; }
#drawer.open + #drawer-overlay, #drawer-overlay.show { display: block; }
.input-color { height: 42px; padding: 4px; cursor: pointer; }
.check-field { flex-direction: row !important; align-items: center; gap: 8px; }
.check-field input { width: auto; }
.check-field span { margin: 0; }

/* ===========================================================================
   STATUS EXTRAS / FLUXO / ETAPAS  (v2)
=========================================================================== */
.st-cancelada{ background: #eceef3; color: #6b7280; }

/* Indicadores de prazo (no prazo / atraso) e desvio em dias */
.no-prazo { color: var(--concluida); font-weight: 700; }
.fora-prazo { color: var(--atrasada); font-weight: 700; }
.desvio { font-size: 10.5px; margin-top: 3px; padding: 0 2px; }
.bar.st-cancelada { background: #9aa1ad; }

/* Linha da ETAPA na tabela: datas resumidas (só leitura) sob as colunas de data */
.stage-main { vertical-align: middle; }
.stage-date { vertical-align: middle; font-size: 12px; font-weight: 600; color: var(--muted); }
.stage-status-cell { vertical-align: middle; }
.stage-actions-cell { vertical-align: middle; text-align: right; }
/* Chips de status (resumo no dashboard da etapa) */
.status-chips { display: flex; flex-wrap: wrap; gap: 14px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status-chip strong { color: var(--text); }

/* Modal grande / seções de formulário */
.modal-lg { max-width: 620px; }
.form-section { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* Painel de dados do projeto */
.board-info { background: #fafbfd; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; font-size: 13.5px; }
.info-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.info-links { display: flex; flex-direction: column; gap: 2px; }
.info-link { color: var(--primary); font-weight: 600; text-decoration: none; }
.info-link:hover { text-decoration: underline; }
.info-brief { grid-column: 1 / -1; }
.info-text { white-space: pre-wrap; font-size: 13px; max-height: 90px; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

/* Tabela com rolagem horizontal (muitas colunas) */
.table-scroll { overflow-x: auto; }
#board-table-wrap .table-sheet { min-width: 1440px; }   /* só a tabela de tarefas (13 colunas); as outras cabem na tela */
.c-status { width: 118px; }
.c-resp { width: 140px; }
.c-prest { width: 160px; }
/* Ações (📝 ⧉ 🗑) e "+ tarefa" da etapa ficam presos na borda direita: sempre à vista, mesmo com a
   tabela rolada de lado (no celular a tabela vira cartões e isso não se aplica) */
@media (min-width: 761px) {
  #board-table-wrap .c-acoes, #board-table-wrap .stage-actions-cell { position: sticky; right: 0; z-index: 2; box-shadow: -8px 0 10px -8px rgba(20,22,40,.18); }
  #board-table-wrap td.c-acoes { background: var(--surface); }
  #board-table-wrap tr.row-sel td.c-acoes { background: var(--primary-soft); }
  #board-table-wrap th.c-acoes { background: #fafbfd; }
  #board-table-wrap .stage-row td.stage-actions-cell { background: #f1f0fb; }
}
/* campo que filtra enquanto digita (autocomplete.js) */
.ac-input { width: 100%; text-overflow: ellipsis; }
.ac-lista { display: none; position: fixed; z-index: 150; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg, 0 10px 30px rgba(20,22,40,.18)); padding: 4px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.ac-grupo { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 3px; }
.ac-item { padding: 8px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; }
.ac-item:hover, .ac-item.on { background: var(--primary-soft); color: var(--primary); }
.ac-limpar { color: var(--muted); border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; margin-top: 4px; }
.ac-vazio { padding: 10px; font-size: 13px; color: var(--muted); }
.c-date { width: 124px; }
.c-dur { width: 80px; white-space: nowrap; color: var(--muted); font-weight: 600; font-size: 13px; }
.dur-input { width: 100%; min-width: 62px; }
.c-flow { width: 136px; }
.c-pct { width: 116px; }
.c-acoes { width: 104px; }

/* Linha de etapa (título de seção dentro da tabela) */
.stage-row td { background: #f1f0fb; padding: 10px 12px; border-top: 2px solid #e2def7; }
.stage-name { font-weight: 800; font-size: 14px; }
.stage-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.stage-actions .btn-icon { font-size: 12.5px; font-weight: 600; }
.stage-empty .empty-sm { text-align: center; color: #b7bac6; font-size: 12.5px; padding: 8px; }

/* Rodapé da etapa: adicionar tarefa direto na tabela */
/* Campo de data: texto com máscara dd/mm/aaaa + botão 📅 (abre o calendário do navegador) */
.date-wrap { position: relative; display: flex; align-items: center; gap: 2px; }
.date-input { flex: 1; min-width: 0; padding: 5px 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.date-pick { flex: 0 0 auto; background: none; border: none; padding: 3px 4px; font-size: 14px; line-height: 1; opacity: .5; border-radius: 6px; }
.date-pick:hover { opacity: 1; background: #f0f1f6; }
.date-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.add-task-row td { padding: 0; }
.add-task-btn { width: 100%; text-align: left; background: transparent; border: none; padding: 8px 14px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 0; }
.add-task-btn:hover { background: var(--primary-soft); color: var(--primary); }

/* Kanban: nome da etapa no cartão e título da coluna */
.kb-col-title { font-weight: 700; font-size: 13.5px; }
.kb-card-stage { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }

/* Dashboard da etapa: linha de total */
.dash-total td { font-weight: 700; background: #fafbfd; border-top: 2px solid var(--border); }

/* ===========================================================================
   ABAS / PÍLULAS / TOGGLE
=========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-num { opacity: .7; font-weight: 700; margin-left: 2px; }

.view-toggle { background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; display: inline-flex; }
.toggle-btn { background: transparent; border: none; padding: 6px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.toggle-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ===========================================================================
   PROJETOS
=========================================================================== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.proj-card[data-open-proj] { cursor: pointer; }
.proj-card:hover { border-color: #d6d8e4; }
.proj-card-top { display: flex; align-items: center; gap: 10px; }
.proj-dot { width: 14px; height: 14px; border-radius: 5px; flex: 0 0 auto; }
.proj-card-titles { min-width: 0; }
.proj-card-title { font-weight: 700; font-size: 15.5px; }
.proj-card-code { font-size: 12px; color: var(--muted); font-weight: 600; }
.proj-card-desc { font-size: 12.5px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.proj-card-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.proj-card-actions { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.proj-card-actions .btn-sm { margin-right: auto; }

/* ===========================================================================
   BOARD
=========================================================================== */
.board-back { margin-bottom: 14px; }
.board-header { margin-bottom: 18px; }
.board-head-top { display: flex; align-items: center; gap: 10px; }
.board-dot { width: 18px; height: 18px; border-radius: 6px; }
.board-head-top .page-title { font-size: 24px; }
.board-desc-wrap { margin-top: 8px; }
.board-desc { border: 1px dashed var(--border); background: #fcfcfe; border-radius: 10px; font-size: 14px; color: var(--text); resize: vertical; }
.board-desc:focus { border-style: solid; }
.save-status { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-toolbar-right { display: flex; gap: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; background: var(--primary-soft); border: 1px solid #d8d3f7; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-count { font-weight: 700; color: var(--primary); font-size: 13.5px; }
.input-sm { width: auto; padding: 6px 10px; font-size: 13px; }

/* Tabela estilo planilha */
.table-sheet td { padding: 5px 8px; }
.table-sheet th { padding: 9px 8px; }
.c-check, .c-grip { width: 30px; text-align: center; }
.c-acoes { white-space: nowrap; text-align: right; }
.c-title { width: 260px; }
.table-sheet th { white-space: nowrap; }
.grip { cursor: grab; color: #c2c5d2; user-select: none; }
.cell-input, .cell-select { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 13.5px; }
.cell-input:hover, .cell-select:hover { background: #f5f6fa; }
.cell-input:focus, .cell-select:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cell-select:disabled { opacity: .45; cursor: not-allowed; }
.row-sel td { background: var(--primary-soft) !important; }
.mini { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; }

/* ===========================================================================
   KANBAN
=========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kb-col { background: #eef0f5; border-radius: 14px; padding: 10px; }
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.kb-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.kb-list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kb-empty { color: #c2c5d2; text-align: center; padding: 8px; font-size: 13px; }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; }
.kb-card-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; }

/* ===========================================================================
   DRAWER
=========================================================================== */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,22,40,.4); display: none; z-index: 60; }
.drawer-overlay.show { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); box-shadow: -8px 0 40px rgba(20,22,40,.18); transform: translateX(100%); transition: transform .22s ease; z-index: 70; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { padding: 22px; overflow: auto; }
.input-color { height: 42px; padding: 4px; cursor: pointer; }

/* ===========================================================================
   PROGRESSO (%) E CHECKLIST  (v3)
=========================================================================== */
/* Barrinha de % na tabela e nos dashboards */
.pctmini { display: flex; align-items: center; gap: 6px; }
.pctmini-bar { flex: 1; min-width: 46px; height: 6px; background: #eef0f5; border-radius: 20px; overflow: hidden; }
.pctmini-bar span { display: block; height: 100%; background: var(--primary); border-radius: 20px; }
.pctmini-num { font-size: 11.5px; color: var(--muted); font-weight: 700; min-width: 32px; text-align: right; }
.c-pct { width: 132px; }

/* (A coluna "Ações" não é mais fixa — a fixação cobria as colunas Entrega/%.) */

/* Checklist no drawer */
.cl-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.cl-list { display: flex; flex-direction: column; gap: 4px; }
.cl-item { display: flex; align-items: center; gap: 8px; }
.cl-item input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.cl-text { flex: 1; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 8px; font-size: 13.5px; }
.cl-text:hover { background: #f5f6fa; }
.cl-text:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cl-done { text-decoration: line-through; color: var(--muted); }
.cl-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cl-add input[type="text"] { flex: 1; min-width: 140px; }
.cl-paste { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* Listas de modelos (etapa) */
.tpl-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; max-height: 320px; overflow: auto; }
.tpl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fafbfd; }
.tpl-row-name { font-weight: 600; flex: 1; }
.tpl-row-actions { display: inline-flex; gap: 4px; }
.field-label-span { display: block; font-size: 13px; font-weight: 600; color: #444a5e; margin: 6px 0; }

/* ===========================================================================
   RESPONSIVO
=========================================================================== */
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .topbar { gap: 12px; }
  .user-meta { display: none; }
  .field-row { flex-direction: column; gap: 0; }
}

/* Kanban: título + etapa numa linha, observação (descrição) no meio, status + fim previsto embaixo */
.kb-card-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; min-width: 0; }
.kb-card-top .kb-card-title { flex: 1 1 auto; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card-top .kb-card-stage { flex: 0 1 auto; max-width: 45%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-obs { display: block; width: 100%; box-sizing: border-box; height: 40px; resize: none; overflow-y: auto; margin: 0 0 8px; padding: 3px 6px; font: inherit; font-size: 12.5px; line-height: 1.35; color: var(--text); background: #f7f8fb; border: 1px solid transparent; border-radius: 6px; cursor: text; }
.kb-obs::placeholder { color: #b3b7c4; }
.kb-obs:not(:focus) { scrollbar-width: none; }
.kb-obs:not(:focus)::-webkit-scrollbar { display: none; }
.kb-obs:hover { border-color: var(--border); }
.kb-obs:focus { outline: none; background: var(--surface); border-color: var(--primary); }
.kb-card-foot { gap: 8px; }
.kb-card-foot .badge { white-space: nowrap; flex: 0 0 auto; }
.kb-card-foot .kb-due { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-foot .kb-det { margin-left: 0; }
.kb-pct { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 1px; font-size: 12.5px; font-weight: 700; color: var(--primary); }
.kb-pct input { width: 34px; padding: 2px 3px; border: 1px solid transparent; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font: inherit; text-align: right; }
.kb-pct input:hover { border-color: var(--border); }
.kb-pct input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.kb-pct-calc { padding: 2px 6px; border-radius: 6px; background: #f1f2f6; color: var(--muted); }
/* ===========================================================================
   CELULAR (até 760px) — topo compacto, tabela em cartões, kanban rolável
   Fica no FIM do arquivo de propósito: sobrescreve as regras de desktop acima.
=========================================================================== */
.kb-select { display: none; }

@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  /* campos com 16px: o iPhone dá zoom automático ao tocar em campos menores */
  input, textarea, select, .input, .cell-input, .cell-select { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 40px; }
  .btn-icon { min-width: 40px; min-height: 40px; font-size: 17px; }

  .main { padding: 14px 12px 48px; }
  .page-title { font-size: 22px; }
  .page-sub { margin: 4px 0 14px; }
  .page-head-row { flex-wrap: wrap; gap: 10px; }
  #dash-projeto { max-width: none !important; width: 100%; }
  .card { padding: 14px; }
  .card.no-pad { overflow-x: auto; }
  .card.no-pad .table { min-width: 560px; }   /* tabelas dos dashboards rolam de lado em vez de serem cortadas */
  .stat-valor { font-size: 26px; }
  .login-card { padding: 26px 20px; }
  .brand-lg .brand-name { font-size: 24px; white-space: nowrap; }
  .brand-lg .brand-mark { width: 38px; height: 38px; font-size: 19px; flex: 0 0 auto; }

  /* ---- Topo: marca + (Instalar) + Sair na 1ª linha; abas ocupando a largura na 2ª ---- */
  .topbar { padding: 8px 12px; gap: 6px 8px; }
  .brand-name { font-size: 17px; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .topbar-right { margin-left: auto; gap: 6px; }
  .user-chip { border-left: none; padding-left: 0; margin-left: 0; }
  .nav { order: 3; width: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav-btn { flex: 1 0 auto; text-align: center; padding: 9px 4px; font-size: 13px; }

  /* ---- Cabeçalho e barra de ferramentas do projeto ---- */
  .board-head-top { flex-wrap: wrap; row-gap: 8px; }
  .board-head-top .page-title { font-size: 20px; flex: 1 1 55%; min-width: 0; overflow-wrap: anywhere; }
  #board-share { width: 100%; }
  /* nowrap: com wrap, cada linha da coluna fica da largura do item mais largo (as abas) e a página inteira alarga */
  .board-toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  /* as 6 abas não cabem em 375px: rolam de lado dentro da própria barra */
  /* translateZ: a faixa vira uma camada própria — sem isso o Safari do iPhone deixava "restos" do
     fundo branco da aba ativa fora do lugar ao trocar de aba (2026-10-04). Sem sombra no celular pelo mesmo motivo. */
  .view-toggle { display: flex; overflow-x: auto; scrollbar-width: none; -webkit-transform: translateZ(0); transform: translateZ(0); }
  .view-toggle::-webkit-scrollbar { display: none; }
  .toggle-btn { flex: 1 0 auto; justify-content: center; padding: 9px 10px; white-space: nowrap; }
  .toggle-btn.active { box-shadow: none; outline: 1px solid var(--border); outline-offset: -1px; }
  /* Tabela/Kanban/Cronograma: Modelos · Colar · Importar numa linha, "+ Nova etapa" embaixo */
  .board-toolbar-right { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .board-toolbar-right .btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; }
  .board-toolbar-right .btn-primary, .board-toolbar-right #btn-ifc { grid-column: 1 / -1; }
  .so-pc { display: none; }
  .board-header { margin-bottom: 12px; }
  .board-toolbar { gap: 8px; margin-bottom: 10px; }
  .pills { flex-wrap: nowrap; overflow-x: auto; margin-right: -12px; padding-right: 12px; padding-bottom: 4px; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; white-space: nowrap; }
  .bulk-bar > * { flex: 1 1 auto; }

  /* ---- TABELA -> CARTÕES: cada tarefa vira um cartão (12 colunas não cabem no celular) ---- */
  #board-table-wrap { overflow: visible; background: none; border: none; box-shadow: none; }
  .table-sheet, #board-table-wrap .table-sheet, .table-sheet tbody { display: block; min-width: 0; width: 100%; }
  .card.no-pad .table-sheet { min-width: 0; }   /* essas viram cartão (ao contrário das tabelas de dashboard, que só rolam de lado) */
  .table-sheet .ct-acoes { grid-column: 1 / -1; white-space: normal; text-align: left; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .table-sheet thead { display: none; }
  .table-sheet tr { display: block; }
  .table-sheet td { display: block; padding: 0; border: none; min-width: 0; width: auto; }
  .table-sheet td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  }
  .table tr:hover td { background: transparent; }

  .table-sheet tr[data-row] {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; position: relative;
    margin: 0 0 10px; padding: 14px 12px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  }
  .table-sheet tr.row-sel { background: var(--primary-soft); border-color: var(--primary); }
  .table-sheet .row-sel td { background: transparent !important; }
  .table-sheet .c-grip { display: none; }                         /* arrastar para reordenar não funciona no toque */
  .table-sheet .c-check { position: absolute; top: 14px; right: 12px; width: auto; }
  .table-sheet .c-title { grid-column: 1 / -1; padding-right: 34px; }
  .table-sheet .c-title .cell-input { padding-left: 0; font-size: 16px; font-weight: 700; }
  .table-sheet tr[data-row] .c-flow { grid-column: 1 / -1; width: auto; }
  .table-sheet .cell-input, .table-sheet .cell-select { border-color: var(--border); background: #fff; padding: 7px 9px; }
  .table-sheet .c-title .cell-input { border-color: transparent; background: transparent; }
  .table-sheet .c-status .badge { font-size: 13px; }
  .table-sheet .c-acoes { display: flex; justify-content: flex-end; align-items: center; width: auto; white-space: normal; }
  .table-sheet .c-pct { width: auto; align-self: center; }
  .table-sheet .date-input { padding: 7px 9px; font-size: 16px; }
  .date-pick { font-size: 20px; min-width: 40px; min-height: 40px; opacity: .75; }

  /* linha da ETAPA: vira um cabeçalho de seção com o resumo em grade */
  .table-sheet tr.stage-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 16px 0 8px; padding: 12px;
    background: #f1f0fb; border: 1px solid #e2def7; border-radius: 12px;
  }
  .table-sheet tr.stage-row td { background: transparent; border: none; padding: 0; }
  .table-sheet tr.stage-row { position: relative; }                  /* checkbox "todas da etapa" no canto, como nas tarefas */
  .table-sheet tr.stage-row .c-check { top: 12px; }
  .table-sheet .stage-main { padding-right: 34px; }
  .table-sheet .stage-main, .table-sheet .stage-status-cell, .table-sheet .stage-actions-cell { grid-column: 1 / -1; }
  .table-sheet .stage-date { font-size: 13px; }
  .table-sheet .stage-actions-cell { text-align: left; }
  .table-sheet .stage-actions { margin-left: 0; flex-wrap: wrap; }
  .table-sheet tr.add-task-row { margin: -2px 0 6px; }
  .add-task-btn { text-align: center; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface); }
  .table-sheet .empty { padding: 28px 8px; }

  /* ---- Kanban: colunas lado a lado com rolagem horizontal; andamento por seletor ---- */
  .kanban { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 0 12px 8px; }
  .kb-col { flex: 0 0 84%; scroll-snap-align: start; }
  .kb-card { cursor: default; }
  .kb-select { display: block; margin-top: 8px; border: 1px solid var(--border); background: #fff; padding: 8px 10px; }

  /* ---- Painel de detalhes e janelas: tela cheia / folha que sobe de baixo ---- */
  .drawer { width: 100%; max-width: 100%; height: 100vh; height: 100dvh; }
  .drawer-head { padding: 14px 16px; }
  .drawer-body { padding: 16px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .modal-sm, .modal-lg { max-width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .modal-head, .modal-foot { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .toast-box { left: 12px; right: 12px; bottom: 14px; }
  .toast { max-width: none; }
}

/* ===========================================================================
   CRONOGRAMA (Gantt) — ver js/gantt.js
=========================================================================== */
.gt-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.gt-espaco { flex: 1; }
.gt-toolbar .btn.ativo { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.gt-zoom { display: inline-flex; background: #eef0f5; border-radius: 10px; padding: 3px; gap: 2px; }
.gt-zoom button { background: transparent; border: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gt-zoom button:hover { color: var(--text); }
.gt-zoom button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.gt-wrap { --nome: 300px; position: relative; overflow: auto; max-height: 72vh; min-height: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gt { position: relative; }
.gt-head { position: sticky; top: 0; z-index: 6; display: flex; background: #fafbfd; border-bottom: 1px solid var(--border); }
.gt-corner { position: sticky; left: 0; z-index: 7; flex: 0 0 var(--nome); width: var(--nome); display: flex; align-items: flex-end; padding: 0 12px 8px; background: #fafbfd; border-right: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.gt-htracks { position: relative; flex: 0 0 auto; height: 52px; }
.gt-h1, .gt-h2 { position: absolute; left: 0; right: 0; }
.gt-h1 { top: 0; height: 22px; }
.gt-h2 { top: 22px; height: 30px; }
.gt-f { position: absolute; top: 0; bottom: 0; overflow: hidden; white-space: nowrap; text-align: center; font-size: 11px; line-height: 1.25; color: var(--muted); border-left: 1px solid var(--border); }
.gt-h1 .gt-f { text-align: left; padding: 3px 0; font-weight: 700; font-size: 12px; color: var(--text); background: #f4f5fa; overflow: clip; }
.gt-stk { position: sticky; left: calc(var(--nome) + 8px); display: inline-block; }   /* o ano/mês acompanha a rolagem lateral */
.gt-h2 .gt-f { padding-top: 3px; }
.gt-h2 .gt-f b { display: block; font-size: 12px; color: var(--text); }
.gt-h2 .gt-f.we { background: rgba(0,0,0,.05); }
.gt-h2 .gt-f.hoje { background: var(--primary); color: #fff; }
.gt-h2 .gt-f.hoje b { color: #fff; }

.gt-body { position: relative; }
.gt-grid { position: absolute; top: 0; bottom: 0; left: var(--nome); z-index: 0; pointer-events: none; }
.gt-grid div { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(0,0,0,.055); }
.gt-grid .we { background: rgba(0,0,0,.035); }
.gt-grid .gt-fds { border-left: none; }
.gt-grid .gt-hoje { background: rgba(91,70,229,.10); border-left: 1px solid var(--primary); border-right: 1px solid var(--primary); }
.gt-links { position: absolute; top: 0; left: var(--nome); z-index: 3; pointer-events: none; overflow: visible; }
.gt-seta, .gt-seta-x { fill: none; stroke-width: 1.4; }
.gt-seta { stroke: #5b6070; }
.gt-seta-x { stroke: #e0413e; stroke-width: 1.8; }

/* sem z-index aqui: a coluna de nomes (z-index 4) precisa ficar ACIMA das setas (z-index 3) ao rolar de lado */
.gt-row { position: relative; display: flex; border-top: 1px solid var(--border); }
.gt-row.gt-s { background: rgba(241,240,251,.88); }
.gt-name { position: sticky; left: 0; z-index: 4; flex: 0 0 var(--nome); width: var(--nome); display: flex; align-items: center; padding: 0 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface); border-right: 1px solid var(--border); cursor: pointer; }
.gt-name:hover { color: var(--primary); }
.gt-s .gt-name { background: #f1f0fb; font-weight: 800; }
.gt-chev { display: inline-block; width: 16px; color: var(--muted); }
.gt-s .muted-sm { margin-left: 6px; font-weight: 500; }
.gt-track { position: relative; flex: 0 0 auto; }
.gt-vazio { cursor: crosshair; }
.gt-dica { position: sticky; left: calc(var(--nome) + 14px); display: inline-block; line-height: 34px; font-size: 12px; color: #b0b4c2; font-style: italic; white-space: nowrap; max-width: calc(100% - 14px); overflow: hidden; text-overflow: ellipsis; vertical-align: top; }

.gt-bar { position: absolute; top: 6px; height: 20px; border-radius: 5px; overflow: hidden; cursor: grab; user-select: none; touch-action: pan-x pan-y; }
.gt-bar:active { cursor: grabbing; }
.gt-bar .gt-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.20); pointer-events: none; }
.gt-lbl { position: relative; display: block; padding: 0 8px; font-size: 10.5px; line-height: 20px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.gt-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.gt-h-l { left: 0; } .gt-h-r { right: 0; }
.gt-h:hover { background: rgba(0,0,0,.18); }
.gt-bar.st-backlog { background: #dfe2ea; color: #4b5563; }
.gt-bar.st-andamento { background: #a9c6ff; color: #173f9c; }
.gt-bar.st-concluida { background: #a6dfc0; color: #0c6a37; }
.gt-bar.st-atrasada { background: #f6b1b0; color: #9d1e1a; }
.gt-bar.st-cancelada { background: #eceef3; color: #6b7280; text-decoration: line-through; }
.gt-fantasma { background: rgba(91,70,229,.25); border: 1px dashed var(--primary); pointer-events: none; }
.gt-real { position: absolute; top: 28px; height: 4px; border-radius: 2px; background: var(--text); opacity: .75; pointer-events: none; }
.gt-sum { position: absolute; top: 10px; height: 10px; border-radius: 2px; background: #3f4370; overflow: hidden; }
.gt-sum .gt-fill { position: absolute; left: 0; top: 0; bottom: 0; background: #9aa0e0; }
.gt-real + .gt-real { display: none; }
.gt-s .gt-real { top: 22px; }

.gt-legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.gt-lg { display: inline-block; vertical-align: middle; margin-right: 5px; }
.gt-lg-bar { width: 26px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, rgba(0,0,0,.25) 45%, #a9c6ff 45%); }
.gt-lg-real { width: 26px; height: 4px; border-radius: 2px; background: var(--text); opacity: .75; }
.gt-lg-marco { width: 0; height: 14px; border-left: 2px dashed #d98a00; }
#gt-tip { position: fixed; z-index: 200; background: var(--text); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; }
body.gt-arrastando { cursor: grabbing; user-select: none; }

/* predecessoras no painel de detalhes */
.pred-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pred-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fafbfd; font-size: 13px; }
.pred-chip .muted-sm { margin-left: 4px; }

@media (max-width: 760px) {
  .gt-wrap { --nome: 140px; max-height: 68vh; margin: 0 -12px; border-radius: 0; border-left: none; border-right: none; }
  .gt-name { font-size: 12px; padding: 0 8px; }
  .gt-toolbar { gap: 6px; }
  .gt-toolbar .btn-sm { min-height: 34px; padding: 5px 9px; font-size: 12px; }
  .gt-espaco { display: none; }
  .gt-zoom { width: 100%; overflow-x: auto; }
  .gt-zoom button { flex: 1 0 auto; padding: 8px 10px; }
  .gt-corner { padding: 0 8px 8px; }
}

/* Marcos da obra (início + prazo em meses) e tela cheia do cronograma */
.gt-obra { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 4px 10px; background: #fff7ea; border: 1px solid #f3d9a6; border-radius: 10px; font-size: 12.5px; color: var(--muted); }
.gt-obra-rot { font-weight: 800; color: #9a5b00; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.gt-obra label { display: inline-flex; align-items: center; gap: 5px; }
.gt-obra .input { height: 30px; padding: 3px 6px; }
.gt-obra-mes { width: auto; min-width: 112px; }
.gt-obra-ano { width: 64px; text-align: center; }
.gt-obra-meses { width: 62px; text-align: center; }
.gt-obra-fim b { color: var(--text); }
.gt-grid .gt-marco { width: 0; border-left: 2px dashed #d98a00; z-index: 1; }
.gt-grid .gt-marco.fim { border-left-color: #e0413e; }
.gt-grid .gt-fora { border-left: none; background: repeating-linear-gradient(135deg, rgba(0,0,0,.04) 0 6px, transparent 6px 12px); }
.gt-grid .gt-fora.gt-apos { background: repeating-linear-gradient(135deg, rgba(224,65,62,.09) 0 6px, transparent 6px 12px); }
.gt-grid .ano-ini, .gt-h2 .gt-f.ano-ini { border-left-color: rgba(0,0,0,.2); }
.gt-marco-tag { position: absolute; top: 2px; z-index: 2; padding: 1px 6px; border-radius: 6px; background: #d98a00; color: #fff; font-size: 10.5px; line-height: 16px; font-weight: 800; white-space: nowrap; }
.gt-marco-tag.fim { background: #e0413e; transform: translateX(-100%); }
.gt-cheia { position: fixed; inset: 0; z-index: 50; background: var(--bg); padding: 10px 14px; overflow: auto; display: flex; flex-direction: column; }
.gt-cheia .gt-wrap { flex: 1 1 auto; max-height: none; min-height: 0; }
.gt-cheia .gt-toolbar { margin-bottom: 8px; }
.gt-cheia .gt-legenda { display: none; }                                   /* mais espaço para o gráfico */
html:has(#board-cronograma.gt-cheia:not([style*="none"])) { overflow: hidden; }   /* sem rolagem da página por baixo */
@media (max-width: 760px) {
  .gt-obra { width: 100%; }
  .gt-cheia { padding: 8px 12px; }
}


/* ===========================================================================
   % EXECUTADO digitado (tabela, cronograma e painel de detalhes)
=========================================================================== */
.pctmini-pc { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.pct-input { width: 50px; flex: 0 0 auto; padding: 3px 4px; font-size: 12.5px; font-weight: 600; text-align: right; }
.pct-input.manual { color: var(--primary); font-weight: 800; }
.pct-drawer { display: flex; align-items: center; gap: 8px; }
.pct-drawer input[type="range"] { flex: 1; padding: 0; }
.pct-drawer input[type="number"] { width: 72px; }

.gt-name { gap: 6px; }
.gt-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-pct { flex: 0 0 auto; min-width: 40px; padding: 1px 6px; border: 1px solid transparent; border-radius: 8px; background: #f0f1f6; font-size: 11px; font-weight: 700; color: var(--muted); cursor: text; }
.gt-pct:hover { border-color: var(--primary); color: var(--primary); }
.gt-pct.man { background: var(--primary-soft); color: var(--primary); }
.gt-pct-s { background: transparent; cursor: default; }
.gt-pct-in { flex: 0 0 auto; width: 58px; padding: 1px 4px; font-size: 12px; border-radius: 7px; }
.gt-pct-h { position: absolute; bottom: 0; width: 13px; height: 9px; margin-left: -6px; background: var(--text); clip-path: polygon(50% 0, 100% 100%, 0 100%); cursor: ew-resize; opacity: 0; transition: opacity .12s; }
.gt-bar:hover .gt-pct-h, body.gt-arrastando .gt-pct-h { opacity: .85; }
@media (max-width: 760px) {
  .gt-pct { min-width: 34px; padding: 1px 4px; }
  .table-sheet .pct-input { font-size: 16px; padding: 7px 6px; width: 64px; }
  .table-sheet .c-pct { width: auto; }
}
/* ===== UNIDADES (matriz serviços x unidades) ===== */
.un-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.un-bar-dir { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.un-vazio-card { text-align: center; padding: 34px 20px; }
.un-vazio-card h3 { font-size: 17px; margin-bottom: 8px; }
.un-vazio-card p { color: var(--muted); max-width: 560px; margin: 0 auto 16px; line-height: 1.5; }
.btn-danger-txt { color: var(--atrasada); }

.un-scroll { overflow: auto; max-height: 70vh; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.un-mat { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.un-mat th, .un-mat td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 0; text-align: center; }
.un-mat thead th { position: sticky; top: 0; z-index: 3; background: #f3f4f9; font-weight: 700; color: var(--text); }
.un-col { min-width: 92px; max-width: 120px; padding: 8px 6px !important; cursor: pointer; vertical-align: bottom; }
.un-col span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.25; }
.un-col:hover { background: var(--primary-soft) !important; color: var(--primary); }
.un-corner, .un-row { position: sticky; left: 0; z-index: 2; background: #f3f4f9; text-align: left !important; padding: 8px 12px !important; min-width: 96px; font-weight: 700; }
.un-corner { z-index: 4; }
.un-row { background: var(--surface); }
.un-geral-h, .un-geral { min-width: 70px; background: #f8f9fc; font-weight: 700; padding: 8px !important; }
.un-grp td { text-align: left !important; background: #eef0f7; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 12px !important; }
.un-cell { height: 38px; min-width: 64px; cursor: pointer; font-weight: 700; font-variant-numeric: tabular-nums; }
.un-cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.un-cell.editando { padding: 0 !important; outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; }
.un-c0 { background: #f1f2f6; color: #9a9eb0; }
.un-c1 { background: #fff1cf; color: #a06a00; }
.un-c2 { background: #d9f3e4; color: #12703b; }
.un-nada { color: #c9ccd8; background: repeating-linear-gradient(45deg, #fafbfd, #fafbfd 6px, #f4f5f9 6px, #f4f5f9 12px); font-weight: 400; }
.un-in { width: 100%; height: 36px; border: none; background: transparent; text-align: center; font: inherit; font-weight: 700; outline: none; }
.un-mat tfoot th, .un-mat tfoot td { position: sticky; bottom: 0; z-index: 2; background: #f3f4f9; padding: 8px !important; font-weight: 700; }
.un-tot { font-variant-numeric: tabular-nums; }

.un-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.un-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.un-card:hover { border-color: var(--primary); }
.un-card-tit { font-weight: 700; font-size: 14.5px; }
.un-card-sub { font-size: 12px; color: var(--muted); }
.un-card-bar { height: 8px; background: #eef0f5; border-radius: 20px; overflow: hidden; margin-top: 4px; }
.un-card-bar span { display: block; height: 100%; border-radius: 20px; }
.un-card-bar .un-c0, .un-card-bar .un-c1 { background: #e7a81c; } .un-card-bar .un-c0 { background: #d5d8e2; } .un-card-bar .un-c2 { background: #18a558; }
.un-card-num { font-size: 12.5px; color: var(--muted); } .un-card-num b { color: var(--text); font-size: 15px; margin-right: 4px; }
.un-card .badge { align-self: flex-start; margin-top: 2px; }

.un-det-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.un-det-tit { flex: 1; min-width: 200px; } .un-det-tit h3 { font-size: 18px; margin: 0; }
.un-lote { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; }
.un-lote-acoes { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.un-lote-acoes .input { width: 70px; }
.un-det td { vertical-align: middle; }
.un-d-nome small { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.un-esp { width: 100%; }
.un-d-pct { min-width: 190px; }
.un-d-pct .pctmini-bar span.un-c0 { background: #d5d8e2; } .un-d-pct .pctmini-bar span.un-c1 { background: #e7a81c; } .un-d-pct .pctmini-bar span.un-c2 { background: #18a558; }
.un-st { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.un-st-ok { background: #d9f3e4; color: #12703b; } .un-st-and { background: #fff1cf; color: #a06a00; } .un-st-pend { background: #eef0f5; color: #767a8a; }
.pct-input.pct-un:disabled { background: transparent; color: var(--text); opacity: .75; cursor: not-allowed; }

.un-lista { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; padding-right: 4px; }
.un-item { display: grid; grid-template-columns: 1fr 140px auto auto auto; gap: 6px; align-items: center; }
.un-item .input { width: 100%; }
.un-novo { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.un-novo-tit { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.un-novo-linha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.un-novo-linha > .input:first-child { flex: 1; min-width: 200px; }
.un-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.un-mini .input { width: 74px; }
.un-atalhos { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.un-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 10px; }
.un-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 4px 6px; border-radius: 6px; cursor: pointer; } .un-check:hover { background: var(--primary-soft); }
.un-check small { color: var(--muted); font-size: 11px; }
.un-drw-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.gt-pct.un { cursor: default; background: #eef0f5; color: var(--muted); }

.un-lote-sel { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.un-lote-sel input { width: auto; margin: 0; }
@media (max-width: 760px) {
  .un-item { grid-template-columns: 1fr 110px auto auto auto; }
  .un-lote-acoes { margin-left: 0; }
  .un-d-pct { min-width: 150px; }

  /* ---- Unidades/Serviços no celular ---- */
  .un-bar { gap: 8px; margin-bottom: 10px; }
  .un-bar > .pills { width: 100%; }
  .un-bar-dir { width: 100%; gap: 6px; }
  .un-bar-dir > .btn { flex: 1 1 auto; }
  /* detalhe do serviço: ← Serviços / nome / ações em linhas próprias */
  .un-det-head { gap: 8px; margin-bottom: 10px; }
  .un-det-tit { flex-basis: 100%; min-width: 0; }
  .un-det-nome { font-size: 20px; max-width: none; }
  .un-det-acoes > .btn { padding-left: 8px; padding-right: 8px; }
  .gu-plan { padding: 12px; }
  /* selecionar / definir % em lote */
  .un-lote { gap: 8px; margin-bottom: 8px; }
  .un-lote-acoes { width: 100%; display: flex; gap: 6px; }
  .un-lote-acoes .input { flex: 0 0 64px; width: 64px; }
  .un-lote-acoes .btn { flex: 1 1 auto; padding-left: 6px; padding-right: 6px; }
  /* unidades do serviço em cartões: nome / especificação / status + anexos / execução */
  .un-det tr.un-d-linha { grid-template-columns: 1fr auto; gap: 8px 10px; padding: 12px; }
  .un-det .un-d-nome { grid-column: 1 / -1; padding-right: 34px; font-size: 16px; font-weight: 700; }
  .un-det .un-d-esp { grid-column: 1 / -1; }
  .un-det .un-d-st { grid-row: 3; grid-column: 1; align-self: center; }
  .un-det .un-d-anx { grid-row: 3; grid-column: 2; width: auto; }
  .un-det .un-d-pct { grid-row: 4; grid-column: 1 / -1; min-width: 0; }
  .un-det .un-d-pct .pct-input { width: 80px; }
  .un-det .un-anx-row { margin: -6px 0 10px; }
  .un-det .un-anx-row > td:first-child { display: none; }
  .un-scroll { margin: 0 -12px; border-radius: 0; border-left: none; border-right: none; }
}
.un-det-nome { font: inherit; font-size: 18px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; margin-left: -8px; background: transparent; width: 100%; max-width: 380px; }
.un-det-nome:hover, .un-det-nome:focus { border-color: var(--border); background: var(--surface); outline: none; }
.un-vazio-acoes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.un-card[draggable="true"] { cursor: grab; user-select: none; }
.un-card[draggable="true"]:active { cursor: grabbing; }
.un-card.arrastando { opacity: .4; }
.un-card.alvo-antes { box-shadow: inset 4px 0 0 var(--primary), var(--shadow); }
.un-card.alvo-depois { box-shadow: inset -4px 0 0 var(--primary), var(--shadow); }
.un-grip { color: #b5b8c6; font-size: 13px; letter-spacing: -2px; margin-right: 6px; }
.btn-icon-info { font-size: 18px; color: var(--primary); }
.obra-foot { flex-wrap: wrap; }
.obra-foot .btn-primary { margin-left: auto; }

/* ===== UNIDADES: detalhe da unidade, extras e anexos ===== */
.un-row[data-un-unidade], .un-extras[data-un-unidade] { cursor: pointer; }
.un-row[data-un-unidade]:hover { color: var(--primary); text-decoration: underline; }
.un-clip { font-size: 10.5px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.un-extras { text-align: center; font-weight: 600; }
.un-badge { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.un-col-extra { background: #f7f1ff !important; }
.un-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #7a3fd0; background: #f1e8ff; border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.un-matbar { margin-bottom: 8px; } .un-matbar .btn.ativo { border-color: var(--primary); color: var(--primary); }
.un-sec { font-size: 14px; font-weight: 700; margin: 18px 0 8px; } .un-sec .muted-sm { font-weight: 400; }
.un-link { color: var(--primary); font-weight: 600; cursor: pointer; } .un-link:hover { text-decoration: underline; }
.un-card-sub { font-size: 12px; color: var(--muted); }
.un-card-extra { border-style: dashed; }
.un-d-anx { width: 70px; text-align: center; } .un-d-anx .btn.tem { border-color: var(--primary); color: var(--primary); }
.un-d-x { width: 34px; }
.un-anx-row > td { background: #fafbfe; padding: 10px 14px !important; }
.un-add-serv { display: flex; gap: 8px; margin: 12px 0 0; } .un-add-serv .input { flex: 1; }
.un-geral-card { padding: 16px; }
.un-notas { width: 100%; resize: vertical; }
.anx { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.anx-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; background: var(--surface); max-width: 260px; }
.anx-thumb, .anx-pdf { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #eef0f5; }
.anx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.anx-pdf { background: #fde8e8; color: #c0392b; font-weight: 800; font-size: 12px; }
.anx-meta { min-width: 0; display: flex; flex-direction: column; }
.anx-meta a { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.anx-meta small { color: var(--muted); font-size: 11px; }
.anx-add { cursor: pointer; align-self: center; }
@media (max-width: 760px) { .un-add-serv { flex-direction: column; } .anx-item { max-width: 100%; } }

/* ===== CONTRATOS e PRESTADORES ===== */
.ct-tab td { vertical-align: middle; }
.ct-tab-lista tr[data-ct-abrir] { cursor: pointer; }
.ct-tab-lista tr[data-ct-abrir]:hover td { background: #f7f8fc; }
.ct-det-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.ct-det-grid .field { margin-bottom: 14px; }
.ct-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-nome small, .ct-tab td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ct-acoes { white-space: nowrap; text-align: right; }
.ct-acoes .btn.tem { border-color: var(--primary); color: var(--primary); }
.ct-cancel { opacity: .55; }
.ct-resumo { margin-right: 6px; }
.ct-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: #eef0f5; color: var(--muted); margin: 1px 0; }
.ct-chip-auto { background: #fff1cf; color: #a06a00; }
.ct-itens-row > td { background: #fafbfe; padding: 12px 16px !important; }
.ct-sub-row > td { background: #fafbfe; padding: 12px 16px !important; }
.ct-decompor-btn { background: none; border: none; padding: 0; margin-top: 2px; font: inherit; font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; }
.ct-subitens-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ct-subitens-lista .med-linha-corpo .btn-icon { margin-left: 4px; }
.ct-itens-tit { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.ct-itens-tit .muted-sm { font-weight: 400; }
.ct-collapse-tit { display: flex; align-items: baseline; gap: 6px; width: 100%; background: none; border: none; padding: 0 0 8px; margin: 0; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer; }
.ct-collapse-tit .muted-sm { font-weight: 400; }
.ct-chev { flex: 0 0 auto; width: 14px; color: var(--muted); font-size: 11px; }
.ct-item-novo { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .ct-item-novo .input:first-child { flex: 1; min-width: 200px; }
.ct-valor { width: 130px; text-align: right; }
.ct-prest-row { display: flex; gap: 8px; } .ct-prest-row select { flex: 1; }
.ct-vinculos { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ct-vinc { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; background: var(--surface); }
.ct-vinc-tipo { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 1px 6px; flex: 0 0 auto; }
.ct-vinc-txt { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.ct-vinc-auto { font-size: 12.5px; font-weight: 600; color: #a06a00; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ct-vinc-auto-novo { display: flex; margin: 4px 0 10px; }
.ct-vinc-add { display: flex; gap: 8px; margin-bottom: 8px; } .ct-vinc-add select { flex: 1; min-width: 0; }
.pct-contrato { margin-left: 4px; color: #a06a00; font-size: 13px; cursor: help; }
@media (max-width: 760px) { .ct-vinc { flex-wrap: wrap; } .ct-item-novo .ct-valor { width: 100%; } .ct-det-grid { grid-template-columns: 1fr; } }
/* Lista de contratos no celular: só nome + % (o resto só aparece ao abrir o contrato) */
@media (max-width: 760px) {
  .ct-tab-lista tr[data-row] { display: flex; align-items: center; gap: 10px; padding: 12px; }
  .ct-tab-lista td { display: none; }
  .ct-tab-lista td.ct-nome, .ct-tab-lista td.un-d-pct { display: block; padding: 0; }
  .ct-tab-lista td[data-label]::before { display: none; }
  .ct-tab-lista td.ct-nome { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ct-tab-lista td.ct-nome small { display: block; font-weight: 400; }
  .ct-tab-lista td.un-d-pct { flex: 0 0 auto; width: 84px; min-width: 0; }
}
.un-check input[type="checkbox"], .ct-vinc-auto input[type="checkbox"], .modal .un-check input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }
.ct-vinc-auto-novo { justify-content: flex-start; }

/* ===== MEDIÇÕES por data (contratos) ===== */
.ct-med { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.ct-med-rasc td { background: #fffdf5; }
.ct-data { width: 130px; text-align: center; }
.ct-neg { color: var(--atrasada); font-weight: 700; }
.modal-med { max-width: 820px; }
.med-totais { margin: 10px 2px; font-size: 14px; }
.med-lista { display: flex; flex-direction: column; gap: 8px; }
.med-linha { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.med-linha-tit { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.med-linha-corpo { display: flex; align-items: center; gap: 8px; }
.med-linha-corpo > .muted-sm { flex: 0 0 auto; white-space: nowrap; }
.med-linha-pct { width: 76px; flex: 0 0 auto; text-align: center; }
.med-linha-corpo [data-med-delta] { flex: 0 0 auto; font-weight: 700; min-width: 44px; }
.med-linha-corpo [data-med-rs] { margin-left: auto; }
.med-fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.med-foto { position: relative; width: 120px; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #eef0f5; }
.med-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.med-foto .btn-icon { position: absolute; top: 3px; right: 3px; background: rgba(255,255,255,.9); border-radius: 50%; }
/* medição agrupada: quadro por serviço (unidade × etapa) e bloco por item decomposto */
.med-quadro { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.med-quadro-tit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 12px; background: var(--primary-soft); font-size: 14px; }
.med-quadro-tit .med-res { margin-left: auto; }
.med-quadro > .med-lista { padding: 8px; }
.med-grade-rolagem { overflow-x: auto; }
.med-grade { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.med-grade th, .med-grade td { padding: 5px 6px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.med-grade thead th { font-size: 11px; font-weight: 700; color: var(--muted); background: #f6f7fb; line-height: 1.2; }
.med-grade tbody th { text-align: left; font-weight: 700; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.med-grade tbody tr:last-child th, .med-grade tbody tr:last-child td { border-bottom: none; }
.med-grade-pct { width: 64px; text-align: center; border: 1px solid var(--border) !important; border-radius: 6px; background: var(--surface); }
.med-grade-pct:disabled { border-color: transparent !important; background: transparent; }
.med-ant { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.med-grade-res { white-space: nowrap; text-align: right !important; }
.med-res b { font-size: 13px; }
.med-res small { display: block; font-size: 11px; color: var(--muted); }
.med-res-ok b { color: #1f8a4c; }
.pct-input.med-neg { border-color: var(--atrasada); color: var(--atrasada); font-weight: 700; }
@media (max-width: 760px) {
  .med-grade th, .med-grade td { padding: 4px 3px; }
  .med-grade thead th { font-size: 10px; }
  .med-grade-pct { width: 50px; padding: 4px 2px !important; }
  .med-quadro-tit { padding: 8px 10px; }
}


/* ===== DEMANDAS (tela inicial) ===== */
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--atrasada); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
.dm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.dm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; text-align: left; font: inherit; }
.dm-tile b { font-size: 24px; line-height: 1.1; color: var(--text); }
.dm-tile span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dm-tile:hover { border-color: var(--primary); }
.dm-tile-atraso b { color: var(--atrasada); }
.dm-pills { margin: 0 0 10px; }
.dm-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dm-filtros .input { width: auto; flex: 1 1 160px; min-width: 0; }
.dm-lista { display: flex; flex-direction: column; gap: 8px; }
.dm-vazio { text-align: center; padding: 24px 0; }
.dm-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.dm-card:hover { box-shadow: var(--shadow); }
.dm-card-atraso { border-left-color: var(--atrasada); }
.dm-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--muted); }
.dm-num { font-weight: 700; color: var(--muted); }
.dm-num:empty { display: none; }
.dm-obra { font-weight: 700; color: var(--text); margin-right: auto; }
.dm-obra-sem { color: var(--muted); font-weight: 600; }
.dm-rep { font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.dm-elos { font-size: 12px; margin-top: 2px; }
.dm-tit { font-size: 15px; font-weight: 700; margin: 5px 0 4px; overflow-wrap: anywhere; }
.dm-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.dm-meta b { color: var(--text); }
.dm-st-aberta { background: #e6ecff; color: #2848b8; }
.dm-st-atraso { background: #fde2e1; color: #b3261e; }
.dm-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.dm-btn-descartar { color: var(--atrasada); }
.dm-passar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.dm-passar select { flex: 1 1 200px; width: auto; min-width: 0; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.dm-campo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dm-campo > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.dm-campo > b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dm-med-acoes { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.dm-med-acoes b { font-size: 14px; font-weight: 600; }
.dm-med-info { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; }
.dm-anexos { display: flex; flex-wrap: wrap; gap: 10px; }
.dm-anexo { position: relative; width: 120px; }
.dm-anexo-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.dm-anexo-link img, .dm-anexo-pdf { width: 120px; height: 90px; border-radius: 10px; border: 1px solid var(--border); object-fit: cover; background: #eef0f5; }
.dm-anexo-pdf { display: flex; align-items: center; justify-content: center; font-weight: 800; color: #b3261e; }
.dm-anexo-nome { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-anexo .btn-icon { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0; font-size: 15px; }
.dm-msgs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dm-msg-sis { font-size: 12px; color: var(--muted); font-style: italic; text-align: center; }
.dm-msg { align-self: flex-start; max-width: 85%; background: #f1f2f7; border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.dm-msg-eu { align-self: flex-end; background: var(--primary-soft); border-radius: 12px 12px 4px 12px; }
.dm-msg-autor { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.dm-msg-txt { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-msg-novo { display: flex; gap: 8px; align-items: flex-end; }
.dm-msg-novo textarea { flex: 1; }
/* demandas dentro do painel da atividade */
.dm-drawer-lista { display: flex; flex-direction: column; gap: 6px; }
.dm-drawer-lista .dm-card { padding: 8px 12px; }
.dm-drawer-lista .dm-obra { visibility: hidden; width: 0; overflow: hidden; }   /* a obra é a da atividade; fica só o espaçador */
.dm-drawer-lista .dm-tit { font-size: 14px; margin: 3px 0 2px; }
@media (max-width: 760px) {
  .dm-tiles { gap: 8px; }
  .dm-tile { padding: 10px; }
  .dm-tile b { font-size: 20px; }
  .dm-tile span { font-size: 11.5px; }
  .dm-grid { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .dm-filtros .input { flex: 1 1 45%; }
  .dm-filtros [data-dm-busca] { flex-basis: 100%; }
}

/* ===== CONTRATOS: tipo, fase (em elaboração / efetivado), itens-atividade ===== */
.ct-tipos { margin-bottom: 10px; }
.ct-tag-extra { display: inline-block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #8a4b00; background: #ffe7c7; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.ct-tag-ativ { display: inline-block; font-size: 11px; font-weight: 700; color: #a06a00; background: #fff1cf; border-radius: 6px; padding: 1px 6px; margin: 2px 0 0 8px; cursor: help; }
.ct-sem-valor { display: block; font-size: 11px; font-weight: 700; color: var(--atrasada); }
.med-linha-tit .ct-sem-valor { display: inline; }
.ct-valor-soma { font-weight: 600; cursor: help; }
.ct-fase { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; padding: 12px 14px; margin: 0 0 14px; border-radius: 12px; background: #eef0f5; border: 1px solid var(--border); font-size: 13.5px; }
.ct-fase > div { flex: 1 1 280px; }
.ct-fase .muted-sm { display: block; margin-top: 2px; }
.ct-fase-ok { background: #e6f6ed; border-color: #b9e4cb; }
.med-linha-tit .cell-input { min-width: 0; }
.med-linha-tit .cell-input:first-child { flex: 1; }
.med-linha-tit .ct-valor { flex: 0 0 110px; width: 110px; }
#confirm-msg { white-space: pre-line; }
.ct-itens .cell-input:disabled { background: transparent !important; border-color: transparent !important; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }

/* ===== CRONOGRAMA: menu de predecessoras (botão direito / toque longo) ===== */
.gt-t .gt-name, .gt-bar { -webkit-touch-callout: none; }
.gt-menu { position: fixed; z-index: 120; width: 300px; max-height: min(460px, 80vh); display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(20, 22, 40, .22); padding: 10px 12px; }
.gt-menu-tit { display: flex; align-items: flex-start; gap: 8px; font-weight: 800; font-size: 14px; }
.gt-menu-tit span { flex: 1; overflow-wrap: anywhere; }
.gt-menu-x { background: none; border: none; font-size: 20px; line-height: 1; color: var(--muted); padding: 0 2px; }
.gt-menu-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 4px; }
.gt-menu-preds { display: flex; flex-direction: column; gap: 4px; }
.gt-menu-preds .muted-sm { margin: 0; }
.gt-menu-pred { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; border-radius: 8px; background: #f1f2f7; font-size: 13px; }
.gt-menu-pred span { flex: 1; }
.gt-menu-pred.conf { background: #fde2e1; }
.gt-menu-pred.conf b { color: var(--atrasada); }
.gt-menu-pred button { background: none; border: none; font-size: 17px; color: var(--muted); padding: 0 6px; }
.gt-menu-lista { overflow-y: auto; flex: 1; min-height: 60px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.gt-menu-lista .muted-sm { margin: 6px; }
.gt-menu-grp { font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 6px 2px; }
.gt-menu-op { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--text); }
.gt-menu-op:hover { background: var(--primary-soft); color: var(--primary); }
.gt-menu-det { align-self: flex-start; }
@media (max-width: 760px) {
  .gt-menu { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75vh; border-radius: 18px 18px 0 0; padding: 14px 16px 18px; }
  .gt-menu-op { padding: 10px 8px; font-size: 15px; }
  .gt-menu-pred { padding: 6px 4px 6px 10px; font-size: 14px; }
  .gt-menu-pred button { font-size: 20px; padding: 2px 10px; }
}
.gt-setas-rot { align-self: center; padding: 0 6px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ===== CONTRATOS: itens de unidade e padrão de decomposição ===== */
.ct-tag-un { color: #2848b8; background: #e6ecff; }
.ct-puxar-un { border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px 10px; margin-top: 10px; }
.ct-puxar-un > .ct-item-novo:first-child { margin-top: 0; }
.ct-puxar-un .un-checks { margin: 6px 0; }
.ct-padrao-info { margin: 6px 0 0; }
.pd-linhas { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pd-linha { display: flex; gap: 6px; align-items: center; }
.pd-linha [data-pd-nome] { flex: 1; min-width: 0; }
.pd-peso { width: 90px; flex: 0 0 90px; text-align: right; }

/* ===== SEGURANÇA DO TRABALHO ===== */
.seg-alerta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; margin: 4px 0 12px; padding: 10px 14px; border: 1px solid #f3c7c3; border-left: 4px solid var(--atrasada); border-radius: 12px; background: #fff6f5; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; color: var(--text); }
.seg-alerta:hover { box-shadow: var(--shadow); }
.seg-alerta-bad { color: var(--atrasada); }
.seg-alerta-ir { margin-left: auto; font-weight: 700; color: var(--primary); }
.seg-st-venc { background: #fff1cf; color: #a06a00; }
.seg-head-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg-resumo { margin: 0 0 10px; font-size: 13.5px; }
.seg-progresso { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13px; }
.seg-filtros .seg-check { flex: 0 0 auto; }
.seg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.seg-check input { width: auto; margin: 0; }
.user-obras-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 240px; overflow-y: auto; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.user-obras-lista.travada { opacity: .5; pointer-events: none; }
.user-obras-lista .seg-check { padding: 3px 0; }
.seg-lista { display: flex; flex-direction: column; gap: 6px; }
.seg-vazio { text-align: center; padding: 20px 0; }
.seg-item { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) 110px 190px; gap: 12px; align-items: center; padding: 9px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.seg-item:hover { border-color: var(--primary); }
.seg-c-nome { display: flex; flex-direction: column; min-width: 0; }
.seg-c-nome b { overflow-wrap: anywhere; }
.seg-c-obras { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-c-st { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.seg-obras { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; cursor: pointer; background: var(--surface); }
.seg-chip input { width: auto; margin: 0; }
.seg-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.seg-chip.via { border-style: dashed; }
.seg-chip small { color: var(--muted); font-weight: 400; }
.seg-docs { display: flex; flex-direction: column; gap: 6px; }
.seg-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfd; }
.seg-doc-antigo { opacity: .7; }
.seg-doc-tipo { display: flex; flex-direction: column; min-width: 0; }
.seg-doc-acoes { display: flex; align-items: center; gap: 4px; }
.seg-doc-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.seg-hist-btn { margin: 8px 0 6px; }
.seg-form { margin-top: 10px; padding: 12px; border: 1px solid var(--primary); border-radius: 12px; background: var(--surface); }
.seg-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; margin-bottom: 8px; }
.seg-form-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.seg-lote-linha { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 150px; gap: 8px; align-items: center; margin-bottom: 6px; }
.seg-lote-nome { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-tipos { display: flex; flex-direction: column; gap: 6px; }
.seg-tipo { display: grid; grid-template-columns: minmax(0, 1fr) 150px 130px 110px; gap: 8px; align-items: center; }
.seg-tipo-off { opacity: .55; }
.seg-tipo-novo { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.seg-prazo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.seg-prazo .input { width: 70px; }
@media (max-width: 760px) {
  .seg-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; }
  .seg-c-nome { grid-column: 1; }
  .seg-c-st { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; align-items: flex-end; }
  .seg-c-obras { grid-column: 1; white-space: normal; }
  .seg-c-num { display: none; }
  .seg-doc { grid-template-columns: minmax(0, 1fr) auto; }
  .seg-doc-acoes { grid-column: 1 / -1; justify-content: flex-end; }
  .seg-lote-linha { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seg-lote-nome { grid-column: 1 / -1; }
  .seg-tipo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seg-tipo > .input:first-child { grid-column: 1 / -1; }
  .seg-tipo-novo .btn { grid-column: 1 / -1; }
}

/* ===== PLANTAS (pavimentos + marcações) ===== */
.pl-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.pl-lado { position: sticky; top: 70px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; max-height: calc(100vh - 90px); overflow: auto; }
.pl-lado-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.pl-lista { display: flex; flex-direction: column; gap: 2px; }
.pl-lista-tit { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: 10px 4px 4px; }
.pl-pav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; cursor: pointer; color: var(--text); }
.pl-pav:hover { background: #f3f4f9; }
.pl-pav.on { background: var(--primary-soft); color: var(--primary); }
.pl-pav-nome { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-pav-sub { grid-column: 1; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-pav-n { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--atrasada); color: #fff; font-size: 11px; font-weight: 800; text-align: center; }
.pl-lista-mobile { display: none; }
.pl-main { min-width: 0; }
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pl-titulo { font-weight: 700; font-size: 15px; margin-right: auto; }
.pl-bar .input-sm { width: auto; }
.pl-zoom { display: inline-flex; gap: 2px; }
.pl-stage { position: relative; overflow: auto; background: #eef0f5; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.pl-stage.marcando, .pl-janela-corpo.marcando { cursor: crosshair; outline: 3px solid var(--primary); outline-offset: -3px; }
/* a largura (planta inteira na tela × zoom) é calculada no plantas.js; até lá fica escondida para não piscar grande */
.pl-inner { position: relative; margin: 0 auto; }
.pl-inner:not([style*="width"]) { visibility: hidden; }
.pl-stage, .pl-janela-corpo { overscroll-behavior: contain; }
.pl-inner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.pl-pin { position: absolute; transform: translate(-50%, -100%); width: 28px; height: 28px; padding: 0; border: 2px solid #fff; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--cor, #e2664a); box-shadow: 0 2px 6px rgba(0,0,0,.35); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pl-pin span { rotate: 45deg; color: #fff; font-size: 11.5px; font-weight: 800; }
.pl-pin-ok { opacity: .45; }
.pl-pin-atraso { box-shadow: 0 0 0 3px rgba(179,38,30,.55), 0 2px 6px rgba(0,0,0,.35); }
.pl-marcs { margin-top: 12px; }
.pl-marc { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 6px; cursor: pointer; }
.pl-marc:hover { border-color: var(--primary); }
.pl-marc-ok { opacity: .65; }
.pl-num { flex: 0 0 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pl-marc-txt { display: flex; flex-direction: column; min-width: 0; }
.pl-atraso { color: var(--atrasada); }
.pl-ger { margin-bottom: 14px; }
.pl-ger-linha { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.pl-ger-acoes { display: flex; gap: 2px; }
.pl-ger-novo { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pl-ger-novo .input { flex: 1 1 200px; width: auto; }
.pl-ger-plantas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pl-ger-planta { position: relative; display: flex; flex-direction: column; gap: 4px; }
.pl-ger-planta img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #eef0f5; }
.pl-ger-planta .btn-icon { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.92); }
.pl-modal { max-width: 560px; }
.pl-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.pl-foto { position: relative; }
.pl-foto img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #eef0f5; display: block; }
.pl-foto .btn-icon { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; min-width: 22px; min-height: 22px; padding: 0; background: #fff; border-radius: 50%; box-shadow: var(--shadow); }
.pl-fotos-add { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-cat { border: 2px solid var(--cor, #999); background: #fff; color: var(--text); border-radius: 20px; padding: 4px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pl-cat.on { background: var(--cor, #999); color: #fff; }
.pl-cat-nova { border-style: dashed; --cor: #9aa0b0; }
.pl-status { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-st { flex: 1; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.pl-st.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pl-excluir { color: var(--atrasada); }
.pl-janela { max-width: min(1100px, 96vw); width: 96vw; }
.pl-janela-corpo { overflow: auto; max-height: 72vh; background: #eef0f5; display: flex; }
.pl-janela-corpo > .pl-inner { flex: 0 0 auto; }
.pl-modal-ov .modal-foot { display: flex; align-items: center; gap: 8px; }
@media (max-width: 760px) {
  .pl-wrap { grid-template-columns: 1fr; gap: 10px; }
  .pl-lado { position: static; max-height: none; padding: 8px; }
  .pl-lista { display: none; }
  .pl-lista-mobile { display: block; }
  .pl-ger-linha { grid-template-columns: minmax(0, 1fr) auto; }
  .pl-ger-linha select { grid-column: 1; }
  .pl-ger-acoes { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .pl-janela { width: 100vw; max-width: 100vw; }
}

/* ===== PAINEL DA SEGURANÇA (obras × documentos) ===== */
.vs-painel-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.vs-painel { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1000px; font-size: 12.5px; }
.vs-painel th, .vs-painel td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.vs-painel thead th { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; background: #fafbfd; line-height: 1.25; }
.vs-painel tbody tr:last-child th, .vs-painel tbody tr:last-child td { border-bottom: 0; }
.vs-painel-obra { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left !important; font-weight: 700; font-size: 13.5px; white-space: nowrap; cursor: pointer; box-shadow: 1px 0 0 var(--border); }
thead .vs-painel-obra { background: #fafbfd; z-index: 2; }
.vs-painel-obra .proj-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.vs-cel { cursor: pointer; white-space: nowrap; }
.vs-cel b { display: block; font-size: 12px; }
.vs-cel span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.vs-cel-ok b { color: #12703b; }
.vs-cel-warn { background: #fff8e6; } .vs-cel-warn b { color: #a06a00; }
.vs-cel-bad { background: #fdeeee; } .vs-cel-bad b { color: #b3261e; }
.vs-cel:hover { box-shadow: inset 0 0 0 2px var(--primary); }
@media (max-width: 760px) {
  .vs-painel-obra { font-size: 12.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

/* ===== VISTORIAS / DOCUMENTAÇÃO DA OBRA ===== */
.vs-obra-nome { font-size: 18px; }
.vs-iniciar { text-align: center; }
.vs-topo { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; margin: 6px 0 12px; }
.vs-topo-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; flex: 1 1 300px; }
.vs-score { display: inline-flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 16px; border: 2px solid var(--cor); border-radius: 14px; background: var(--surface); }
.vs-score b { font-size: 28px; line-height: 1; color: var(--cor); }
.vs-score small { font-size: 15px; color: var(--muted); }
.vs-score span { font-weight: 700; color: var(--cor); font-size: 13px; }
.vs-grupo { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.vs-grupo-tit { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 14.5px; }
.vs-chip { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 10px; background: #eef0f5; color: #555; }
.vs-chip.ok { background: #d9f3e4; color: #12703b; } .vs-chip.warn { background: #fff1cf; color: #a06a00; } .vs-chip.bad { background: #fde2e1; color: #b3261e; }
.vs-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.vs-item-nao { border-left: 4px solid var(--atrasada); }
.vs-item-parcial { border-left: 4px solid #e0a000; }
.vs-item-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.vs-item-nome { flex: 1 1 200px; font-size: 13.5px; }
.vs-sts { display: flex; gap: 4px; flex-wrap: wrap; }
.vs-st { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.vs-st.on.vs-st-ok { background: #1f8a4c; border-color: #1f8a4c; color: #fff; }
.vs-st.on.vs-st-parcial { background: #e0a000; border-color: #e0a000; color: #fff; }
.vs-st.on.vs-st-nao { background: var(--atrasada); border-color: var(--atrasada); color: #fff; }
.vs-st.on.vs-st-na { background: #767a8a; border-color: #767a8a; color: #fff; }
.vs-obs { margin-top: 8px; }
.vs-item-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.vs-emp { width: auto; max-width: 100%; flex: 1 1 200px; }
.vs-fotos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vs-foto { position: relative; }
.vs-foto img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #eef0f5; display: block; }
.vs-foto .btn-icon { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; min-width: 20px; min-height: 20px; padding: 0; background: #fff; border-radius: 50%; font-size: 12px; box-shadow: var(--shadow); }
.vs-presentes { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-presentes .btn-icon { width: 20px; height: 20px; min-width: 20px; min-height: 20px; padding: 0; }
.vs-extra-btn { margin-top: 16px; width: 100%; border-style: dashed; }
/* botão flutuante ⚠+ (item irregular a qualquer momento) e o painel que sobe por cima */
.vs-fab { position: fixed; right: 16px; bottom: 20px; z-index: 40; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--atrasada); color: #fff; font-size: 22px; line-height: 1; box-shadow: 0 6px 18px rgba(179,38,30,.4); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vs-fab small { font-size: 15px; font-weight: 800; margin-left: 1px; }
.vs-fab:active { transform: scale(.94); }
.vs-sheet-fundo { position: fixed; inset: 0; z-index: 44; background: rgba(20,22,40,.35); }
.vs-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-width: 620px; margin: 0 auto; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(20,22,40,.25); padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.vs-sheet-tit { display: flex; align-items: center; gap: 8px; }
.vs-sheet-tit .modal-x { margin-left: auto; }
.vs-sheet-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.vs-sheet-foto { display: flex; align-items: center; gap: 8px; }
.vs-sheet-acoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .vs-sheet-linha { grid-template-columns: 1fr; }
  .vs-sheet-acoes .btn { flex: 1 1 auto; }
}
.vs-fim { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.vs-padrao-linha { display: flex; gap: 8px; margin-bottom: 6px; }
.vs-padrao-linha .input { flex: 1; }
.vs-antigos { margin-top: 8px; }
.vs-rel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.vs-rel h2 { margin: 6px 0 2px; font-size: 18px; }
.vs-rel h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: #4a4d59; }
.vs-rel-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vs-rel-lista { margin: 4px 0; padding-left: 18px; }
.vs-rel-lista li { margin: 4px 0; font-size: 13px; }
.vs-rel-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.vs-rel-fotos figure { margin: 0; }
.vs-rel-fotos img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #eef0f5; }
.vs-rel-fotos figcaption { font-size: 11px; color: var(--muted); }
/* relatório no formato do Diário de Obra: chips coloridos, resultado e tabela de pavimentos */
.vs-rel h4 { margin: 14px 0 4px; font-size: 13px; }
.vs-rel-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 6px; }
.vs-rel-doc { font-size: 13px; color: #4a4d59; margin: 8px 0; }
.vs-rel-ok { color: #3f8f5f; font-weight: 600; font-size: 13px; }
.vs-conf { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #fff; background: #999; vertical-align: 1px; }
.vs-conf-ok { background: #3f8f5f; }
.vs-conf-warn { background: #dba634; color: #191919; }
.vs-conf-bad { background: #c9432a; }
.vs-rel-tab-wrap { overflow-x: auto; margin-top: 6px; }
.vs-rel-tab { border-collapse: collapse; font-size: 11.5px; min-width: 100%; }
.vs-rel-tab th, .vs-rel-tab td { border: 1px solid var(--border); padding: 5px 6px; text-align: center; }
.vs-rel-tab th { background: #e6e6e6; font-weight: 700; }
.vs-rel-tab th:first-child, .vs-rel-tab td:first-child { text-align: left; white-space: nowrap; }
.vs-rel-tab tbody tr:nth-child(even) { background: #f6f6f6; }
.vs-rel-tab td { font-weight: 700; }
.vs-sim-ok { color: #3f8f5f; } .vs-sim-warn { color: #b8860b; } .vs-sim-bad { color: #c9432a; } .vs-sim-pend { color: #999; }
.vs-rel-obs { margin-top: 8px; font-size: 13px; }
/* botão / passo a passo "Instalar app" (js/instalar.js) */
.login-instalar { margin-top: 10px; }
.instalar-passos ol { margin: 8px 0 12px; padding-left: 22px; }
.instalar-passos li { margin: 8px 0; line-height: 1.4; }
.instalar-ico { display: inline-block; padding: 0 5px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { flex: 0 0 auto; padding: 10px 11px; white-space: nowrap; }
  .vs-sts { width: 100%; }
  .vs-st { flex: 1; padding: 8px 4px; }
  .vs-score b { font-size: 24px; }
}

/* ===== GANTT DAS UNIDADES (aba Unidades → 📅 Gantt) ===== */
.gu-barra-ferr { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.gu-legenda { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin: 0 2px 8px; }
.gu-legenda span[class^="gu-e-"] { padding: 1px 8px; border-radius: 6px; color: #fff; }
.gu-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.gu { display: inline-block; min-width: 100%; }
.gu-linha { display: flex; align-items: stretch; border-bottom: 1px solid #eef0f5; }
.gu-linha:last-child { border-bottom: none; }
.gu-nome { flex: 0 0 170px; width: 170px; position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 5px 8px; font-size: 13px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gu-nome small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.gu-sub { padding-left: 18px; color: #4a4d59; }
.gu-grupo .gu-nome { font-weight: 700; background: #f6f7fb; }
.gu-grupo { background: #f6f7fb; }
.gu-cab .gu-nome { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; background: #f6f7fb; }
.gu-escala { position: relative; height: 36px; background: #f6f7fb; }
.gu-meses, .gu-dias { position: absolute; left: 0; right: 0; height: 18px; }
.gu-meses { top: 0; } .gu-dias { top: 18px; }
.gu-mes { position: absolute; top: 2px; font-size: 11px; font-weight: 700; color: #4a4d59; padding-left: 3px; border-left: 1px solid #d7d9e2; white-space: nowrap; }
.gu-dia { position: absolute; top: 1px; font-size: 10px; color: var(--muted); padding-left: 2px; border-left: 1px solid #e4e6ee; overflow: hidden; }
.gu-dia.gu-fds { background: #eef0f5; }
.gu-trilho { position: relative; height: 26px; flex: 0 0 auto; }
.gu-trilho-g { height: 30px; }
.gu-hoje { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--atrasada); opacity: .55; z-index: 1; pointer-events: none; }
.gu-resumo { position: absolute; top: 11px; height: 8px; border-radius: 4px; background: #9aa0b4; }
.gu-barra { position: absolute; top: 4px; height: 18px; border-radius: 5px; cursor: pointer; overflow: hidden; display: flex; align-items: center; box-sizing: border-box; }
.gu-barra:hover, .gu-barra.gu-sel { box-shadow: 0 0 0 2px #1c1e29; z-index: 3; }
.gu-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.35); }
.gu-rot { position: relative; font-size: 10.5px; font-weight: 700; color: #fff; padding: 0 4px; white-space: nowrap; }
.gu-fix { outline: 2px dashed rgba(0,0,0,.35); outline-offset: -2px; }
.gu-e-concluida { background: var(--concluida); }
.gu-e-andamento { background: var(--andamento); }
.gu-e-liberada { background: #e0a100; }
.gu-e-aguardando { background: #aeb3c2; }
.gu-e-atrasada { background: var(--atrasada); }
.gu-est { font-size: 11px; font-weight: 700; color: #fff; padding: 1px 8px; border-radius: 6px; }
.gu-lib { padding: 10px 12px; margin-bottom: 10px; border-left: 4px solid #e0a100; }
.gu-lib-tit { font-weight: 700; margin-bottom: 6px; }
.gu-lib-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; font-size: 13px; }
.gu-lib-uns { display: flex; flex-wrap: wrap; gap: 4px; }
.gu-chip { background: #fff4d6; color: #7a5600; border: 1px solid #f1d27a; border-radius: 12px; padding: 1px 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.gu-editor { padding: 10px 12px; margin-bottom: 10px; border-left: 4px solid var(--primary); }
.gu-ed-tit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.gu-ed-tit .btn-icon { margin-left: auto; }
.gu-ed-campos { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.gu-ed-campos .dm-campo { flex: 0 0 160px; }
.gu-plan { padding: 12px 14px; margin: 10px 0; }
/* Planejamento recolhível (<details>): fechado, a linha resume duração · equipes · predecessoras · tarefa */
.gu-plan > summary { margin-bottom: 0; cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-right: 22px; position: relative; }
.gu-plan > summary::-webkit-details-marker { display: none; }
.gu-plan > summary::after { content: '▾'; position: absolute; right: 0; top: 0; color: var(--muted); }
.gu-plan[open] > summary::after { content: '▴'; }
.gu-plan[open] > summary { margin-bottom: 12px; }
.gu-plan-resumo { font-size: 12.5px; color: var(--muted); }
.gu-dep input { width: auto; margin: 0; }
.gu-plan-campos { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
.gu-plan-campos small { font-weight: 400; }
.gu-deps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gu-dep { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 16px; font-size: 13px; cursor: pointer; background: var(--surface); }
.gu-dep.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.gu-dep.off { opacity: .45; cursor: not-allowed; }
.un-cell.un-lib { box-shadow: inset 0 0 0 2px #e0a100; }
.un-lib-leg { display: inline-block; padding: 0 6px; border-radius: 4px; box-shadow: inset 0 0 0 2px #e0a100; font-weight: 700; }
.date-calc { font-size: 13px; white-space: nowrap; }
@media (max-width: 760px) {
  .gu-nome { flex-basis: 108px; width: 108px; font-size: 12px; padding: 4px 6px; }
  .gu-sub { padding-left: 10px; }
  .gu-plan-campos { grid-template-columns: 1fr 1fr; }
  .gu-plan-tarefa { grid-column: 1 / -1; }
  .gu-ed-campos .dm-campo { flex: 1 1 130px; }
}

/* ===== DIÁRIO DE OBRA (aba da obra) ===== */
.dio-topo { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-bottom: 10px; }
.dio-obra { display: flex; flex-direction: column; gap: 3px; flex: 1 1 240px; max-width: 360px; }
.dio-obra > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.dio-obra-nav { display: flex; gap: 6px; }
.dio-feitas { flex: 1 1 100%; }
.dio-semana { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.dio-sem-rot { display: flex; flex-direction: column; align-items: center; min-width: 150px; }
.dio-sem-rot small { font-size: 11.5px; color: var(--muted); }
.dio-sem-data { width: auto; max-width: 160px; }
.dio-dias { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.dio-dia { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dio-dia.dio-hoje { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.dio-dia-tit { display: flex; align-items: baseline; gap: 6px; }
.dio-salvo { margin-left: auto; font-size: 11.5px; color: #1f8a4c; opacity: 0; transition: opacity .3s; }
.dio-salvo.on { opacity: 1; }
.dio-clima { display: flex; gap: 6px; }
.dio-cl { flex: 1; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 4px; font-size: 13px; cursor: pointer; }
.dio-cl.on { background: #fff4d6; border-color: #e0a100; font-weight: 700; }
.dio-cl-chuva.on { background: #e3eeff; border-color: var(--andamento); }
.dio-campo { display: flex; flex-direction: column; gap: 3px; }
.dio-campo > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.dio-campo textarea { resize: vertical; min-height: 118px; font-size: 14px; line-height: 1.45; overflow: hidden; }
.dio-copiar { align-self: flex-start; border: none; background: none; color: var(--primary); font-size: 12px; cursor: pointer; padding: 0; }
.dio-fotos-card { margin-top: 12px; padding: 12px; }
.dio-fotos-tit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.dio-fotos-tit label { margin-left: auto; }
.dio-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.dio-foto { position: relative; width: 110px; height: 110px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #eef0f5; }
.dio-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dio-foto .btn-icon { position: absolute; top: 3px; right: 3px; background: rgba(255,255,255,.9); border-radius: 50%; }
@media (max-width: 760px) {
  .dio-obra { max-width: none; flex-basis: 100%; }
  .dio-obra-nav { flex: 1; } .dio-obra-nav .btn-primary { flex: 1; }
  .dio-dias { grid-template-columns: 1fr; }
  .dio-sem-data { max-width: 140px; }
  .dio-foto { width: calc(33.3% - 6px); height: auto; aspect-ratio: 1; }
}

/* ===== DEMANDAS: modelos e fotos no checklist (2026-10-05) ===== */
.dm-modelo-linha { display: flex; gap: 6px; align-items: center; }
.dm-modelo-linha select { flex: 1; }
.dm-ck-cam { cursor: pointer; font-size: 15px; }
.dm-ck-fotos { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px 30px; }
.dm-ck-foto { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #eef0f5; }
.dm-ck-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-ck-foto-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(255,255,255,.9); font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.dm-ck-modelo { margin-top: 8px; }

/* ===== BUSCA GERAL (🔍 no topo, atalho Ctrl+K ou /) ===== */
.busca-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.busca-btn kbd { font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; color: var(--muted); background: #f6f7fb; }
.busca-modal { align-items: flex-start; }
.busca-caixa { width: min(640px, calc(100vw - 24px)); margin: 8vh auto 0; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(20,22,40,.25); overflow: hidden; display: flex; flex-direction: column; max-height: 80vh; }
.busca-caixa input { border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 18px; font-size: 17px; outline: none; }
.busca-res { overflow-y: auto; padding: 6px 0 10px; }
.busca-grupo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 18px 4px; }
.busca-item { display: flex; align-items: baseline; gap: 8px; padding: 9px 18px; cursor: pointer; }
.busca-item:hover, .busca-item.ativo { background: var(--primary-soft); }
.busca-item b { font-weight: 600; }
.busca-item small { color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.busca-vazio { padding: 18px; color: var(--muted); }

/* ===== SEM SINAL: indicador no topo ===== */
.sync-status { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; cursor: pointer; }
.sync-status.off { background: #fdecea; color: #b42318; }
.sync-status.envia { background: #fff4d6; color: #8a5a00; }
.offline-aviso { background: #fff4d6; color: #8a5a00; text-align: center; font-size: 13px; padding: 6px 12px; }
@media (max-width: 760px) {
  .busca-btn kbd, .busca-btn .so-pc { display: none; }
  .busca-caixa { margin-top: 0; width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .dm-ck-fotos { margin-left: 0; }
}
.busca-topo { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.busca-topo input { flex: 1; border-bottom: none !important; }
.busca-fechar { border: none; background: none; color: var(--primary); font-weight: 600; font-size: 14px; padding: 0 16px; cursor: pointer; align-self: stretch; }

/* ===== PRESTAÇÃO DE CONTAS (aba da obra) ===== */
.pc-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.pc-barra label.btn { cursor: pointer; }
.pc-mes-sel { width: auto; min-width: 120px; font-weight: 600; cursor: pointer; }
.pc-linear { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pc-envio { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.pc-envio label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.pc-linear input[type=number] { width: 80px; }
.pc-linear input[type=month] { width: 170px; max-width: 100%; }
.pc-meses { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pc-resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pc-resumo .stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pc-resumo .stat span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.pc-resumo .stat b { font-size: 20px; }
.pc-resumo .stat small { color: var(--muted); font-size: 12px; }
.pc-tab .ct-num, .pc-tab th.ct-num { text-align: right; white-space: nowrap; }
.pc-tab input.ct-num { text-align: right; width: 130px; }
.pc-tab input.pc-pct { width: 74px; }
.pc-tab td small { display: block; }
.pc-estouro { color: #c0392b; font-size: 11px; }
.pc-site { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pc-fav { margin-top: 12px; background: #f6f7fb; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.pc-fav summary { cursor: pointer; font-weight: 600; }
.pc-fav ol { margin: 8px 0 4px 18px; padding: 0; }
.pc-fav li { margin: 4px 0; }
.pc-fav-link { cursor: grab; }
.pc-conf-tit { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.pc-mes-campo { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; color: var(--muted); gap: 3px; }
.pc-conf-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; }
.pc-conf-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pc-fora td { opacity: .55; }
.pc-sem td:first-child b { color: var(--muted); }
.pc-alerta { color: #8a5a00; font-size: 11px; font-weight: 600; }
.pc-alerta-box { background: #fff4d6; color: #8a5a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 10px; }
.pc-cats input { min-width: 0; width: 100%; }
@media (max-width: 1100px) { .pc-conf-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .pc-resumo { grid-template-columns: 1fr; }
  .pc-tab tr[data-row] { grid-template-columns: 1fr 1fr; }
  .pc-tab .c-title { grid-column: 1 / -1; }
  .pc-tab .ct-num { text-align: left; }
  .pc-tab input.ct-num, .pc-tab input.pc-pct { width: 100%; text-align: left; }
}
.pc-campo { display: inline-flex; align-items: center; gap: 4px; }
.pc-aj-on { background: #fff8db !important; border-color: #e0a100 !important; }
.pc-reset { border: none; background: none; color: #8a5a00; font-size: 15px; cursor: pointer; padding: 0 2px; }
.pc-aj-marca { color: #8a5a00; font-size: 11px; }
.pc-conf-uma { grid-template-columns: 1fr; }
/* prestação: arrastando um PDF para a página */
#board-prestacao.pc-arrastando { position: relative; }
#board-prestacao.pc-arrastando::after { content: '📄 Solte o PDF do financeiro aqui'; position: absolute; inset: -6px; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; border: 3px dashed var(--primary); border-radius: 14px; background: rgba(99, 102, 241, .10); color: var(--primary); font-weight: 700; font-size: 18px; pointer-events: none; }
/* copiar etapas de outra obra */
.ce-acoes { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; }
.ce-acoes .muted-sm { margin-right: auto; }
.ce-lista { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.ce-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; flex-wrap: wrap; }
.ce-item:last-child { border-bottom: 0; }
.ce-nome { font-weight: 600; flex: 1; min-width: 140px; }
.ce-ja { color: var(--atrasada, #c0392b); font-weight: 600; }
.ce-opcoes { margin-top: 12px; display: grid; gap: 8px; }
.ce-op { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.ce-inicio { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 26px; }
.ce-inicio input { width: auto; }
.ce-item input[type=checkbox], .ce-op input[type=checkbox] { width: auto; flex: 0 0 auto; margin: 0; min-height: 0; }
.ce-op { justify-content: flex-start; text-align: left; }
.ce-lista { overflow-x: hidden; }
/* segurança: arrastando arquivos para a página */
#seguranca-conteudo.seg-arrastando { position: relative; }
#seguranca-conteudo.seg-arrastando::after { content: '📎 Solte os arquivos aqui'; position: absolute; inset: -6px; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; border: 3px dashed var(--primary); border-radius: 14px; background: rgba(99, 102, 241, .10); color: var(--primary); font-weight: 700; font-size: 18px; pointer-events: none; }
/* contrato para assinatura (js/contrato-doc.js) */
.cd-sec { margin-top: 14px; padding: 12px 14px; }
.cd-sec > summary { cursor: pointer; list-style: none; }
.cd-sec > summary::-webkit-details-marker { display: none; }
.cd-sec > summary::before { content: '▸ '; color: var(--muted); }
.cd-sec[open] > summary::before { content: '▾ '; }
.cd-sec[open] > summary { margin-bottom: 10px; }
.cd-aviso-txt { color: var(--atrasada, #c0392b); font-weight: 600; }
.cd-avisos { margin: 0 0 10px; padding: 8px 10px 8px 26px; background: #fff7e6; border: 1px solid #f3d38a; border-radius: 10px; font-size: 13px; }
.cd-avisos li { margin: 2px 0; }
.cd-objeto { margin: -4px 0 12px; padding: 6px 10px; max-height: 180px; overflow: auto; background: #fafbfd; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.cd-anexo { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 12px; font-size: 13px; }
.cd-editado { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.cd-objeto ul { margin: 0; padding-left: 18px; }
.cd-objeto ul ul { color: var(--muted); font-size: 12px; }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 12px; }
.cd-grid .cd-larga { grid-column: span 2; }
.cd-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.cd-dados { margin: 6px 0 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.cd-dados > summary { cursor: pointer; }
.cd-dados[open] > summary { margin-bottom: 8px; }
.cd-rep-tit { font-weight: 600; font-size: 13px; margin: 4px 0 2px; }
#modal-ct-modelos .modal { max-width: 860px; }
.ctm-lista { display: grid; gap: 8px; }
.ctm-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ctm-acoes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ctm-cl { border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.ctm-cl-top { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ctm-cl-top input { font-weight: 700; }
.ctm-cl textarea { width: 100%; font-size: 13px; line-height: 1.45; }
.ctm-ajuda { margin: 4px 0 10px; }
.ctm-marcas { display: flex; flex-wrap: wrap; gap: 6px; }
.ctm-marcas span { font-family: monospace; font-size: 12px; background: var(--bg-soft, #f2f3f7); border-radius: 6px; padding: 2px 6px; cursor: help; }
@media (max-width: 760px) { .cd-grid { grid-template-columns: 1fr 1fr; } .cd-grid .cd-larga { grid-column: 1 / -1; } }
/* demandas: mais de um demandado */
.dm-mais { display: inline-block; font-size: 11px; font-weight: 700; background: var(--primary-soft, #ecebfd); color: var(--primary); border-radius: 10px; padding: 0 6px; margin-left: 2px; }
.dm-outros { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dm-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft, #ecebfd); border-radius: 14px; padding: 3px 8px; font-weight: 600; font-size: 13px; }
.dm-chip-x { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 0 2px; }
.dm-outro-add { width: auto; min-width: 130px; }
.dm-outros-campo > summary { cursor: pointer; margin-bottom: 6px; }
.dm-outros-lista { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.dm-outro-op { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 14px; }
.dm-outro-op input { width: auto; margin: 0; }
/* quantitativos (js/quantitativos.js) */
.qt-barra { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.qt-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.qt-tab .qt-cod { font-weight: 700; }
.qt-matriz-wrap { overflow: auto; max-height: 72vh; width: fit-content; max-width: 100%; }
.qt-matriz { border-collapse: separate; border-spacing: 0; width: auto; }
.qt-matriz th, .qt-matriz td { padding: 4px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.qt-matriz thead th { position: sticky; top: 0; background: var(--card, #fff); z-index: 2; vertical-align: bottom; }
.qt-matriz .qt-un { position: sticky; left: 0; background: var(--card, #fff); z-index: 1; min-width: 120px; font-weight: 600; }
.qt-matriz thead .qt-un { z-index: 3; }
.qt-matriz .qt-un label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.qt-matriz .qt-un input { width: auto; margin: 0; }
.qt-matriz th.qt-cel { text-align: center; min-width: 64px; max-width: 120px; }
.qt-matriz th.qt-cel small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 110px; margin: 2px auto 0; text-transform: none; }
.qt-matriz td.qt-cel { text-align: center; }
.qt-matriz td.qt-cel input { width: 58px; text-align: center; padding: 4px; }
.qt-matriz tfoot td { background: var(--bg-soft, #f5f6fa); font-size: 13px; text-align: center; border-top: 2px solid var(--border); border-bottom: 0; }
.qt-matriz tfoot td.qt-un { text-align: left; background: var(--bg-soft, #f5f6fa); }
.qt-matriz td.qt-soma, .qt-matriz th:last-child, .qt-matriz tfoot td:last-child { padding-left: 14px; padding-right: 12px; }
.qt-matriz .qt-grp td { background: var(--bg-soft, #f5f6fa); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: static; }
.qt-matriz tr.qt-marcada td { background: #eef0ff; }
.qt-matriz .qt-soma { color: var(--muted); font-size: 13px; }
.qt-lote { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--primary); }
.qt-lote select { width: auto; min-width: 140px; }
.qt-res-cat { font-weight: 700; font-size: 15px; margin: 16px 2px 6px; }
.qt-res-cat:first-of-type { margin-top: 0; }
/* padrão de decomposição com grupos (2 níveis) */
.pd-linha .pd-grupo { max-width: 150px; }
.pd-botoes { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-colar { margin-top: 10px; display: grid; gap: 8px; justify-items: start; }
.pd-colar textarea { width: 100%; font-family: monospace; font-size: 12px; }
.ct-decompor-leve { opacity: .65; }
.ct-decompor-leve:hover { opacity: 1; }
/* quantitativos: componentes por tipo */
.qt-comp-row td { padding-top: 0 !important; border-top: 0; }
.qt-comps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; padding: 0 0 6px; }
.qt-comp { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-soft, #f2f3f7); border-radius: 12px; padding: 2px 8px; }
.qt-comp-novo { display: inline-flex; gap: 4px; align-items: center; }
.qt-comp-novo input { width: 170px; }
.qt-comp-novo .qt-comp-qtd { width: 54px; }
/* aba Valores (js/valores.js) */
.vl-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.vl-barra label.btn { cursor: pointer; }
.vl-conf { padding: 14px; }
.vl-conf-tit { margin-bottom: 10px; }
.vl-conf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.vl-conf-grid .vl-larga { grid-column: span 2; }
.vl-conf-tab td { vertical-align: middle; }
.vl-conf-tab input.input-sm, .vl-conf-tab select.input-sm { min-width: 0; }
.vl-conf-tab td:first-child input { min-width: 220px; }
.vl-item-cel { display: flex; gap: 6px; align-items: center; }
.vl-item-cel input { min-width: 180px; }
.vl-un { width: 76px; min-width: 76px; }
.vl-num { width: 96px; text-align: right; }
.vl-selo { font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; white-space: nowrap; }
.vl-ok { background: #e3f6ea; color: #1f8a4c; }
.vl-sug { background: #fff4d6; color: #a06a00; }
.vl-novo { background: #eef0ff; color: var(--primary); }
.vl-conf-rodape { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 10px 0; font-size: 14px; }
.vl-ratear { display: inline-flex; gap: 6px; align-items: center; background: #fff7e6; border: 1px solid #f3d38a; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.vl-ratear input { width: auto; margin: 0; }
.vl-ok-txt { color: #1f8a4c; font-weight: 600; }
.vl-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.vl-tipo { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 2px 8px; background: var(--bg-soft, #f2f3f7); }
.vl-tipo-nota { background: #e3f6ea; color: #1f8a4c; }
.vl-tipo-orcamento { background: #fff4d6; color: #a06a00; }
.vl-tipo-manual { background: #eef0ff; color: var(--primary); }
.vl-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.vl-filtros input[data-vl-busca] { flex: 1; min-width: 220px; }
.vl-filtros select { width: auto; }
.vl-apelidos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
#valores-conteudo.vl-arrastando { position: relative; }
#valores-conteudo.vl-arrastando::after { content: '📄 Solte os PDFs de orçamento / nota aqui'; position: absolute; inset: -6px; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; border: 3px dashed var(--primary); border-radius: 14px; background: rgba(99, 102, 241, .10); color: var(--primary); font-weight: 700; font-size: 18px; pointer-events: none; }
@media (max-width: 760px) { .vl-conf-grid { grid-template-columns: 1fr 1fr; } .vl-conf-grid .vl-larga { grid-column: 1 / -1; } .vl-conf-tab td:first-child input, .vl-item-cel input { min-width: 0; width: 100%; } .vl-num { width: 100%; } }
.vl-conv { display: block; font-size: 11px; color: #a06a00; margin-top: 2px; }
.vl-ultimo { font-size: 17px; font-weight: 800; color: var(--text); white-space: nowrap; }

/* Kanban no celular: observação com 16px (o iPhone dá zoom em campos menores) */
@media (max-width: 760px) { .kb-obs { font-size: 16px; height: 48px; line-height: 1.3; } .kb-pct input { font-size: 16px; width: 44px; } }

/* ===== VICTOOLS (ferramentas em HTML) ===== */
.vt-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vt-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, transform .12s; }
.vt-card:hover, .vt-card:focus-visible { border-color: var(--primary); transform: translateY(-1px); outline: none; }
.vt-ico { flex: 0 0 48px; height: 48px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--primary-soft); border-radius: 12px; }
.vt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vt-txt b { font-size: 15px; }
.vt-txt span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vt-aviso { margin-bottom: 12px; padding: 12px 14px; }
.vt-aviso-off { margin: 0 0 10px; }
.vt-dica { margin-top: 12px; }
.vt-editor { margin-bottom: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.vt-editor h3 { margin: 0 0 6px; font-size: 16px; }
.vt-ed-grid { display: flex; gap: 12px; }
.vt-ed-ico { flex: 0 0 90px; }
.vt-ed-ico .input { text-align: center; font-size: 20px; }
.vt-ed-nome { flex: 1; }
.vt-ed-arq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vt-ed-acoes { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.vt-barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.vt-titulo { font-size: 16px; }
.vt-palco { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.vt-carregando { padding: 20px; margin: 0; }
.vt-frame { display: block; width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 0; background: #fff; }
#view-victools.vt-cheia { position: fixed; inset: 0; z-index: 50; background: var(--bg); padding: 10px 14px; overflow: auto; }
#view-victools.vt-cheia .vt-frame { height: calc(100vh - 70px); min-height: 0; }
#view-victools.vt-arrastando { outline: 3px dashed var(--primary); outline-offset: 6px; border-radius: 12px; }
html:has(#view-victools.vt-cheia.active) { overflow: hidden; }
@media (max-width: 760px) {
  .vt-grade { grid-template-columns: 1fr; }
  .vt-frame { height: calc(100vh - 170px); min-height: 380px; }
  .vt-palco { margin: 0 -12px; border-radius: 0; border-left: none; border-right: none; }
}

/* ===== Relatório mensal do empreiteiro (Segurança → ficha do empreiteiro) ===== */
.re-painel { margin: 10px 0 14px; padding: 14px 16px; border-left: 4px solid #f2622e; display: flex; flex-direction: column; gap: 12px; }
.re-topo { display: flex; align-items: center; justify-content: space-between; font-size: 15px; }
.re-grade { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.re-mes { flex: 0 0 200px; margin: 0; }
.re-incluir { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.re-rot { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.re-sub { margin-left: 24px; }
.re-obras .seg-chip small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.re-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
@media (max-width: 760px) { .re-mes { flex: 1 1 100%; } }

/* ===== Físico-financeiro previsto (Prestação de contas → 📈) ===== */
.ff { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.ff-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ff-topo h3 { margin: 0 0 4px; font-size: 17px; }
.ff-topo p { margin: 0; max-width: 760px; }
.ff-cards { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.ff-stat-pico b { color: #c9432a; }
.ff-graf-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 4px 2px; }
.ff-graf { display: block; }
.ff-leg { display: flex; flex-wrap: wrap; gap: 14px; }
.ff-leg span { display: inline-flex; align-items: center; gap: 6px; }
.ff-leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.ff-leg i.ff-l { width: 18px; height: 0; border-top: 2px solid; border-radius: 0; }
.ff-leg i.ff-tr { border-top-style: dashed; }
.ff-tab th, .ff-tab td { white-space: nowrap; font-size: 12.5px; }
.ff-tab .ct-num { text-align: right; }
.ff-tab th:first-child, .ff-tab td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 220px; max-width: 280px; white-space: normal; box-shadow: 1px 0 0 var(--border); }
.ff-tab thead th:first-child { background: #fafbfd; z-index: 2; }
.ff-cat small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.ff-tab tfoot td { font-weight: 700; background: #f7f8fb; }
.ff-tab tfoot td:first-child { background: #f7f8fb; }
.ff-tab tr.ff-sub td { font-weight: 500; color: var(--muted); }
.ff-tab tr.ff-real td { color: #1f8a4c; }
.ff-tab .ff-pico { background: #fdecea !important; color: #b3261e; }
.ff-sem { padding: 12px 14px; font-size: 13px; }
.ff-sem ul { margin: 6px 0 0; padding-left: 20px; }
@media (max-width: 760px) { .ff-cards { grid-template-columns: 1fr 1fr; } .ff-tab th:first-child, .ff-tab td:first-child { min-width: 150px; } }
/* tabela do físico-financeiro: rola para os lados e para baixo dentro do cartão (a barra lateral fica sempre à vista);
   cabeçalho dos meses e coluna das categorias ficam fixos */
.card.no-pad.ff-tab-wrap { overflow: auto; max-height: 72vh; }
.ff-tab { width: max-content; min-width: 100%; }
.ff-tab th, .ff-tab td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ff-tab thead th { position: sticky; top: 0; z-index: 2; background: #fafbfd; font-size: 11.5px; text-transform: uppercase; color: var(--muted); }
.ff-tab thead th:first-child { z-index: 3; }
@media (max-width: 760px) { .card.no-pad.ff-tab-wrap { max-height: 65vh; } .ff-tab th, .ff-tab td { font-size: 12px; } }
/* barras de duração atrás dos valores (Mostrar barras) — arrastar move/estica a etapa */
.ff-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ff-barras-ck { font-size: 13px; font-weight: 600; }
.ff-dica { margin: -4px 0 0; }
.ff-tab.ff-barras td.ff-on { --cor: rgba(91,70,229,.22); background-image: linear-gradient(90deg, transparent var(--a), var(--cor) var(--a), var(--cor) var(--b), transparent var(--b)); background-size: 100% 26px; background-position: center; background-repeat: no-repeat; }
.ff-tab.ff-barras td.ff-linear { --cor: rgba(242,98,46,.22); }
.ff-tab.ff-barras td.ff-fixo { --cor: rgba(120,124,140,.20); }
.ff-barras td.ff-arr { cursor: grab; touch-action: none; user-select: none; }
.ff-barras td.ff-alvo { outline: 2px dashed #5b46e5; outline-offset: -4px; background-color: rgba(91,70,229,.06); }
body.ff-arrastando, body.ff-arrastando * { cursor: grabbing !important; user-select: none; }
#ff-tip { position: fixed; z-index: 200; background: var(--text); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; }
/* linhas por atividade (abaixo da categoria) — barra mais forte; a da categoria fica clara (conjunto) */
.ff-tab.ff-barras tr.ff-grupo td.ff-on { --cor: rgba(91,70,229,.10); }
.ff-tab.ff-barras tr.ff-ativ td { padding-top: 3px; padding-bottom: 3px; height: 26px; border-bottom-color: #f1f2f6; }
.ff-tab.ff-barras tr.ff-ativ td.ff-on { --cor: rgba(91,70,229,.42); background-size: 100% 16px; }
.ff-tab.ff-barras tr.ff-ativ td.ff-fixo { --cor: rgba(120,124,140,.32); }
.ff-tab tr.ff-ativ td.ff-cat { padding-left: 30px; font-size: 12px; }
.ff-ativ-nome { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-tab tr.ff-ativ td.ff-cat small { font-size: 10.5px; }
.ff-tg { border: 0; background: none; padding: 0 4px 0 0; font-size: 12px; color: var(--muted); cursor: pointer; }
/* ⛶ tela cheia do físico-financeiro: ocupa a janela (abaixo das janelas/detalhes, z 50); tabela mais alta */
.ff.ff-cheia { position: fixed; inset: 0; z-index: 50; margin: 0; background: var(--bg); padding: 12px 16px; overflow: auto; }
.ff.ff-cheia > * { flex-shrink: 0; }
.ff.ff-cheia .card.no-pad.ff-tab-wrap { max-height: calc(100vh - 90px); }
html:has(#view-board.active #board-prestacao:not([style*="none"]) .ff.ff-cheia) { overflow: hidden; }   /* só com a aba à vista */
/* Segurança: filtro de situação dos funcionários na tela da empresa */
.seg-func-tit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-func-tit select { margin-left: auto; font-weight: 400; }
/* demanda com novidade desde a última vez que abri (2026-10-19) */
.dm-card-novidade { border-left-color: var(--primary); background: var(--primary-soft); }
.dm-novidade { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--primary); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
/* login: aviso de "enviamos o link" (2026-10-20) */
.login-aviso { color: var(--text); background: var(--primary-soft); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; font-size: 13.5px; }
/* ---- Planta 3D na vista da unidade (2026-10-21) ---- */
.p3u-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.p3u-sel { width: auto; min-width: 220px; }
.p3u { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.p3u-vista { min-width: 0; }
.p3u-no { position: relative; height: 560px; border-radius: 12px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #f7f4ef 0%, #e6e1d8 100%); border: 1px solid var(--border); }
.p3u-no.p3u-cheia { position: fixed; inset: 0; height: auto; z-index: 90; border-radius: 0; }
.p3u-canvas { position: absolute; inset: 0; }
.p3u-btns { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 5; pointer-events: none; }
.p3u-btns .btn { pointer-events: auto; background: rgba(255,255,255,.92); }
.p3u-carregando { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.p3u-lado { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; max-height: 560px; overflow: auto; }
.p3u-lado h5 { margin: 4px 0 4px; font-size: 13.5px; }
.p3u-lado p { margin: 0 0 6px; }
.p3u-tab { width: 100%; font-size: 12.5px; margin-bottom: 10px; }
.p3u-tab td, .p3u-tab th { padding: 4px 4px; }
.p3u-tab tr[data-p3u-row]:hover { background: var(--primary-soft); }
.p3u-num { width: 58px; }
.p3u-obs { font-size: 11px; }
.p3d { position: absolute; inset: 0; overflow: hidden; }
.p3d canvas { display: block; touch-action: none; }
.p3d-dica { position: absolute; z-index: 6; pointer-events: none; background: #22252b; color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 260px; }
@media (max-width: 900px) {
  .p3u { grid-template-columns: 1fr; }
  .p3u-no { height: 62vh; }
  .p3u-lado { max-height: none; }
}
.p3u-piso { width: 100%; margin-top: 3px; }
#modal-p3u-parede { z-index: 120; }   /* acima da planta 3D em tela cheia */
.p3u-atual { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.p3u-amostra { width: 38px; height: 38px; border-radius: 8px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.p3u-pisolinha { display: flex; gap: 6px; align-items: center; }
.p3u-pisolinha .p3u-piso { flex: 1; min-width: 0; }
.p3u-med { width: 78px; flex: none; text-align: center; }
.p3u-medfixa { display: inline-block; font-size: 12px; color: var(--muted); padding: 4px 0; }
.p3u-medlbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
/* quantitativos ligados às plantas 3D (2026-10-21) */
.qt-subtot td { background: var(--bg); font-weight: 600; }
.qt-perda { width: 52px; display: inline-block; margin: 0 2px; }
.qt-aviso { padding: 8px 12px; margin: 6px 0; }
.p3u-qsel { width: 100%; margin-top: 3px; font-size: 12px; }
/* serviços da UNIDADE no celular (2026-10-21): cartão compacto —
   linha 1: nome · status · 📎 · ×   |   linha 2: barra + %   |   linha 3: especificação discreta */
@media (max-width: 760px) {
  .un-det tr.un-u-linha { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "nome st anx x" "pct pct pct pct" "esp esp esp esp"; gap: 6px 8px; padding: 10px 12px; margin-bottom: 8px; }
  .un-det tr.un-u-linha .un-d-nome { grid-area: nome; align-self: center; font-size: 15px; font-weight: 700; padding-right: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .un-det tr.un-u-linha .un-d-st { grid-area: st; align-self: center; }
  .un-det tr.un-u-linha .un-d-anx { grid-area: anx; width: auto; align-self: center; }
  .un-det tr.un-u-linha .un-d-anx .btn { padding: 2px 8px; min-height: 30px; }
  .un-det tr.un-u-linha .un-d-x { grid-area: x; width: auto; align-self: center; }
  .un-det tr.un-u-linha .un-d-pct { grid-area: pct; min-width: 0; }
  .un-det tr.un-u-linha .un-d-pct .pct-input { width: 64px; }
  .un-det tr.un-u-linha .un-d-esp { grid-area: esp; }
  .un-det tr.un-u-linha .un-esp { font-size: 13px; padding: 4px 8px; background: var(--bg); border-color: transparent; }
  .un-det tr.un-u-linha .un-st { font-size: 11px; padding: 2px 7px; }
}

/* ===== ATIVIDADE (log do que a equipe mexeu — só admin) ===== */
.at-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.at-filtros select { width: auto; max-width: 220px; }
.at-lista { padding: 4px 0; }
.at-dia { padding: 10px 16px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.at-linha { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 8px 16px; border-top: 1px solid var(--border, #eceef2); }
.at-dia + .at-linha { border-top: 0; }
.at-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: #eef0f4; }
.at-cri { background: #e6f6ec; color: #1d7a3e; }
.at-alt { background: #eef0ff; color: #4b46c8; }
.at-exc { background: #fdecec; color: #b42323; }
.at-tipo { color: var(--muted, #6b7280); }
.at-campos { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 12.5px; color: #4b5563; }
.at-campo { overflow-wrap: anywhere; }
.at-hora { white-space: nowrap; padding-top: 3px; }
@media (max-width: 640px) {
  .at-filtros select { max-width: none; flex: 1 1 45%; }
  .at-linha { grid-template-columns: 26px 1fr; }
  .at-hora { grid-column: 2; padding-top: 0; }
}

/* ---- Unidades → 🧩 Plantas 3D (js/plantas-tipo.js) ---- */
.pt-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.pt-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pt-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pt-prev { height: 190px; background: #f4f2ee; cursor: pointer; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.pt-svg { width: 100%; height: 100%; padding: 8px; box-sizing: border-box; }
.pt-com { fill: #fff; stroke: #d9d4cc; stroke-width: 2; }
.pt-ext { fill: #e6efe8; stroke: #c9dccd; stroke-width: 2; }
.pt-par { fill: #3a3d48; }
.pt-gua { fill: #9fc3d6; }
.pt-ab { fill: #c98a4a; }
.pt-ab.porta-vidro { fill: #6fb3d9; }
.pt-ab.janela { fill: #2f6df6; }
.pt-ab.vao { fill: #f4f2ee; }
.pt-vazio { padding: 20px; }
.pt-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.pt-nome { font-weight: 700; font-size: 15px; }
.pt-uns { display: flex; flex-wrap: wrap; gap: 4px; }
.pt-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.pt-modal3d { width: min(1100px, 96vw); max-width: none; }
.pt-3d { position: relative; height: min(70vh, 640px); }
.pt-unlista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; }
.pt-unitem { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; }

/* ---- Editor de planta 3D (js/planta3d-editor.js) ---- */
.p3e { position: fixed; inset: 0; z-index: 110; background: var(--bg); display: flex; flex-direction: column; }
.p3e-topo { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.p3e-tit { margin-right: 6px; }
.p3e-nome { width: 240px; }
.p3e-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.p3e-op { display: inline-flex; align-items: center; gap: 4px; }
.p3e-op input { width: 80px; }
.p3e-corpo { flex: 1; display: flex; min-height: 0; }
.p3e-ferr { width: 84px; overflow-x: hidden; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; overflow-y: auto; }
.p3e-f { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--text); }
.p3e-f span { font-size: 18px; line-height: 1.1; }
.p3e-f small { font-size: 10px; color: var(--muted); }
.p3e-f:hover { background: var(--bg); }
.p3e-f.on { background: var(--primary-soft); border-color: var(--primary); }
.p3e-param { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.p3e-param input { width: 100%; }
select.p3e-param { width: 100%; font-size: 11px; }
.p3e-area { flex: 1; position: relative; min-width: 0; background: #fbfbfd; }
.p3e-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.p3e-lado { width: 300px; background: var(--surface); border-left: 1px solid var(--border); padding: 10px 14px; overflow-y: auto; font-size: 13px; }
.p3e-lado h4 { margin: 12px 0 6px; font-size: 14px; }
.p3e-lado h4:first-child { margin-top: 0; }
.p3e-lado h5 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.p3e-campo { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.p3e-campo input, .p3e-campo select { width: 100%; }
.p3e-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.p3e-chk { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; margin: 4px 0; }
.p3e-passos { padding-left: 18px; margin: 0; font-size: 12px; line-height: 1.6; }
.p3e-avisos { padding-left: 18px; margin: 0; font-size: 12px; color: var(--atrasada); }
.p3e-lista { display: flex; flex-direction: column; gap: 2px; }
.p3e-lista a { cursor: pointer; color: var(--primary); }
.p3e-ret { display: flex; justify-content: space-between; align-items: center; }
.p3e-ret.on a { font-weight: 700; }
.p3e-cont { margin-top: 2px; }
.p3e-status { display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px; font-size: 12px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); }
.p3e-3d { position: absolute; right: 10px; top: 10px; width: min(560px, 60%); height: min(460px, 75%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.p3e-3d[hidden] { display: none; }
.p3e-3d-cab { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.p3e-3d-cab b { flex: 1; }
.p3e-3d-tela { flex: 1; position: relative; min-height: 0; }
.p3e-3d-alvo { position: absolute; inset: 0; }
.p3e-grade { stroke: #e3e5ee; stroke-width: 1; vector-effect: non-scaling-stroke; }
.p3e-orig { stroke: #e0413e; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.p3e-par { fill: #3a3d48; }
.p3e-gua { fill: #9fc3d6; stroke: #4f86a3; stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.p3e-com { fill: rgba(91, 70, 229, 0.07); stroke: rgba(91, 70, 229, 0.35); stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.p3e-com.ext { fill: rgba(24, 165, 88, 0.08); stroke: rgba(24, 165, 88, 0.45); }
.p3e-com.sel { fill: rgba(91, 70, 229, 0.16); }
.p3e-com.selr { stroke: var(--primary); stroke-width: 2; stroke-dasharray: none; }
.p3e-ab { stroke-width: 1; vector-effect: non-scaling-stroke; stroke: #fff; }
.p3e-ab.porta { fill: #c98a4a; }
.p3e-ab.porta-vidro { fill: #6fb3d9; }
.p3e-ab.janela { fill: #2f6df6; }
.p3e-ab.vao { fill: #fbfbfd; stroke: #8b90a3; stroke-dasharray: 3 3; }
.p3e-mov { fill: rgba(255, 255, 255, 0.7); stroke: #8b90a3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.p3e-frente { fill: #d08700; pointer-events: none; }
.p3e-par.sel, .p3e-gua.sel, .p3e-ab.sel, .p3e-mov.sel { stroke: #ff7a00; stroke-width: 3; vector-effect: non-scaling-stroke; }
.p3e-prev { fill: rgba(255, 122, 0, 0.35); stroke: #ff7a00; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.p3e-calib { stroke: #e0413e; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.p3e-guia { stroke: #ff7a00; stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.p3e-txt { text-anchor: middle; dominant-baseline: middle; fill: #1c1e2b; pointer-events: none; font-family: inherit; font-weight: 600; paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.p3e-abtxt { fill: #fff; stroke: none; font-weight: 700; }
.p3e-movtxt { font-weight: 500; fill: #555; }
.p3e-medida { fill: #ff7a00; }
@media (max-width: 760px) {
  .p3e-lado { position: absolute; right: 0; bottom: 34px; height: 40%; width: 100%; border-left: 0; border-top: 1px solid var(--border); }
  .pt-grade { grid-template-columns: 1fr; }
}

/* marcação ↔ vistoria: histórico mês a mês e "já existe marcação aqui" (2026-10-28) */
.pl-hist { display: flex; flex-direction: column; gap: 4px; }
.pl-hist-li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: var(--bg-soft, #f6f7fa); }
.pl-hist-st { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; }
.pl-perto { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; margin-bottom: 6px; padding: 8px 10px; }
.pl-hist-st.vs-st-ok { background: #e3f4e9; color: #1f8a4c; }
.pl-hist-st.vs-st-parcial { background: #fdf3d6; color: #9a6c00; }
.pl-hist-st.vs-st-nao { background: #fde6e6; color: #b42323; }
.pl-hist-st.vs-st-na, .pl-hist-st.vs-st-pendente { background: #eef0f4; color: #6b7280; }

/* ===== MEDIÇÃO EM PLANTA (reboco parede a parede) ===== */
.mp-cab { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.mp-tit { margin: 0 0 2px; font-size: 18px; }
.mp-cab p { margin: 0; max-width: 640px; }
.mp-cab-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.mp-barra-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.mp-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.mp-seg button { border: 0; background: #fff; padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.mp-seg button.on { background: var(--accent, #5b46e5); color: #fff; }
.mp-rapido { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.mp-pavs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.mp-pav { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mp-pav small { font-weight: 500; color: var(--muted); font-size: 11px; }
.mp-pav.on { border-color: var(--accent, #5b46e5); box-shadow: 0 0 0 2px rgba(91,70,229,.15); }
.mp-area { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.mp-area > .mp-planta { flex: 1 1 520px; min-width: 0; }
.mp-area > .mp-totais { flex: 1 1 540px; min-width: min(540px, 100%); max-width: 100%; }   /* não cabe ao lado? desce para baixo da planta */
.mp-planta { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.mp-svg { display: block; width: 100%; height: min(70vh, 640px); touch-action: none; background: #fbfbfd; cursor: crosshair; user-select: none; }
.mp-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 12px; font-size: 12.5px; border-top: 1px solid var(--border); }
.mp-legenda i { display: inline-block; width: 14px; height: 6px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.mp-folha { position: absolute; left: 10px; right: 10px; bottom: 50px; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(20,24,40,.22); padding: 10px 12px; max-height: 55%; overflow: auto; }
.mp-folha-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mp-folha-li { padding: 6px 0; border-top: 1px solid var(--border); }
.mp-bts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.mp-bt { flex: 1 1 auto; min-width: 54px; padding: 9px 6px; border-radius: 9px; border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.mp-bt.on.ok { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.mp-bt.on.parc { background: #e8930c; border-color: #e8930c; color: #fff; }
.mp-bt.on.falta { background: #4f5867; border-color: #4f5867; color: #fff; }
.mp-totais .mp-pav-linha { cursor: pointer; background: #f6f7fa; }
.mp-totais .mp-pav-linha.on { background: #eef0ff; }
.mp-totais .mp-grupo td:first-child { padding-left: 22px; }
.mp-totais .mp-total td { border-top: 2px solid var(--border); }
.mp-barra { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: #e7e9ef; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.mp-barra span { display: block; height: 100%; background: #1f9d55; }
.mp-totais { overflow-x: auto; }
.mp-totais table { min-width: 420px; }
.mp-totais td.ct-num, .mp-totais th.ct-num { white-space: nowrap; }
@media (max-width: 900px) {
  .mp-svg { height: 62vh; }
}

/* ===========================================================================
   CRONOGRAMA MENSAL (VicTools, js/crono-mensal.js)
=========================================================================== */
.cm-cab { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.cm-cab p { margin: 0; max-width: 640px; }
.cm-cab-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.cm-area { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cm-col-tit { font-weight: 700; padding: 12px 12px 8px; }
.cm-col.card:not(.no-pad) .cm-col-tit { padding: 0 0 8px; }
.cm-ativs, .card.no-pad .table.cm-ativs { table-layout: fixed; width: 100%; min-width: 0; }   /* a lista cabe na largura: sem rolar de lado */
.cm-ativs th { white-space: nowrap; }
.cm-ativs td { padding: 4px 6px; vertical-align: middle; }
.cm-ativs col.cm-c-mes { width: 86px; }
.cm-ativs col.cm-c-pct { width: 84px; }
.cm-ativs col.cm-c-acao { width: 36px; }
.cm-ativs input.cell-input { width: 100%; box-sizing: border-box; }
.cm-ativs .cm-mes input { text-align: center; }
.cm-ativs .cm-pct input { width: 52px; text-align: right; }
.cm-ativs .cm-pct { white-space: nowrap; }
.cm-ativs .cm-pct span { margin-left: 3px; color: var(--muted); }
.cm-ativs .cm-acao { width: 34px; text-align: right; }
.cm-ativs tr.cm-ruim .cm-mes input { border-color: var(--atrasada); }
.cm-tab td { padding: 6px 8px; font-size: 12.5px; vertical-align: top; }
.cm-tab .cm-mesrot { white-space: nowrap; font-weight: 700; width: 78px; }
.cm-feito { color: #2f8a55; font-weight: 700; }
.cm-import { margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.cm-import p { margin: 0; }
.cm-import textarea { width: 100%; box-sizing: border-box; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.cm-import-acoes { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 1000px) { .cm-area { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cm-ativs .cm-mes input, .cm-ativs .cm-pct input { font-size: 16px; }
  .cm-ativs col.cm-c-mes { width: 82px; }
  .cm-ativs .cm-nome input { font-size: 16px; }
}
/* celular: nome da atividade numa linha, início / fim / % / excluir na de baixo */
@media (max-width: 600px) {
  .cm-ativs, .cm-ativs tbody { display: block; width: 100%; min-width: 0; }
  .cm-ativs colgroup, .cm-ativs thead { display: none; }
  .cm-ativs tr { display: grid; grid-template-columns: 1fr 1fr 78px 36px; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
  .cm-ativs td { display: block; padding: 0; border: 0; }
  .cm-ativs td.cm-nome { grid-column: 1 / -1; }
}

/* ===========================================================================
   PORTAL DO EMPREITEIRO (portal.html / js/portal.js) e as peças do lado da equipe
=========================================================================== */
.pt-body { background: var(--bg); }
.pt-carregando { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; padding: 20px; }
.pt-wrap { max-width: 960px; margin: 0 auto; padding: 12px 16px 60px; }
.pt-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; }
.pt-marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-marca b { display: block; font-size: 16px; line-height: 1.2; }
.pt-marca small { color: var(--muted); font-size: 12.5px; }
.pt-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 800; flex: 0 0 auto; }
.pt-topo-acoes { display: flex; gap: 6px; flex: 0 0 auto; }
.pt-abas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.pt-aba { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.pt-aba.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pt-filtro { margin: 8px 0; }
.pt-filtro select { max-width: 320px; }
.pt-titulo { font-size: 22px; margin: 8px 0 4px; }
.pt-secao { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 2px 6px; }
.pt-resumos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.pt-resumo { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.pt-resumo b { font-size: 26px; line-height: 1; }
.pt-resumo span { font-size: 13px; color: var(--muted); }
.pt-resumo.alerta { border-color: #f2b8b5; background: #fff6f5; }
.pt-resumo.alerta b { color: var(--atrasada); }
.pt-obras { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-obra { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 9px 12px; font: inherit; cursor: pointer; }
.pt-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pt-item-tit { margin-bottom: 4px; }
.pt-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.pt-doc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; }
.pt-doc .pt-item-meta { margin-top: 0; }
.pt-fotos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pt-fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f0f1f4; }
.pt-ct { margin-bottom: 10px; padding: 0; }
.pt-ct summary { list-style: none; cursor: pointer; padding: 12px 14px; }
.pt-ct summary::-webkit-details-marker { display: none; }
.pt-ct-cab { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pt-ct-num { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; }
.pt-ct-num span { font-size: 12.5px; color: var(--muted); }
.pt-barra { margin-top: 8px; }
.pt-ct-corpo { padding: 0 14px 12px; }
.pt-tab td, .pt-tab th { padding: 6px 8px; font-size: 13px; }
.pt-dem { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; margin-bottom: 8px; padding: 12px 14px; }
.pt-dem.fechada { opacity: .7; }
.pt-dem-cab { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.pt-dem-det { margin: 10px 0; }
.pt-dem-desc { white-space: pre-wrap; margin: 10px 0 0; }
.pt-ck { list-style: none; padding: 0; margin: 10px 0 0; }
.pt-ck li { padding: 3px 0; } .pt-ck li.feito { color: var(--muted); text-decoration: line-through; }
.pt-prop { margin-bottom: 10px; border-color: #c9c1fb; }
.pt-prop-valor { font-size: 22px; }
.pt-prop-form .field { margin-bottom: 8px; }
.pt-anexos { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-anexo { display: flex; flex-direction: column; gap: 4px; width: 110px; font-size: 12px; color: var(--text); text-decoration: none; word-break: break-word; }
.pt-anexo img, .pt-pdf { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #f0f1f4; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); }
.pt-msgs { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; margin-bottom: 10px; }
.pt-msg { background: #f4f5f9; border-radius: 10px; padding: 8px 10px; max-width: 88%; }
.pt-msg.eu { align-self: flex-end; background: var(--primary-soft); }
.pt-msg small { color: var(--muted); display: block; margin-bottom: 2px; }
.pt-msg div { white-space: pre-wrap; }
.pt-msg-sis { font-size: 12px; color: var(--muted); text-align: center; }
.pt-msg-novo { display: flex; gap: 8px; align-items: flex-end; }
.pt-msg-novo textarea { flex: 1; }
.pt-envio .field { margin-bottom: 8px; }
.pt-envio-acoes { display: flex; gap: 8px; justify-content: flex-end; }
.pt-wrap .card { margin-bottom: 10px; }
@media (max-width: 600px) {
  .pt-wrap input, .pt-wrap select, .pt-wrap textarea { font-size: 16px; }
  .pt-ct-cab { flex-direction: column; }
  .pt-ct-num { text-align: left; }
}
/* lado da equipe: pedido de orçamento, cotação e envios do portal */
.dm-orc-toggle { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 14px; cursor: pointer; }
.dm-prop { background: #f7f5ff; border: 1px solid #dcd5fd; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.dm-prop-valor { font-size: 22px; font-weight: 800; }
.dm-prop-obs { white-space: pre-wrap; margin-top: 6px; }
.dm-prop-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.dm-cotacao td, .dm-cotacao th { padding: 6px 8px; font-size: 13px; }
.dm-cotacao .dm-cot-atual td { background: #f7f5ff; font-weight: 600; }
.seg-envio { margin-bottom: 10px; }
.seg-envio-cab { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.seg-envio-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; align-items: end; margin-top: 8px; }
.seg-envio-campos .field { margin: 0; }
.seg-envio-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.seg-envio-feito { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
/* portal: marcações da aba Plantas (2026-11-24) */
.pt-marc-desc { margin: 6px 0 0; white-space: pre-wrap; font-size: 14px; }
.pt-planta { position: relative; display: block; margin-top: 8px; max-width: 640px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.pt-planta img { display: block; width: 100%; height: auto; min-height: 60px; }
.pt-pino { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #e5484d; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 0 8px rgba(0,0,0,.12); }
.pt-atraso { color: #c62828; font-weight: 600; }
/* portal: filtros da aba Contratos (obra + Em andamento/Concluídos/Todos) */
.pt-filtro-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chip { border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.pt-chip.on { background: var(--primary, #5b4be1); border-color: var(--primary, #5b4be1); color: #fff; font-weight: 600; }
/* portal: marcações em lista compacta (miniatura) que abre ao tocar */
.pt-marc { padding: 0; }
.pt-marc > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.pt-marc > summary::-webkit-details-marker { display: none; }
.pt-marc-mini { position: relative; flex: 0 0 auto; width: 56px; height: 56px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.pt-marc-mini img { width: 100%; height: 100%; object-fit: fill; display: block; }
.pt-pino-mini { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #e5484d; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.pt-marc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-marc-seta { font-size: 22px; color: var(--muted, #888); transition: transform .15s; }
.pt-marc[open] .pt-marc-seta { transform: rotate(90deg); }
.pt-marc-corpo { padding: 0 12px 12px; border-top: 1px solid var(--border); padding-top: 8px; }
/* portal: pasta de documentos (ver/baixar/ZIP) */
.pt-pasta-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 10px; }
.pt-pasta-cab .muted-sm { margin-top: 3px; }
.pt-ok { color: #2e7d32; } .pt-aviso { color: #b26a00; }
.pt-busca { width: 100%; max-width: 420px; margin-bottom: 10px; }
.pt-pasta { padding: 0; }
.pt-pasta > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.pt-pasta > summary::-webkit-details-marker { display: none; }
.pt-pasta[open] .pt-marc-seta { transform: rotate(90deg); }
.pt-pasta-ico { font-size: 22px; }
.pt-pasta-corpo { border-top: 1px solid var(--border); padding: 4px 12px 10px; }
.pt-pdoc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.pt-pdoc-txt { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.pt-pdoc-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-pasta-rodape { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* assinatura eletrônica de contratos (2026-11-28) */
.cd-ass { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 12px; background: var(--surface); }
.cd-ass.completo { border-style: solid; border-color: #2e7d32; }
.cd-ass-tit { font-weight: 700; margin-bottom: 6px; }
.cd-ass-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0; }
.cd-ass-linha.ok span { color: #2e7d32; }
.pt-ass { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; background: #fffaf0; }
.pt-ass.ok { background: #f1f8f1; border-color: #a5d6a7; }
.pt-ass-linha { margin: 3px 0; }
.pt-ass-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.pt-ass-modal { width: min(900px, 96vw); }
.pt-ass-doc { width: 100%; height: 58vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pt-ass-ok { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 14px; }
.pt-ass-ok input { margin-top: 3px; }
.vf-wrap { max-width: 760px; }
.vf-form { display: flex; gap: 8px; margin: 12px 0 16px; }
.vf-form .input { flex: 1; font-family: Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.vf-card { padding: 14px 16px; }
.vf-erro { border-color: #e57373; }
.vf-estado { font-weight: 700; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.vf-ok { background: #e8f5e9; color: #1b5e20; } .vf-pend { background: #fff8e1; color: #8a5a00; } .vf-cancelado { background: #ffebee; color: #b71c1c; }
.vf-tab { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.vf-tab th { text-align: left; font-weight: 600; color: var(--muted, #666); padding: 4px 10px 4px 0; vertical-align: top; white-space: nowrap; font-size: 13px; }
.vf-tab td { padding: 4px 0; }
.vf-hash { font-family: Consolas, monospace; font-size: 11px; color: #666; word-break: break-all; }
.vf-ass { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.vf-ass.ok { border-color: #a5d6a7; }
.vf-acoes { margin: 10px 0 4px; }
@media (min-width: 761px) { .modal-lg.pt-ass-modal { max-width: 900px; } }
