:root {
  /* Neutros frios modernos (escala zinc) + vinho Larivoir como ACENTO pontual */
  --ink: #18181b;
  --ink-soft: #52525b;
  --ink-faint: #a1a1aa;
  --maroon: #7a1d1d;       /* acento da marca */
  --maroon-strong: #631616;
  --maroon-tint: #f9eeee;
  --maroon-line: #ecd6d6;
  --bg: #f6f7f9;           /* fundo claro e frio (cara de app) */
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #fafafa;
  --line: #ebebef;
  --line-strong: #dcdce1;
  --ocher: #9a7330;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-card: 0 1px 2px rgba(24, 24, 27, 0.04), 0 1px 3px rgba(24, 24, 27, 0.06);
  --shadow-soft: 0 4px 14px -6px rgba(24, 24, 27, 0.12);
  --shadow-pop: 0 24px 60px -24px rgba(24, 24, 27, 0.28);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-symbol { height: 34px; width: auto; display: block; }
.brand-lockup { display: flex; flex-direction: column; line-height: 1.04; }
.brand-name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-sub { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-faint); font-weight: 600; margin-top: 2px; }

.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.brand-symbol-lg { height: 50px; width: auto; }
.login-brand .brand-name { font-size: 1.45rem; }
.login-brand .brand-sub { color: var(--maroon); letter-spacing: 0.18em; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(80% 60% at 15% 0%, #ffffff 0%, rgba(255,255,255,0) 60%),
    radial-gradient(70% 60% at 100% 100%, #eef0f4 0%, rgba(238,240,244,0) 55%),
    linear-gradient(180deg, #f1f2f5 0%, #e9ebef 100%);
}
.login-card {
  width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-pop); padding: 34px 32px 30px;
}
.login-card h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.025em; margin: 4px 0 4px; }
.login-card p.sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 0.9rem; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
}
.topbar .spacer { flex: 1; }
.obra-select {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 7px 13px; box-shadow: var(--shadow-card);
  transition: border-color .14s, box-shadow .14s;
}
.obra-select:hover { border-color: var(--ink-faint); }
.obra-select label { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--ink-faint); font-weight: 600; }
.obra-select select {
  background: transparent; color: var(--ink); border: 0; font-size: 0.9rem; font-weight: 600;
  font-family: inherit; max-width: 44vw; cursor: pointer;
}
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--ink-soft); }
.user-chip .perfil {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--maroon);
  background: var(--maroon-tint); padding: 3px 9px; border-radius: 6px; font-weight: 700;
}

.tabs { display: flex; gap: 0; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.6); }
.tabs button {
  background: transparent; border: 0; color: var(--ink-soft); cursor: pointer;
  padding: 13px 2px; margin-right: 24px; font-size: 0.92rem; font-weight: 500; font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--maroon); font-weight: 600; }

main { padding: 26px 24px 64px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow-card); position: relative; transition: box-shadow .16s, transform .16s;
}
.kpi:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.kpi .label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 600; }
.kpi .value { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 7px; font-variant-numeric: tabular-nums; color: var(--ink); }
/* destaque sutil só no headline (Total com BDI) */
.kpi.total { border-color: var(--maroon-line); }
.kpi.total::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--maroon); }
.kpi.total .value { color: var(--maroon); }
.kpi.bdi .value { color: var(--ocher); }
.kpi.dark .value { color: var(--ink); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.card-head .spacer { flex: 1; }

/* ---------- Painel — árvore ---------- */
.table-scroll { overflow-x: auto; }
table.tree { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 900px; }
table.tree thead th {
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  text-align: right; font-weight: 600; color: var(--ink-faint);
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.09em;
}
table.tree thead th.l { text-align: left; }
table.tree thead th.future { color: var(--ink-faint); }
table.tree td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.tree tbody tr { transition: background .1s; }
table.tree tbody tr:hover td { background: #fafafa; }
table.tree td.desc { text-align: left; white-space: normal; min-width: 300px; }
table.tree td.codigo { font-feature-settings: "tnum" 1; color: var(--ink-faint); text-align: left; font-variant-numeric: tabular-nums; font-size: 0.8rem; font-weight: 500; }
table.tree td.num { font-variant-numeric: tabular-nums; }
table.tree td.future { color: var(--ink-faint); font-size: 0.78rem; opacity: 0.65; }

.row-ETAPA td { background: var(--surface-2); font-weight: 700; }
.row-ETAPA:hover td { background: #ededf0; }
.row-ETAPA td.desc { font-size: 0.9rem; letter-spacing: -0.01em; }
.row-ETAPA td.codigo { color: var(--maroon); font-weight: 700; }
.row-SUBETAPA td { font-weight: 600; }
.row-SERVICO { font-weight: 500; }
.row-INSUMO td.desc { color: var(--ink-soft); }
.row-BDI td { background: var(--maroon-tint); font-weight: 700; color: var(--maroon); }
.row-BDI:hover td { background: #f5e3e3; }

/* % físico no painel */
.kpi.fisico .value { color: var(--maroon); }
/* desvio: verde economia, vermelho estouro */
.desvio.economia { color: var(--ok); font-weight: 600; }
.desvio.estouro { color: var(--danger); font-weight: 600; }
.kpi.kpi-economia .value { color: var(--ok); }
.kpi.kpi-estouro .value { color: var(--danger); }
/* situação (cronograma) */
.badge.sit-atrasado { background: var(--danger-bg); color: var(--danger); }
.badge.sit-emdia { background: var(--ok-bg); color: var(--ok); }
.badge.sit-adiantado { background: #eaf1fb; color: #1d4ed8; }
.kpi.kpi-sit-atrasado .value { color: var(--danger); }
.kpi.kpi-sit-emdia .value { color: var(--ok); }
.kpi.kpi-sit-adiantado .value { color: #1d4ed8; }
.fisico-cell { white-space: nowrap; }
.fisico-val { font-variant-numeric: tabular-nums; }
.progress { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--maroon); border-radius: 3px; }

/* badges de status de medição */
.badge { display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.badge.rascunho { background: var(--surface-2); color: var(--ink-soft); }
.badge.aguardando { background: #fcf3e3; color: #9a6a16; }
.badge.aprovada { background: #eaf6ee; color: var(--ok); }

/* medição — inputs */
.med-list tbody tr:hover td { background: var(--maroon-tint); }
/* sub-navegação do financeiro */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav-btn { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft); border-radius: 999px; padding: 7px 16px; font-size: 0.86rem; font-weight: 500; font-family: inherit; cursor: pointer; transition: all .12s; }
.subnav-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.subnav-btn.active { background: var(--maroon); border-color: var(--maroon); color: #fff; }

/* saldo / apropriação */
.saldo-ok { color: var(--ok); font-weight: 700; }
.saldo-pend { color: var(--ocher); font-weight: 600; }
.saldo-neg { color: var(--danger); font-weight: 600; }
.apropriacao-saldo { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 0.9rem; font-weight: 500; margin-bottom: 14px; }
.apropriacao-lista { display: flex; flex-direction: column; gap: 6px; }
.apropriacao-linha { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-3); }
.ap-desc { color: var(--ink-soft); font-size: 0.88rem; }
.busca-result { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 240px; overflow-y: auto; }
.busca-result:empty { display: none; }
.busca-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.busca-item:last-child { border-bottom: 0; }
.busca-item:hover { background: var(--maroon-tint); }
.tag { margin-left: auto; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); background: var(--surface-2); padding: 2px 7px; border-radius: 5px; }
.crud-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 16px; border-bottom: 1px solid var(--line); }
.crud-form .field { flex: 1; min-width: 130px; }
.fin-totais { display: flex; gap: 22px; flex-wrap: wrap; padding: 11px 16px; font-size: 0.88rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: var(--surface-3); }
.fin-totais .destaque { color: var(--maroon); font-weight: 700; }
.num.destaque { color: var(--maroon); font-weight: 600; }
.anexo-link { display: inline-block; margin-right: 8px; color: var(--maroon); font-weight: 600; font-size: 0.82rem; text-decoration: none; }
.anexo-link:hover { text-decoration: underline; }
.nota-sec { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin: 0 0 10px; font-weight: 600; }
.forn-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.forn-inline input { flex: 1; min-width: 150px; }

.gantt { width: 100%; min-width: 700px; font-family: var(--sans); }
.gantt-label { font-size: 11px; fill: var(--ink-soft); }
.gantt-bar { fill: var(--maroon); }
.gantt-hoje { stroke: #1d4ed8; stroke-width: 1.5; stroke-dasharray: 4 3; }

.med-hint { padding: 11px 18px; background: var(--maroon-tint); color: var(--maroon); font-size: 0.84rem; border-bottom: 1px solid var(--line); }
.med-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px); -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 18px -10px rgba(24,24,27,0.25);
}
.med-status-tag { font-size: 0.82rem; font-weight: 600; }
.med-status-tag.aguardando { color: #9a6a16; }
.btn.danger { background: #fff; color: var(--danger); border-color: #e8c4c1; box-shadow: none; }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-del { background: transparent; border: 0; cursor: pointer; font-size: 0.95rem; padding: 4px 8px; border-radius: 6px; opacity: 0.55; transition: opacity .12s, background .12s; }
.btn-del:hover { opacity: 1; background: var(--danger-bg); }
.med-input-col { white-space: nowrap; text-align: right; }
.med-input { width: 68px; padding: 6px 8px; text-align: right; border: 1px solid var(--line-strong); border-radius: 8px; font-family: inherit; font-size: 0.9rem; font-variant-numeric: tabular-nums; background: #fff; }
.med-input:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(122,29,29,0.1); }
.med-input:disabled { background: var(--surface-2); color: var(--ink-soft); }
.pct-suffix { color: var(--ink-faint); margin-left: 4px; font-size: 0.82rem; }

.toggle { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 5px;
  border-radius: 6px; cursor: pointer; color: var(--ink-faint); user-select: none; font-size: 0.7rem; transition: background .12s, color .12s; }
.toggle:hover { background: var(--maroon-tint); color: var(--maroon); }
.leaf-dot { display: inline-block; width: 19px; margin-right: 5px; }
.inc-bar { display: inline-block; height: 5px; border-radius: 3px; background: var(--maroon); vertical-align: middle; margin-left: 8px; opacity: 0.5; }
.row-ETAPA .inc-bar { opacity: 0.7; }

/* ---------- Forms / botões ---------- */
label.field { display: block; margin-bottom: 15px; }
label.field span { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); margin-bottom: 7px; }
input[type=text], input[type=email], input[type=password], input[type=number], select.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: var(--ink-faint); }
input:focus, select:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(122, 29, 29, 0.1); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--maroon); color: #fff; border: 1px solid transparent; border-radius: 10px;
  padding: 11px 20px; font-size: 0.9rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .14s, transform .04s, box-shadow .14s; box-shadow: var(--shadow-card);
}
.btn:hover { background: var(--maroon-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--ink-faint); }
.btn.ghost { background: transparent; color: var(--ink-soft); border-color: transparent; box-shadow: none; padding: 8px 12px; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.small { padding: 7px 13px; font-size: 0.82rem; }
.btn.block { width: 100%; padding: 12px; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 0.86rem; margin-bottom: 14px; line-height: 1.45; }
.alert.err { background: var(--danger-bg); color: var(--danger); border: 1px solid #f4d2d2; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #c3eacd; }
.alert.warn { background: #fcf6ec; color: var(--ocher); border: 1px solid #efe0c4; }

/* ---------- Importação ---------- */
.dropzone { display: block; cursor: pointer; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--ink-soft); background: var(--surface-3); transition: border-color .14s, background .14s; }
.dropzone:hover { border-color: var(--maroon); background: var(--maroon-tint); }
.dropzone strong { color: var(--ink); font-weight: 600; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.review-grid .kpi .value { font-size: 1.25rem; }
.muted { color: var(--ink-soft); font-size: 0.85rem; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.secondary .spinner { border-color: rgba(122,29,29,.25); border-top-color: var(--maroon); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  main { padding: 16px 14px 48px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .tabs { padding: 0 16px; }
  .obra-select select { max-width: 56vw; }
  .kpi .value { font-size: 1.35rem; }
  .login-card { padding: 28px 22px; }
  .brand-name { font-size: 1rem; }
}

/* ---- Construtor com IA (cronograma) ---- */
.btn-ghost {
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; font-size: 0.86rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: background .12s, color .12s;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.ia-chat {
  display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto;
  padding: 4px 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.ia-empty { padding: 18px 10px; font-size: 0.9rem; line-height: 1.5; }
.ia-msg { display: flex; }
.ia-msg.ia-user { justify-content: flex-end; }
.ia-bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 0.9rem;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.ia-user .ia-bubble { background: var(--maroon); color: #fff; border-bottom-right-radius: 4px; }
.ia-assistant .ia-bubble { background: var(--bg); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.ia-compose { margin-top: 4px; }
.ia-input {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px;
  font-family: inherit; font-size: 0.9rem; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.ia-input:focus { outline: none; border-color: var(--maroon); }
.ia-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ia-prop-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--maroon-tint); border: 1px solid var(--maroon-line);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: 0.9rem;
}
.ia-prop-banner .spacer { flex: 1; }

/* ---- Projetos anexados (card da IA) ---- */
#ia-projetos { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.ia-proj-head { font-size: 0.9rem; margin-bottom: 8px; }
.ia-proj-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ia-proj-item {
  display: flex; align-items: center; gap: 8px; font-size: 0.86rem;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
.ia-proj-name { font-weight: 600; color: var(--ink); }
.ia-proj-item .btn-del { margin-left: auto; }
.ia-proj-resumo {
  display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.5;
  background: var(--ok-bg); border: 1px solid #cdebd6; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; color: var(--ink-soft);
}
.ia-proj-tag {
  flex: none; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--ok); background: #fff; border: 1px solid #cdebd6;
  border-radius: 6px; padding: 3px 8px; margin-top: 1px;
}

/* ---- OneDrive (card da IA) ---- */
.od-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-top: 10px; font-size: 0.86rem;
}
.od-cloud { color: #0a66c2; font-weight: 700; }
.od-line { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.od-pasta { flex-basis: 100%; }
.od-actions { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
#od-picker { flex-basis: 100%; }
#od-picker:not(:empty) {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 8px; max-height: 280px; overflow-y: auto;
}
.od-pick-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.od-pick-row { display: flex; align-items: center; gap: 8px; padding: 4px; }
.od-pick-name {
  flex: 1; text-align: left; background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: 0.88rem; color: var(--ink); padding: 6px 8px; border-radius: 8px;
}
.od-pick-name:hover { background: var(--surface-3); }
.od-mapinfo { color: var(--ok); font-weight: 600; }

/* ---- Plano de execução (por pavimento) ---- */
.crono-adv-sum { padding: 14px 18px; cursor: pointer; font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }
.plano-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.agenda-ctrl { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; font-size: 0.88rem; }
.agenda-lista { display: flex; flex-direction: column; }
.agenda-mes { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: var(--maroon); background: var(--maroon-tint); padding: 5px 10px; border-radius: 6px; margin: 12px 0 6px; align-self: flex-start; }
.agenda-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.agenda-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.agenda-meio { flex: 1; min-width: 0; }
.agenda-tit { font-weight: 600; font-size: 0.9rem; }
.agenda-sub { font-size: 0.8rem; }
.agenda-qtd { flex: none; font-weight: 700; color: var(--ink); font-size: 0.86rem; background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.lb-legenda { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.lb-leg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--ink-soft); }
.lb-leg-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.gantt .lb-grid { stroke: var(--line); stroke-width: 1; }
.gantt .lb-row { stroke: var(--line); stroke-width: 1; }
.gantt .lb-mes { font-size: 9px; fill: var(--ink-faint); }
.gantt .lb-pav { font-size: 10px; fill: var(--ink-soft); font-weight: 600; }
.gantt .lb-grid-ano { stroke: var(--line-strong); stroke-width: 1.5; }
.gantt .lb-mes2 { font-size: 11px; fill: var(--ink-soft); font-weight: 600; }
.gantt .lb-hoje-lbl { font-size: 10px; fill: var(--maroon); font-weight: 700; }

/* ---- Medir / Executado ---- */
.medir-etapa { display: flex; align-items: center; gap: 8px; background: var(--maroon-tint); border: 1px solid var(--maroon-line); border-radius: 8px; padding: 8px 12px; margin: 14px 0 6px; font-size: 0.9rem; }
.medir-etapa .spacer { flex: 1; }
.medir-etapa-pct { font-weight: 700; color: var(--maroon); }
.medir-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.medir-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.medir-tit { flex: 1; min-width: 180px; font-size: 0.88rem; font-weight: 600; }
.medir-plan { font-weight: 400; font-size: 0.78rem; }
.medir-lbl { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--ink-soft); }
.medir-desvio { font-size: 0.78rem; font-weight: 700; min-width: 56px; text-align: right; }
.medir-desvio.atras { color: var(--danger); }
.medir-desvio.adiant { color: var(--ok); }

/* ---- Compras ---- */
.compras-resumo { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.compras-chip { font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); }
.compras-lista { display: flex; flex-direction: column; }
.compras-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.compras-row.comprado { opacity: 0.6; }
.compras-alerta { flex: none; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; min-width: 78px; text-align: center; }
.al-atras { background: var(--danger-bg); color: var(--danger); border: 1px solid #e8c4c1; }
.al-ja { background: #fff7ed; color: #b45309; border: 1px solid #fcd9a8; }
.al-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cdebd6; }
.al-feito { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.al-sem { background: #fff; color: var(--ink-faint); border: 1px solid var(--line); }
.compras-meio { flex: 1; min-width: 220px; }
.compras-desc { font-weight: 600; font-size: 0.9rem; }
.compras-sub { font-size: 0.78rem; margin-top: 2px; }
.compras-check { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Solicitações de compra ---- */
.solic-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface-3); }
.solic-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.solic-itens { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.86rem; }
.solic-itens th { text-align: right; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); padding: 4px 8px; border-bottom: 1px solid var(--line); }
.solic-itens th.l { text-align: left; }
.solic-itens td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.solic-acts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card { background: var(--surface); border-radius: 16px; padding: 22px 24px; width: min(640px, 96vw); max-height: 90vh; overflow-y: auto; box-shadow: 0 16px 50px rgba(0,0,0,.2); }
.modal-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.solic-form-itens { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.solic-form-row { display: flex; gap: 6px; align-items: center; }

/* ---- Mapa de concorrência ---- */
.mapa { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 480px; }
.mapa th, .mapa td { border: 1px solid var(--line); padding: 8px 10px; text-align: right; vertical-align: top; }
.mapa th.l, .mapa td.l, .mapa td.desc { text-align: left; }
.mapa thead th { background: var(--surface-2); font-size: 0.8rem; }
.mapa th.mapa-best, .mapa td.mapa-best { background: var(--ok-bg); }
.mapa-th-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 4px; }
.mapa-up { font-size: 0.74rem; color: var(--maroon); cursor: pointer; font-weight: 600; border: 1px solid var(--maroon); border-radius: 6px; padding: 3px 8px; white-space: nowrap; background: var(--surface); }
.mapa-up:hover { background: var(--maroon); color: #fff; }
.mapa-cell-best { background: var(--ok-bg); font-weight: 700; color: var(--ok); }
.mapa-foot td { background: var(--surface-3); font-weight: 600; }
.kpi-inline { font-weight: 700; color: var(--maroon); font-size: 0.92rem; }

/* ---- Previsão de desembolso + filtros ---- */
.filtro-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filtro-bar select.input { min-width: 180px; }
.desemb { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.desemb th, .desemb td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.desemb th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); background: var(--surface-2); }
.desemb .l { text-align: left; } .desemb .r { text-align: right; } .desemb .c { text-align: center; }
.desemb-mes td { background: var(--maroon-tint); font-weight: 700; color: var(--maroon); font-size: 0.82rem; }

/* ---- Cronograma de gastos ---- */
.gasto-bars { display: flex; flex-direction: column; gap: 2px; }
.gasto-bar { height: 5px; border-radius: 3px; min-width: 1px; }
.gb-plan { background: var(--ink-faint); }
.gb-comp { background: #0a66c2; }
.gb-real { background: var(--maroon); }
.gasto-legenda { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 0.78rem; color: var(--ink-soft); }
.gasto-leg { display: inline-block; width: 18px; height: 6px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

/* ---- Orçado no mapa de concorrência ---- */
.mapa-orcado-th { background: var(--surface-2); color: var(--ink-soft); }
.mapa-orcado { text-align: right; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); white-space: nowrap; }
.mapa-cell.mapa-dentro { background: rgba(22, 130, 60, 0.13); color: #11602c; }
.mapa-cell.mapa-acima { background: rgba(190, 30, 45, 0.12); color: #9d1620; }
.mapa-cell.mapa-acima::after { content: ' ▲'; font-size: 0.7em; }
.mapa-cell.mapa-cell-best.mapa-dentro { box-shadow: inset 0 0 0 2px rgba(22, 130, 60, 0.5); }

/* ---- Proposta de compras (conversa) ---- */
.ia-prop-itens { margin: 8px 0; display: flex; flex-direction: column; gap: 5px; }
.ia-prop-item { font-size: 0.86rem; line-height: 1.35; }
.ia-prop-titulo { font-weight: 600; }
.ia-prop-acts { display: flex; gap: 8px; margin-top: 8px; }

/* ---- Orçado / previsão no cronograma de compras ---- */
.compras-orcado { font-size: 0.8rem; color: #11602c; font-weight: 600; margin-top: 2px; }
.compras-previsao { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }

/* ---- Interface do Campo (mobile) ---- */
.campo-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.campo-ola { font-size: 1.2rem; font-weight: 700; padding: 4px 2px; }
.campo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.campo-h { font-size: 1.05rem; margin: 0 0 12px; }
.campo-itens { display: flex; flex-direction: column; gap: 8px; }
.campo-item-linha { display: flex; gap: 6px; align-items: center; }
.campo-desc { flex: 1; min-width: 0; }
.campo-qtd { width: 72px; }
.campo-un { width: 56px; }
.campo-item-linha .input { height: 46px; font-size: 1rem; }
.campo-add { margin-top: 8px; }
.campo-form-foot { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.campo-form-foot .input { flex: 1; min-width: 140px; height: 46px; }
.campo-enviar { width: 100%; height: 50px; font-size: 1.05rem; margin-top: 12px; }
.campo-entrega { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.campo-entrega:first-of-type { border-top: none; }
.campo-entrega-info { flex: 1; min-width: 0; }
.campo-confirmar { height: 46px; min-width: 110px; white-space: nowrap; }
.campo-atras { color: var(--maroon); font-weight: 600; font-size: 0.84rem; }
.campo-solic { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.campo-solic:first-of-type { border-top: none; }
.campo-solic-info { flex: 1; font-size: 0.9rem; }

/* ---- Campo: obra, campos abertos, quando-precisa ---- */
.campo-obra { background: var(--maroon-tint); border-color: var(--maroon-line); }
.campo-obra-label { font-weight: 700; margin-bottom: 8px; }
.campo-obra-sel { width: 100%; height: 50px; font-size: 1.05rem; font-weight: 600; }
.campo-campo-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin: 12px 0 5px; }
.campo-textarea { width: 100%; resize: vertical; font-size: 1rem; line-height: 1.4; }
.campo-card .input { width: 100%; }
.campo-quando { display: flex; gap: 8px; flex-wrap: wrap; }
.campo-chip { flex: 1; min-width: 72px; height: 44px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; font-family: inherit; }
.campo-chip.ativo { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.campo-data { width: 100%; height: 46px; margin-top: 8px; }

/* ---- Contratos ---- */
.contrato-box { cursor: pointer; }
.contrato-box:hover { border-color: var(--maroon-line); }
.contrato-info { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; margin-bottom: 4px; }

/* ---- Fluxo de caixa (real × previsão) ---- */
.fc-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fc-bloco { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fc-bloco .fc-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 600; }
.fc-bloco .fc-val { font-size: 1.15rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.fc-bloco.fc-receita { border-color: rgba(22,130,60,0.35); } .fc-bloco.fc-receita .fc-val { color: #11602c; }
.fc-bloco.fc-real .fc-val { color: #9d1620; }
.fc-bloco.fc-prev { border-style: dashed; } .fc-bloco.fc-prev .fc-val { color: #c2606a; }
.fc-bloco.fc-saldo.pos .fc-val { color: #11602c; } .fc-bloco.fc-saldo.neg .fc-val { color: #9d1620; }
.fc-c-receita { color: #11602c; }
.fc-c-real { color: #9d1620; }
.fc-c-prev { color: #c2606a; font-style: italic; }
.fc-divisor td { background: var(--surface-2); text-align: center; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-soft); font-weight: 600; padding: 5px; }
.fc-legenda { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 0.76rem; color: var(--ink-soft); }
.fc-leg { display: inline-block; width: 16px; height: 8px; border-radius: 3px; vertical-align: middle; margin-right: 5px; }
.fc-leg.fc-receita { background: #11602c; } .fc-leg.fc-real { background: #9d1620; } .fc-leg.fc-prev { background: #c2606a; }

/* ---- Empreiteiros ---- */
.emp-form { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.emp-form-linha { display: flex; gap: 8px; flex-wrap: wrap; }
.emp-form-linha .input { flex: 1; min-width: 140px; }
.emp-prog { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.emp-prog-fill { height: 100%; background: var(--ok); border-radius: 3px; }

/* ---- Modal de usuários ---- */
.modal-ov { position: fixed; inset: 0; background: rgba(24,24,27,0.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow: auto; }
.modal-card { background: var(--surface); border-radius: 14px; width: 100%; max-width: 720px; box-shadow: var(--shadow-pop); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.usuario-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.areas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin: 8px 0; }
.area-chk { font-size: 0.88rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.area-chk.admin-chk { font-weight: 600; }
.area-sep { grid-column: 1 / -1; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }

/* ---- Mão de obra ---- */
.mao-tab { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 720px; }
.mao-tab thead th { text-align: right; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mao-tab thead th.l { text-align: left; }
.mao-tab td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.mao-tab td.r { text-align: right; }
.mao-inp { height: 34px; font-size: 0.85rem; text-align: right; }
.mao-tab td:nth-child(1) .mao-inp, .mao-tab td:nth-child(2) .mao-inp { text-align: left; }
.mao-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.mao-add .input { flex: 1; min-width: 120px; }
