/* GoCode Projetos: quadro kanban, tarefas, avatares, etiquetas, busca rápida, cronograma (Gantt), markdown e avisos.
   Usa as variáveis do tema (--kt-*), que o dark.css redefine no modo escuro. */

.text-purple { color: #7c3aed !important; }
[data-bs-theme=dark] .text-purple { color: #a78bfa !important; }
.badge-light-purple { color: #7c3aed; background: #f1e9ff; }
[data-bs-theme=dark] .badge-light-purple { color: #c4b5fd; background: #2e2547; }

/* ---------- topo: busca e cronômetro ---------- */
.app-busca-btn { display: inline-flex; align-items: center; gap: 6px; }
.app-busca-btn kbd { background: rgba(255, 255, 255, .2); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; box-shadow: none; }
.app-timer { background: rgba(0, 0, 0, .22); border-radius: 20px; padding: 3px 12px; font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; }

/* ---------- avatares ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; line-height: 1; user-select: none; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-md { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-vazio { background: var(--kt-gray-200, #eff2f5); color: var(--kt-gray-500, #a1a5b7); border: 1px dashed var(--kt-gray-400, #b5b5c3); }
.avatar-pilha { display: inline-flex; }
.avatar-pilha .avatar { box-shadow: 0 0 0 2px var(--bs-body-bg, #fff); }
.avatar-pilha .avatar + .avatar { margin-left: -7px; }

/* ---------- etiquetas e chips ---------- */
.etq { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; color: var(--etq); background: color-mix(in srgb, var(--etq) 13%, transparent); white-space: nowrap; }
.chip-cor { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; color: var(--kt-gray-600, #7e8299); font-weight: 600; white-space: nowrap; }
a.codigo:hover { color: var(--kt-primary, #009ef7); }

/* ---------- abas do projeto ---------- */
.pj-cabeca { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.pj-cabeca .pj-icone { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.pj-abas { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--kt-gray-300, #e4e6ef); margin-bottom: 22px; scrollbar-width: thin; }
.pj-abas a { padding: 10px 14px; color: var(--kt-gray-600, #7e8299); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pj-abas a:hover { color: var(--kt-gray-900, #181c32); }
.pj-abas a.active { color: var(--kt-primary, #009ef7); border-bottom-color: var(--kt-primary, #009ef7); }
.pj-abas .bi { margin-right: 4px; }

/* ---------- quadro kanban ---------- */
.quadro { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; scrollbar-width: thin; }
.quadro-col { flex: 0 0 290px; background: var(--kt-gray-100, #f5f8fa); border: 1px solid var(--kt-gray-200, #eff2f5); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.quadro-col-cab { padding: 10px 12px 8px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.quadro-col-cab .qtd { color: var(--kt-gray-500, #a1a5b7); font-weight: 600; }
.quadro-col-cab .wip { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 8px; background: var(--kt-gray-200, #eff2f5); color: var(--kt-gray-600); }
.quadro-col.estourou .quadro-col-cab .wip { background: #fde7e7; color: #c0262c; }
.quadro-col.estourou { border-color: #f5b5b8; }
.quadro-lista { flex: 1; overflow-y: auto; padding: 4px 8px 8px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.quadro-add { margin: 0 8px 8px; }
.cartao { background: var(--bs-body-bg, #fff); border: 1px solid var(--kt-gray-200, #eff2f5); border-radius: 10px; padding: 10px 11px; cursor: grab; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); color: inherit; display: block; position: relative; }
.cartao:hover { border-color: var(--kt-gray-400, #b5b5c3); color: inherit; }
.cartao:focus-visible { outline: 2px solid var(--kt-primary, #009ef7); outline-offset: 1px; }
.cartao.feita .cartao-titulo { color: var(--kt-gray-500, #a1a5b7); text-decoration: line-through; }
.cartao.bloqueada { border-left: 3px solid #e5484d; }
.cartao-titulo { font-weight: 500; font-size: 13.5px; line-height: 1.35; margin: 3px 0 7px; word-break: break-word; }
.cartao-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--kt-gray-600, #7e8299); flex-wrap: wrap; }
.cartao-meta .push { margin-left: auto; }
.cartao-pontos { font-size: 11px; font-weight: 700; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--kt-gray-200, #eff2f5); color: var(--kt-gray-700); display: inline-flex; align-items: center; justify-content: center; }
.cartao-fantasma { opacity: .4; border-style: dashed; }
.cartao-arrastando { transform: rotate(2deg); box-shadow: 0 12px 28px rgba(16, 24, 40, .18); }
.quadro-raia { margin-bottom: 18px; }
.quadro-raia-cab { font-weight: 700; font-size: 13px; margin: 0 0 8px 2px; display: flex; align-items: center; gap: 8px; }

/* ---------- lista de tarefas ---------- */
.lista-tarefas td { vertical-align: middle; }
.lista-tarefas .tit { font-weight: 500; }
.lista-tarefas tr.feita .tit { color: var(--kt-gray-500); text-decoration: line-through; }
.grupo-cab td { background: var(--kt-gray-100, #f5f8fa) !important; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--kt-gray-700); }

/* ---------- tarefa ---------- */
.tarefa-lado .item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--kt-gray-200, #eff2f5); font-size: 13px; }
.tarefa-lado .item > span:first-child { color: var(--kt-gray-600); flex: none; width: 110px; }
.tarefa-lado .item .form-select, .tarefa-lado .item .form-control { max-width: 190px; }
.titulo-editavel { border: 1px solid transparent; background: transparent; font-size: 1.45rem; font-weight: 700; width: 100%; padding: 2px 6px; margin-left: -6px; border-radius: 6px; color: inherit; }
.titulo-editavel:hover { border-color: var(--kt-gray-300); }
.titulo-editavel:focus { border-color: var(--kt-primary); outline: 0; background: var(--bs-body-bg); }
.check-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.check-item.feito label { text-decoration: line-through; color: var(--kt-gray-500); }
.check-item .remover { opacity: 0; }
.check-item:hover .remover { opacity: 1; }
.historico { list-style: none; padding: 0; margin: 0; }
.historico li { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--kt-gray-700); }
.historico li .quando { margin-left: auto; color: var(--kt-gray-500); white-space: nowrap; font-size: 12px; }
.comentario { display: flex; gap: 12px; margin-bottom: 16px; }
.comentario-corpo { flex: 1; background: var(--kt-gray-100, #f5f8fa); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.comentario-corpo .cab { font-size: 12px; color: var(--kt-gray-600); margin-bottom: 4px; }
.comentario:target .comentario-corpo { box-shadow: 0 0 0 2px var(--kt-primary, #009ef7); }
.mencao { color: var(--kt-primary, #009ef7); font-weight: 600; background: color-mix(in srgb, var(--kt-primary, #009ef7) 10%, transparent); border-radius: 4px; padding: 0 3px; }
.git-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--kt-gray-200); }
.git-item code { font-size: 12px; }

/* ---------- markdown ---------- */
.md { line-height: 1.6; word-break: break-word; }
.md p { margin: 0 0 .6em; }
.md p:last-child { margin-bottom: 0; }
.md .md-h { font-weight: 700; margin: 1em 0 .45em; }
.md h3.md-h { font-size: 1.25rem; } .md h4.md-h { font-size: 1.1rem; } .md h5.md-h, .md h6.md-h { font-size: 1rem; }
.md .md-h:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 .7em; }
.md ul.md-check { list-style: none; padding-left: .2em; }
.md ul.md-check li.feito { color: var(--kt-gray-500); text-decoration: line-through; }
.md code { background: var(--kt-gray-200, #eff2f5); padding: 1px 5px; border-radius: 4px; font-size: .88em; color: #d63384; }
.md .md-pre { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; margin: 0 0 .8em; }
.md .md-pre code { background: none; color: inherit; padding: 0; }
.md .md-citacao { border-left: 3px solid var(--kt-gray-300); padding: 2px 12px; color: var(--kt-gray-700); margin: 0 0 .7em; }
.md .md-tabela { font-size: 13px; width: auto; }
.md a { text-decoration: underline; }
.md a.tarefa-ref { text-decoration: none; font-weight: 600; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }

/* ---------- cronograma (Gantt) ---------- */
.gantt { position: relative; overflow-x: auto; border: 1px solid var(--kt-gray-200, #eff2f5); border-radius: 10px; background: var(--bs-body-bg, #fff); }
.gantt-grade { display: grid; min-width: max-content; position: relative; }
.gantt-cab { position: sticky; top: 0; z-index: 3; background: var(--kt-gray-100, #f5f8fa); display: contents; }
.gantt-c-nome { position: sticky; left: 0; z-index: 2; background: var(--bs-body-bg, #fff); border-right: 1px solid var(--kt-gray-200); padding: 6px 10px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; min-height: 34px; }
.gantt-c-nome.fase { font-weight: 700; background: var(--kt-gray-100, #f5f8fa); }
.gantt-c-mes { font-size: 11px; font-weight: 700; color: var(--kt-gray-600); text-transform: uppercase; padding: 6px 0 6px 4px; border-left: 1px solid var(--kt-gray-200); background: var(--kt-gray-100); white-space: nowrap; }
.gantt-c-dias { position: relative; border-bottom: 1px solid var(--kt-gray-200, #eff2f5); min-height: 34px; }
.gantt-dia-fds { position: absolute; top: 0; bottom: 0; background: var(--kt-gray-100, #f5f8fa); }
.gantt-hoje-linha { position: absolute; top: 0; bottom: 0; width: 2px; background: #e5484d; z-index: 1; }
.gantt-bar { position: absolute; top: 7px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--cor, #3e97ff) 25%, transparent); border: 1px solid var(--cor, #3e97ff); overflow: hidden; display: flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--kt-gray-900); padding: 0 6px; white-space: nowrap; }
.gantt-bar .pct { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cor, #3e97ff); opacity: .5; }
.gantt-bar span { position: relative; }
.gantt-bar.fase { height: 12px; top: 11px; border-radius: 3px; background: var(--cor, #475569); border: 0; }
.gantt-bar.marco { width: 14px !important; height: 14px; top: 10px; transform: rotate(45deg); border-radius: 2px; padding: 0; background: #ca8a04; border: 0; }
.gantt-bar.atrasada { --cor: #e5484d; }
/* linha de base (planejado): barra fina cinza embaixo da barra real */
.gantt-bar.base { top: auto; bottom: 3px; height: 5px; padding: 0; border: 0; border-radius: 3px; background: #94a3b8; opacity: .85; pointer-events: none; }
.gantt-bar.critica { box-shadow: 0 0 0 2px #e5484d; }
.gantt-bar.marco.contrato { background: #7c3aed; }
.gantt-bar.marco.contrato.risco { background: #e5484d; }
.pj-desvio { font-size: 11px; font-weight: 700; margin-left: auto; padding-left: 6px; }

/* ---------- burndown e gráficos simples ---------- */
.grafico-svg { width: 100%; height: auto; display: block; }
.grafico-svg .eixo { stroke: var(--kt-gray-300, #e4e6ef); stroke-width: 1; }
.grafico-svg .grade { stroke: var(--kt-gray-200, #eff2f5); stroke-width: 1; }
.grafico-svg text { fill: var(--kt-gray-600, #7e8299); font-size: 11px; font-family: inherit; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--kt-gray-700); }
.legenda i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.cfd-faixa { display: flex; height: 26px; border-radius: 6px; overflow: hidden; }
.cfd-faixa span { display: block; height: 100%; }

/* ---------- semana de horas ---------- */
.semana td, .semana th { text-align: center; white-space: nowrap; }
.semana td:first-child, .semana th:first-child { text-align: left; white-space: normal; }
.semana .hoje { background: color-mix(in srgb, var(--kt-primary, #009ef7) 8%, transparent) !important; }
.carga-barra { position: relative; height: 10px; border-radius: 5px; background: var(--kt-gray-200, #eff2f5); overflow: hidden; }
.carga-barra span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }

/* ---------- busca rápida (Ctrl+K) ---------- */
.pj-paleta { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.pj-paleta[hidden] { display: none; }
.pj-paleta-caixa { width: 100%; max-width: 640px; background: var(--bs-body-bg, #fff); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); overflow: hidden; }
.pj-paleta-busca { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--kt-gray-200); }
.pj-paleta-busca input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: inherit; }
.pj-paleta-busca kbd, .pj-paleta-rodape kbd { font-size: 10px; background: var(--kt-gray-200); color: var(--kt-gray-700); box-shadow: none; padding: 1px 5px; }
.pj-paleta-lista { max-height: 55vh; overflow-y: auto; padding: 6px; }
.pj-paleta-item { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 10px; border-radius: 8px; color: inherit; }
.pj-paleta-item .bi { grid-row: span 2; align-self: center; color: var(--kt-gray-500); }
.pj-paleta-item.ativo { background: var(--kt-primary-light, #f1faff); }
.pj-paleta-item.ativo .bi { color: var(--kt-primary); }
.pj-paleta-titulo { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-paleta-sub { font-size: 12px; color: var(--kt-gray-500); }
.pj-paleta-vazio { padding: 22px; text-align: center; color: var(--kt-gray-500); }
.pj-paleta-rodape { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--kt-gray-200); font-size: 11px; color: var(--kt-gray-500); flex-wrap: wrap; }

/* ---------- avisos rápidos ---------- */
.pj-avisos { position: fixed; right: 16px; bottom: 16px; z-index: 2100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.pj-aviso { padding: 10px 16px; border-radius: 10px; color: #fff; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); transition: opacity .35s, transform .35s; max-width: 380px; }
.pj-aviso-success { background: #15803d; } .pj-aviso-danger { background: #c0262c; } .pj-aviso-warning { background: #a16207; } .pj-aviso-info { background: #1d4ed8; }
.pj-aviso.sumindo { opacity: 0; transform: translateY(8px); }

/* ---------- cartões de projeto ---------- */
.pj-card { border-top: 4px solid var(--cor, #7c3aed); }
.pj-card .pj-numeros { display: flex; gap: 16px; font-size: 12px; color: var(--kt-gray-600); flex-wrap: wrap; }
.pj-card .pj-numeros b { color: var(--kt-gray-900); font-size: 14px; }
.modelo-opcao { cursor: pointer; border: 2px solid var(--kt-gray-200); border-radius: 12px; padding: 14px; height: 100%; display: block; transition: border-color .15s; }
.modelo-opcao:hover { border-color: var(--kt-gray-400); }
input:checked + .modelo-opcao { border-color: var(--kt-primary, #009ef7); background: var(--kt-primary-light, #f1faff); }
.fase-linha { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--kt-gray-200); }
.fase-num { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--kt-gray-200); color: var(--kt-gray-700); }
.fase-num.andamento { background: var(--kt-primary); color: #fff; }
.fase-num.concluida { background: #15803d; color: #fff; }
.fase-num.aprovacao { background: #ca8a04; color: #fff; }
.risco-matriz { display: grid; grid-template-columns: 60px repeat(3, 1fr); gap: 4px; font-size: 12px; }
.risco-matriz div { border-radius: 6px; padding: 8px; text-align: center; min-height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

@media (max-width: 767px) {
  .quadro-col { flex-basis: 82vw; max-height: none; }
  .tarefa-lado .item > span:first-child { width: 90px; }
  .gantt-c-nome { max-width: 150px; }
}
@media print {
  .app-header, .pj-abas, .btn, footer { display: none !important; }
}
