/* tema HCM Engenharia (08/09/2026): preto da marca na lateral, laranja das estruturas metálicas como destaque, cinzas neutros */
:root { --bg:#f3f4f6; --side:#121417; --side2:#1e2227; --side3:#2a2f36; --txt:#1b1f24; --mut:#6b7280; --bord:#e4e7ec; --acc:#f08a1d; --acc2:#d97706;
        --err:#b42318; --warn:#b54708; --ok:#1e7f3a; --sub-bg:#eceff3; --tot-bg:#dfe4ea; --edit-bg:#fff6e8; --sombra:0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08); }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size:14px; color:var(--txt); background:var(--bg); display:flex; min-height:100vh; -webkit-font-smoothing:antialiased; }
.sidebar { width:238px; background:var(--side); color:#e5e7eb; display:flex; flex-direction:column; flex-shrink:0; position:sticky; top:0; height:100vh; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#3a3f47 transparent; }
.sidebar nav a { padding:7px 18px; font-size:13px; border-radius:6px; margin:1px 8px; }
.sidebar nav a.l2 { padding:5px 12px 5px 30px; font-size:12px; color:#9ca3af; } .sidebar nav a.l2.ativo { color:#fff; }
.sidebar nav a.topo { font-size:11px; letter-spacing:.08em; text-transform:uppercase; font-weight:700; color:#9ca3af; margin-top:6px; }
.sidebar nav a.l3 { padding-left:44px; font-size:12.5px; }
.sidebar nav .sub1 { padding:7px 18px 2px; font-size:12.5px; color:#9ca3af; text-transform:uppercase; letter-spacing:.04em; }
.sidebar nav .sub2 { padding:6px 18px 2px 32px; font-size:12px; color:#9ca3af; text-transform:uppercase; letter-spacing:.04em; }
.abas-links a { margin-right:14px; }
.brand { padding:22px 20px 12px; border-bottom:1px solid #22262c; margin-bottom:6px; }
.brand-logo { display:block; width:118px; height:auto; margin:0 0 10px; }
.brand-title { font-weight:600; font-size:13px; letter-spacing:.02em; color:#e5e7eb; }
.brand-sub { font-size:11px; color:#9ca3af; margin-top:3px; letter-spacing:.04em; }
nav { display:flex; flex-direction:column; }
nav a { color:#d1d5db; text-decoration:none; padding:10px 18px; transition:background .12s, color .12s; }
nav a:hover { background:var(--side2); color:#fff; }
nav a.ativo { background:var(--side3); color:#fff; box-shadow:inset 3px 0 0 var(--acc); }
nav a.dim { color:#6b7280; }
nav .grupo { font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:#8b919a; padding:16px 20px 6px; font-weight:600; }
.rodape { margin-top:auto; padding:14px 20px; font-size:11px; color:#6b7280; border-top:1px solid #22262c; }
.conteudo { flex:1; padding:28px 36px 48px; min-width:0; }
h1 { font-size:22px; margin:0 0 6px; font-weight:700; letter-spacing:-.01em; }
h1::after { content:""; display:block; width:36px; height:3px; background:var(--acc); border-radius:2px; margin-top:8px; }
.sub { color:var(--mut); margin-bottom:22px; line-height:1.5; max-width:1400px; }
.card { background:#fff; border:1px solid var(--bord); border-radius:12px; padding:18px 22px; margin-bottom:18px; box-shadow:var(--sombra); }
.card h2 { font-size:14.5px; margin:0 0 12px; font-weight:600; }
table { border-collapse:separate; border-spacing:0; width:100%; font-size:13px; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--bord); vertical-align:top; }
th { color:var(--mut); font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.03em; background:#f8f9fb; position:sticky; top:0; z-index:1; }
td.num, th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
tr:hover td { background:#f9fafb; }
.mono { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; font-size:12.5px; }
.flash { background:#fff7ed; border:1px solid #fed7aa; color:#7c2d12; padding:10px 14px; border-radius:8px; margin-bottom:16px; }
.btn { display:inline-block; background:var(--txt); color:#fff; border:0; border-radius:8px; padding:8px 14px; font-size:13px; font-weight:500; cursor:pointer; text-decoration:none; transition:background .12s; }
.btn:hover { background:#000; }
.btn.sec { background:#fff; color:var(--txt); border:1px solid var(--bord); font-weight:500; } .btn.sec:hover { background:#f3f4f6; }
.btn:disabled { opacity:.5; cursor:default; }
input[type=text], input[type=date], input[type=search], input:not([type]), select, textarea { padding:7px 9px; border:1px solid var(--bord); border-radius:8px; font-size:13px; background:#fff; font-family:inherit; }
input:focus, select:focus, textarea:focus { outline:2px solid rgba(240,138,29,.35); border-color:var(--acc); }
a { color:#1d4ed8; }
input[type=file] { font-size:12px; }
.filtros { display:flex; flex-wrap:wrap; gap:8px 10px; align-items:end; }
.filtros label { display:flex; flex-direction:column; font-size:11px; color:var(--mut); gap:3px; }
.tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.tag.ok { background:#e3f2e7; color:var(--ok); } .tag.err { background:#fde8e6; color:var(--err); } .tag.warn { background:#fdf0e0; color:var(--warn); } .tag.mut { background:#eceeea; color:var(--mut); }
.kpis { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:16px; }
.kpi { background:#fff; border:1px solid var(--bord); border-radius:12px; padding:14px 18px; min-width:170px; box-shadow:var(--sombra); border-top:3px solid var(--acc); }
.kpi .v { font-size:22px; font-weight:700; letter-spacing:-.01em; } .kpi .l { font-size:12px; color:var(--mut); }
pre.log { background:#111813; color:#cfe6d5; padding:12px 14px; border-radius:6px; font-size:12px; max-height:320px; overflow:auto; white-space:pre-wrap; }
.pag { display:flex; gap:6px; align-items:center; margin-top:12px; font-size:13px; }
.pag a { padding:4px 8px; border:1px solid var(--bord); border-radius:5px; text-decoration:none; color:var(--txt); background:#fff; }
.linha-acao { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.aviso { color:var(--mut); font-size:12px; }
.wrap { overflow-x:auto; }
table.dados td, table.dados th { white-space:nowrap; padding:5px 7px; font-size:12.5px; }
table.dados td.trunc { max-width:220px; overflow:hidden; text-overflow:ellipsis; }
table.dados td.trunc.curto { max-width:150px; }
.linha-acao form { display:flex; gap:6px; align-items:center; }

/* fluxo de caixa: colunas PREVISTO esmaecidas, totais destacados, primeiras colunas fixas ao rolar */
table.fluxo td.prev, table.fluxo th.prev { opacity:.55; }
table.fluxo td.tot, table.fluxo th.tot { background:rgba(240,138,29,.08); font-weight:600; }
table.fluxo tr.cab th { border-bottom:0; padding-top:2px; padding-bottom:2px; }
table.fluxo tr.cab:nth-child(3) th { border-bottom:2px solid var(--bord); }
table.fluxo .fx1 { position:sticky; left:-22px; width:54px; min-width:54px; box-sizing:border-box; background:#fff; z-index:2; }
table.fluxo .fx2 { overflow:hidden; text-overflow:ellipsis; position:sticky; left:32px; width:300px; min-width:300px; max-width:300px; box-sizing:border-box; background:#fff; z-index:2; box-shadow:4px 0 6px -4px rgba(0,0,0,.25); }
table.fluxo tr.r-grupo, table.fluxo tr.r-grupo .fx1, table.fluxo tr.r-grupo .fx2 { font-weight:700; background:var(--sub-bg); }
table.fluxo tr.r-sub, table.fluxo tr.r-sub .fx1, table.fluxo tr.r-sub .fx2 { font-weight:600; background:#f3f5f8; }
table.fluxo tr.r-calc, table.fluxo tr.r-calc .fx1, table.fluxo tr.r-calc .fx2 { font-weight:700; background:var(--tot-bg); }
table.fluxo tr.r-acum, table.fluxo tr.r-acum .fx1, table.fluxo tr.r-acum .fx2 { font-weight:700; background:#fdebd3; }
table.fluxo tr.r-conf { font-style:italic; color:#555; }
table.fluxo tr.r-grupo td.tot, table.fluxo tr.r-calc td.tot, table.fluxo tr.r-acum td.tot { background:rgba(240,138,29,.16); }
table.fluxo th { position:static; }

/* econômico-financeiro */
table.ef td.rot { white-space:nowrap; }
table.ef .cab { display:block; font-size:9.5px; letter-spacing:.06em; color:var(--mut); margin-top:6px; }
table.ef tr.r-tot td { font-weight:600; background:#f3f5f8; }
table.ef tr.r-res td { font-weight:700; background:var(--tot-bg); }
table.ef tr.r-pct td { font-style:italic; color:#555; }
table.ef tr.ind td.rot { color:#333; }
.barra { display:flex; gap:8px; align-items:center; margin:0 0 14px; }
.barra input { padding:6px 9px; border:1px solid var(--bord); border-radius:6px; font:inherit; }
details.obra { border-top:1px solid var(--bord); padding:6px 0; }
details.obra summary { cursor:pointer; padding:6px 4px; font-weight:600; list-style:none; display:flex; gap:10px; align-items:baseline; }
details.obra summary::before { content:"▸"; color:var(--mut); font-size:11px; }
details.obra[open] summary::before { content:"▾"; }
details.obra summary .resumo { font-weight:400; color:var(--mut); font-size:12px; margin-left:auto; white-space:nowrap; }
details.obra table { margin:4px 0 10px 18px; }
table.ef th.num { white-space:normal; font-size:10.5px; line-height:1.15; vertical-align:bottom; max-width:120px; }
table.ef { width:100%; }
table.val td { padding:7px 9px; font-size:13px; }
tr.r-total td { font-weight:700; background:var(--tot-bg); border-top:2px solid #9aa3b2; }
table.lista { width:100%; } table.lista td:first-child { white-space:normal; }
.abas { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 14px; }
.abas a { padding:6px 12px; border:1px solid var(--bord); border-radius:999px; background:#fff; color:var(--txt); text-decoration:none; font-size:12.5px; }
.abas a.ativa { background:var(--txt); color:#fff; border-color:var(--txt); }
table.obras th.ano { border-bottom:1px solid var(--bord); background:#f3f5f8; text-align:center; }
table.obras td { font-size:12px; padding:3px 6px; }
.barra label { font-size:12.5px; display:flex; gap:5px; align-items:center; }
svg.graf { width:100%; height:auto; display:block; }

/* visualização somente leitura de abas da planilha */
table.grade { border-collapse:collapse; font-size:12px; }
table.grade th, table.grade td { border:1px solid #e3e6e3; padding:3px 6px; white-space:nowrap; max-width:320px; overflow:hidden; text-overflow:ellipsis; }
table.grade th { background:#f3f5f8; color:#556; font-weight:600; text-align:center; position:sticky; top:0; }
table.grade td.rn { background:#f3f5f8; color:#889; text-align:right; }
table.grade td.n { text-align:right; font-variant-numeric:tabular-nums; }
table.grade td.t { text-align:left; }
table.grade tr:hover td { background:#fbfcf9; }
.metod h2 { font-size:16px; margin:22px 0 8px; }
.metod p, .metod li { line-height:1.5; }
/* metodologia: fluxograma do resultado */
.fluxo { display:flex; align-items:center; gap:7px; min-width:max-content; padding:6px 4px; }
.fluxo .cx { width:100px; min-height:44px; display:flex; align-items:center; justify-content:center; text-align:center; padding:6px 8px; font-size:10px; font-weight:700; border:1px solid rgba(0,0,0,.25); box-shadow:2px 2px 3px rgba(0,0,0,.18); line-height:1.25; }
.fluxo .c1 { background:#9aa5b1; color:#111; } .fluxo .c2 { background:#ff0000; color:#fff; } .fluxo .ck { background:#000; color:#fff; }
.fluxo .cg { background:#00b050; color:#fff; } .fluxo .cb { background:#00b0f0; color:#fff; } .fluxo .co { background:#f4a03c; color:#111; } .fluxo .cl { background:#9dc3e6; color:#111; }
.fluxo .op { font-size:18px; font-weight:700; color:#333; width:14px; text-align:center; }
.fluxo .pilha { display:flex; flex-direction:column; gap:14px; }
.grupos-cc { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:14px; }
.gcc { border:1px solid var(--bord); border-radius:6px; overflow:hidden; }
.gcc-t { padding:7px 10px; font-size:12px; font-weight:700; color:#fff; background:#ff0000; }
.gcc-t.g1 { background:#9aa5b1; color:#111; } .gcc-t.g8 { background:#f4a03c; color:#111; } .gcc-t.g9 { background:#9dc3e6; color:#111; }
.gcc table.dados td { border-bottom:1px solid #eef0ee; }

.form-cad { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-start; font-size:13px; }
.form-cad label { display:inline-block; color:var(--mut); font-size:12px; }
.form-cad input, .form-cad select { padding:6px 8px; border:1px solid var(--bord); border-radius:6px; font-size:13px; }
/* cadastro de orçamentos */
.orc-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:12px; margin-top:12px; }
.orc-bloco { border:1px solid var(--bord); border-radius:6px; padding:8px 10px; display:flex; flex-direction:column; gap:6px; }
.orc-bloco-t { font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:var(--mut); font-weight:700; }
table.orc td.calc, table.orc th.calc { background:#f3f5f8; font-weight:600; }
table.orc tr.r-tot td { border-top:2px solid #cfd8cf; font-weight:700; background:#fafbf9; }
/* backlog de fábrica: grade editável */
table.bk input.cel { width:62px; text-align:right; font-size:11.5px; padding:2px 4px; border:1px solid var(--bord); border-radius:4px; background:#fff; }
table.bk input.cel:focus { outline:2px solid rgba(240,138,29,.4); border-color:var(--acc); }
table.bk th { position:static; }
table.bk td, table.bk th { padding:3px 4px; font-size:12px; }
table.bk th:last-child, table.bk td:last-child { position:sticky; right:0; background:#fff; box-shadow:-6px 0 8px -6px rgba(0,0,0,.18); }
table.bk th:last-child { background:#f8f9fb; }
table.bk tr.r-tot td:last-child { background:inherit; }
table.bk th:first-child, table.bk td:first-child { position:sticky; left:0; background:#fff; z-index:1; box-shadow:6px 0 8px -6px rgba(0,0,0,.18); }
table.bk th:first-child { background:#f8f9fb; }
table.bk a.ed-col { font-size:10px; font-weight:400; color:var(--acc); text-decoration:none; border:1px solid var(--bord); border-radius:4px; padding:0 5px; }
table.bk a.ed-col:hover { background:var(--edit-bg); }

/* tema: elementos comuns */
.tag { letter-spacing:.01em; }
.chip { border-radius:999px !important; }
td.calc, th.calc { background:#f8f9fb; }
details.obra summary:hover { background:#f9fafb; border-radius:6px; }
.card.wrap table th { position:sticky; top:0; }
.sidebar .grp-tg, .sidebar .sec-tg { color:#8b919a; }

/* títulos dos gráficos: centralizados, fora do SVG (editáveis pelo ✎) */
.card > h2.g-tit{text-align:center;font-size:15px;margin:2px 0 8px}
