* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #14281f; background: #f4f8f5; font-size: 15px; }
a { color: #1f7a4d; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: .2em 0; font-size: 1.6rem; }
h2 { margin: 0 0 .6em; font-size: 1.05rem; }
.sub { color: #5c6e64; font-size: .85rem; margin: .2em 0; }

.topo { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #1f4e3d; color: #fff; }
.topo a { color: #fff; }
.topo .marca { display: flex; align-items: center; gap: 8px; font-family: Montserrat, Poppins, Inter, system-ui, sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; text-transform: lowercase; }
.topo .marca:hover { text-decoration: none; }
h1, h2 { font-family: Montserrat, Poppins, Inter, system-ui, sans-serif; color: #1f4e3d; }
.logo-login { margin: 0 0 4px; }
.logo-login img { max-width: 100%; height: auto; display: block; }
.topo nav { flex: 1; display: flex; gap: 16px; }
.topo .sessao { font-size: .9rem; }
.topo .perfil { opacity: .7; }
.topo .sessao { display: flex; align-items: center; gap: 4px; }
.idiomas { display: inline-flex; gap: 2px; margin-right: 12px; }
.idiomas button.link { padding: 2px 6px; border-radius: 6px; font-size: .8rem; letter-spacing: .05em; opacity: .75; }
.idiomas button.link.ativo { opacity: 1; font-weight: 700; background: rgba(255,255,255,.14); color: #fff; }
.idiomas-fora { display: flex; justify-content: flex-end; padding: 12px 24px 0; }
.idiomas-fora button.link { color: #1f4e3d; }
.idiomas-fora button.link.ativo { background: #ddefe4; color: #1f4e3d; }
.inline { display: inline; }
button.link { background: none; border: 0; color: #9be3b9; cursor: pointer; font: inherit; padding: 0 0 0 8px; }

.conteudo { max-width: 1200px; margin: 0 auto; padding: 24px; }
.cabecalho { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 16px; }

.cartao { background: #fff; border: 1px solid #d5e3da; border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.grelha { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grelha .cartao { margin: 0; }

.login { max-width: 380px; margin: 10vh auto; }
.login label { display: flex; flex-direction: column; margin-bottom: 12px; }
.login input { width: 100%; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: #3d5046; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #c3d4c9; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9be3b9; border-color: #2f9e68; }

.formulario fieldset { border: 0; border-top: 1px solid #d5e3da; padding: 14px 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.formulario legend { font-weight: 600; padding-right: 8px; }
.formulario .largo { grid-column: 1 / -1; }
.erro { color: #b91c1c; font-size: .8rem; }

.botao { display: inline-block; background: #1f4e3d; color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; font: inherit; }
.botao:hover { background: #143529; text-decoration: none; }
.botao.secundario { background: #d5e3da; color: #14281f; }

.filtros { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filtros input[type=search] { flex: 1; min-width: 220px; }

.tabela { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #d5e3da; border-radius: 8px; overflow: hidden; }
.tabela th, .tabela td { padding: 10px 12px; border-bottom: 1px solid #d5e3da; text-align: left; vertical-align: top; }
.tabela th { background: #eaf3ed; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #5c6e64; }
.tabela tfoot td { font-weight: 600; background: #f6faf7; }
.num { text-align: right !important; white-space: nowrap; }

.etiqueta { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #d5e3da; vertical-align: middle; }
.estado-em_execucao { background: #ddefe4; color: #143529; }
.estado-aprovado { background: #dcfce7; color: #166534; }
.estado-candidatura { background: #fef9c3; color: #854d0e; }
.estado-encerramento { background: #ffedd5; color: #9a3412; }
.estado-encerrado { background: #e5e7eb; color: #374151; }
.estado-nao_aprovado { background: #fee2e2; color: #991b1b; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dt { color: #5c6e64; }
dd { margin: 0; font-weight: 500; }
.barra { height: 8px; background: #d5e3da; border-radius: 4px; margin-top: 12px; overflow: hidden; }
.barra div { height: 100%; background: #2f9e68; }

.alerta { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.alerta-ok { background: #dcfce7; color: #166534; }
.alerta-erro { background: #fee2e2; color: #991b1b; }
.alerta-aviso { background: #fef9c3; color: #854d0e; }
.vazio { padding: 40px; text-align: center; color: #5c6e64; background: #fff; border: 1px dashed #c3d4c9; border-radius: 8px; }

/* ---------- Passo 2: utilizadores ---------- */
.cartao h2 { font-size: 1.05rem; margin: 0 0 12px; }
.separadores { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #d5e3da; }
.separadores a { padding: 8px 14px; color: #5c6e64; border-bottom: 2px solid transparent; }
.separadores a.atual { color: #1f7a4d; border-bottom-color: #1f7a4d; font-weight: 600; }
.conta-ativo { background: #dcfce7; color: #166534; }
.conta-convite { background: #ddefe4; color: #143529; }
.conta-expirado { background: #fef9c3; color: #854d0e; }
.conta-bloqueado { background: #ffedd5; color: #9a3412; }
.conta-inativo { background: #e5e7eb; color: #374151; }
.opcoes { display: grid; gap: 8px; }
.opcao { display: flex; gap: 8px; align-items: baseline; font-weight: normal; }
.opcao input { width: auto; }
.detalhes { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.detalhes dt { color: #5c6e64; }
.detalhes dd { margin: 0; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.botao.perigo { background: #fee2e2; color: #991b1b; }
.botao.perigo:hover { background: #fecaca; }
.formulario > label { display: block; margin-bottom: 12px; }
.formulario .opcoes label.opcao { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; align-items: center; margin: 0; }
.formulario .opcoes label.opcao input { width: auto; margin: 0; }
.formulario .opcoes label.opcao .sub { grid-column: 2; margin: 0; }
.login .sub { margin-bottom: 14px; }

/* ---------- Passo 3: consórcio e orçamento ---------- */
.etiqueta-ls { background: #ede9fe; color: #5b21b6; }
.etiqueta-coord { background: #fef3c7; color: #92400e; }
.etiqueta-propria { background: #ddefe4; color: #143529; }
.versao-rascunho { background: #fef9c3; color: #854d0e; }
.versao-em_vigor { background: #dcfce7; color: #166534; }
.versao-substituida { background: #e5e7eb; color: #374151; }
.titulo-parceiro { font-size: 1.3rem; margin: 0; }
.lista-simples { list-style: none; padding: 0; margin: 0 0 12px; }
.lista-simples li { padding: 8px 0; border-bottom: 1px solid #eef3f0; }
.mini-acoes { font-size: .8rem; margin-left: 6px; }
.link-perigo { background: none; border: 0; color: #b91c1c; cursor: pointer; font: inherit; font-size: .8rem; padding: 0 0 0 6px; }
.mini-form { display: grid; gap: 6px; border-top: 1px solid #d5e3da; padding-top: 10px; }
.opcao-linha { flex-direction: row; align-items: center; gap: 6px; }
.opcao-linha input { width: auto; }
.rolar { overflow-x: auto; }
.tabela.compacta th, .tabela.compacta td { padding: 6px 8px; font-size: .85rem; }
.tabela.compacta th .sub { text-transform: none; letter-spacing: 0; font-weight: normal; font-size: .72rem; max-width: 110px; white-space: normal; margin-left: auto; }
.versoes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.versao { background: #fff; border: 1px solid #d5e3da; border-radius: 8px; padding: 8px 12px; color: #14281f; display: flex; gap: 8px; align-items: center; }
.versao.atual { border-color: #1f7a4d; box-shadow: 0 0 0 1px #1f7a4d; }
.versao:hover { text-decoration: none; border-color: #9be3b9; }
.faixa-rascunho { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; }
.faixa-rascunho .acoes { margin: 8px 0 0; align-items: flex-start; }
details > summary { list-style: none; cursor: pointer; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }
.inline-details[open] { flex-basis: 100%; }
.nova-versao { margin-bottom: 14px; }
.form-versao fieldset { border-top: 0; padding-top: 0; }
.separadores.pequenos a { font-size: .9rem; padding: 6px 12px; }
.em-linha { flex-direction: row; align-items: center; gap: 8px; }
.pos { color: #166534; }
.neg { color: #b91c1c; }
.grelha-edicao input.valor { width: 110px; text-align: right; padding: 5px 6px; }
.grelha-edicao input.pms { width: 70px; }
.grelha-edicao td.auto { color: #5c6e64; background: #f6faf7; }
code { background: #eaf3ed; padding: 0 4px; border-radius: 3px; }
.tabela.compacta td:first-child { white-space: nowrap; }
.grelha-edicao td:first-child { white-space: normal; min-width: 130px; }

/* ---------- Passo 4: despesas e execução ---------- */
.estado-despesa-rascunho { background: #fef9c3; color: #854d0e; }
.estado-despesa-validada { background: #dcfce7; color: #166534; }
.estado-despesa-reportada { background: #ddefe4; color: #143529; }
.estado-despesa-rejeitada { background: #fee2e2; color: #991b1b; }
.periodo-aberto { background: #dcfce7; color: #166534; }
.periodo-fechado { background: #e5e7eb; color: #374151; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtros input[type=search] { min-width: 240px; flex: 1; }
.filtros select, .filtros input { width: auto; }
.resumo-estados { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.resumo-estados .bloco { background: #fff; border: 1px solid #d5e3da; border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; color: #14281f; }
.resumo-estados .bloco span { font-size: .8rem; color: #5c6e64; }
.resumo-estados .bloco.atual { box-shadow: 0 0 0 2px #1f7a4d; }
.resumo-estados .bloco:hover { text-decoration: none; border-color: #9be3b9; }
.aviso { color: #b45309; }
.paginas { display: flex; gap: 4px; margin: 12px 0; }
.paginas a { padding: 4px 10px; border: 1px solid #d5e3da; border-radius: 4px; background: #fff; }
.paginas a.atual { background: #1f7a4d; color: #fff; border-color: #1f7a4d; }
.form-rejeitar { display: inline-flex; gap: 6px; }
.form-rejeitar input { width: 220px; }
.alerta-aviso.opcao-linha { display: flex; padding: 8px 12px; border-radius: 6px; margin: 10px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid #d5e3da; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.kpi span { font-size: .78rem; color: #5c6e64; }
.kpi strong { font-size: 1.15rem; }
.kpi em { font-style: normal; font-size: .78rem; color: #5c6e64; }
.barra-col { width: 140px; }
.barra { position: relative; height: 10px; background: #ecf4ef; border-radius: 5px; overflow: visible; min-width: 100px; }
.barra span { display: block; height: 100%; border-radius: 5px; background: #16a34a; }
.barra.abaixo span { background: #f59e0b; }
.barra.acima span { background: #dc2626; }
.barra i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #14281f; opacity: .55; }
tr.selecionada td { background: #f0f7f2; }
.alertas { list-style: none; padding: 0; margin: 0; }
.alertas li { padding: 8px 10px; border-left: 4px solid #c3d4c9; margin-bottom: 6px; background: #f6faf7; border-radius: 0 4px 4px 0; }
.alertas li.nivel-alto { border-color: #dc2626; } .alertas li.nivel-alto .etiqueta { background: #fee2e2; color: #991b1b; }
.alertas li.nivel-medio { border-color: #f59e0b; } .alertas li.nivel-medio .etiqueta { background: #fef3c7; color: #92400e; }
.alertas li.nivel-baixo { border-color: #9be3b9; } .alertas li.nivel-baixo .etiqueta { background: #ddefe4; color: #143529; }
.alertas li.nivel-info .etiqueta { background: #e5e7eb; color: #374151; }
@media (max-width: 700px) { .resumo-estados { grid-template-columns: repeat(2, 1fr); } }
.nowrap { white-space: nowrap; }

/* ---------- Passo 5: equipa e timesheets ---------- */
.ts-rascunho { background: #fef9c3; color: #854d0e; }
.ts-submetida { background: #ddefe4; color: #143529; }
.ts-aprovada { background: #dcfce7; color: #166534; }
.meses { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mes { border: 1px solid #d5e3da; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; color: #14281f; background: #fff; }
.mes:hover { text-decoration: none; border-color: #9be3b9; }
.mes span { font-size: .9rem; } .mes em { font-style: normal; font-size: .75rem; color: #5c6e64; }
.mes.ts-rascunho { border-left: 4px solid #f59e0b; } .mes.ts-submetida { border-left: 4px solid #2f9e68; } .mes.ts-aprovada { border-left: 4px solid #16a34a; }
.mes.ts-vazio { background: #f6faf7; }
.grelha-ts tr.projeto td { background: #eaf3ed; }
.grelha-ts td.wp { padding-left: 24px; }
.grelha-ts input.dias { width: 80px; text-align: right; }
tr.inativa td { color: #97aa9f; }
@media (max-width: 700px) { .meses { grid-template-columns: repeat(3, 1fr); } }
.formulario > label > input, .formulario > label > select, .formulario > label > textarea { display: block; width: 100%; margin-top: 4px; }
.formulario > label.opcao-linha > input { display: inline; width: auto; }

/* ---------- Passo 6: plano ---------- */
.gantt { border: 1px solid #d5e3da; border-radius: 6px; overflow: hidden; }
.glinha { display: grid; grid-template-columns: 280px 1fr; border-bottom: 1px solid #eef3f0; min-height: 28px; }
.glinha:last-child { border-bottom: 0; }
.gnome { padding: 5px 8px; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid #d5e3da; }
.gtask .gnome { padding-left: 22px; color: #5c6e64; }
.gtempo { position: relative; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(100%/12 - 1px), #f1f6f3 calc(100%/12 - 1px), #f1f6f3 calc(100%/12)); }
.gcab { background: #f6faf7; font-size: .72rem; color: #5c6e64; }
.gmes { position: absolute; top: 6px; }
.gbar { position: absolute; top: 7px; height: 14px; border-radius: 4px; background: #1f7a4d; }
.gbar.task { background: #9be3b9; top: 9px; height: 10px; }
.gbar.conc-concluido { background: #16a34a; } .gbar.conc-parcial { background: #f59e0b; }
.gdel, .gms { position: absolute; top: 8px; width: 12px; height: 12px; margin-left: -6px; background: #fff; border: 2px solid #374151; display: inline-block; }
.gms { transform: rotate(45deg); }
.est-aprovado.gdel, .est-aprovado.gms { background: #16a34a; border-color: #16a34a; }
.est-submetido.gdel, .est-submetido.gms { background: #2f9e68; border-color: #2f9e68; }
.est-atrasado.gdel, .est-atrasado.gms { background: #dc2626; border-color: #dc2626; }
.ghoje { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; opacity: .6; }
.legenda { font-size: .8rem; color: #5c6e64; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.legenda .gdel, .legenda .gms { position: relative; top: 0; margin: 0 2px 0 6px; }
.ghoje-leg { display: inline-block; width: 2px; height: 12px; background: #dc2626; }
.etiqueta.est-previsto { background: #e5e7eb; color: #374151; }
.etiqueta.est-em_preparacao { background: #fef9c3; color: #854d0e; }
.etiqueta.est-submetido { background: #ddefe4; color: #143529; }
.etiqueta.est-aprovado { background: #dcfce7; color: #166534; }
.etiqueta.est-rejeitado, .etiqueta.est-atrasado { background: #fee2e2; color: #991b1b; }
.conc-em_curso { background: #e5e7eb; color: #374151; } .conc-concluido { background: #dcfce7; color: #166534; } .conc-parcial { background: #fef3c7; color: #92400e; }
tr.prazo-alto td { background: #fef2f2; }
@media (max-width: 700px) { .glinha { grid-template-columns: 140px 1fr; } }

/* ---------- Passo 7: relatórios e documentos ---------- */
.rel-rascunho { background: #fef9c3; color: #854d0e; }
.rel-submetido { background: #ddefe4; color: #143529; }
.rel-conferido { background: #dcfce7; color: #166534; }
.rel-devolvido { background: #fee2e2; color: #991b1b; }
a.etiqueta:hover { text-decoration: none; filter: brightness(.95); }
textarea.texto-longo { width: 100%; font: inherit; padding: 8px; border: 1px solid #c3d4c9; border-radius: 6px; }
.texto { white-space: normal; line-height: 1.5; }
.task-rel { padding: 8px 0; border-bottom: 1px solid #eef3f0; }
.task-rel textarea { margin: 6px 0; }
.cartao h3 { font-size: .95rem; margin: 14px 0 6px; color: #1f7a4d; }
input.valor { width: 110px; text-align: right; }
.conteudo button.link { color: #1f7a4d; font-weight: 600; }
