body { background: #f4f4f2; font-family: 'Segoe UI', system-ui, sans-serif; color: #1f2328; }

/* Bootstrap tingido pelas cores da organização */
.btn-primary {
  --bs-btn-bg: var(--cor-primaria); --bs-btn-border-color: var(--cor-primaria);
  --bs-btn-hover-bg: color-mix(in srgb, var(--cor-primaria) 85%, #000);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--cor-primaria) 85%, #000);
  --bs-btn-active-bg: color-mix(in srgb, var(--cor-primaria) 75%, #000);
  --bs-btn-active-border-color: color-mix(in srgb, var(--cor-primaria) 75%, #000);
  --bs-btn-disabled-bg: var(--cor-primaria); --bs-btn-disabled-border-color: var(--cor-primaria);
}
.btn-outline-primary {
  --bs-btn-color: var(--cor-primaria); --bs-btn-border-color: var(--cor-primaria);
  --bs-btn-hover-bg: var(--cor-primaria); --bs-btn-hover-border-color: var(--cor-primaria);
  --bs-btn-active-bg: var(--cor-primaria); --bs-btn-active-border-color: var(--cor-primaria);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--cor-primaria) 20%, transparent);
}
.form-check-input:checked { background-color: var(--cor-primaria); border-color: var(--cor-primaria); }
.nav-tabs .nav-link.active { border-top: 3px solid var(--cor-destaque); font-weight: 600; }
.nav-tabs .nav-link { color: #4b5563; }
.text-destaque { color: var(--cor-primaria); }

/* Menu lateral */
#sidebar {
  width: var(--sidebar-width); height: 100vh; position: fixed; top: 0; left: 0;
  background: var(--cor-lateral); display: flex; flex-direction: column; z-index: 100;
}
#sidebar .brand { padding: 1.1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1);
  border-top: 4px solid var(--cor-destaque); }
#sidebar .brand h5 { color: #fff; font-weight: 700; margin: 0; font-size: 1rem; }
#sidebar .brand small { color: rgba(255,255,255,.6); font-size: .72rem; }
#sidebar .brand-logo { max-height: 36px; max-width: 100%; margin-bottom: .5rem; display: block; }
#sidebar .cliente-menu { padding: .75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); }
#sidebar .cliente-menu label { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: rgba(255,255,255,.5); margin-bottom: .3rem; }
#sidebar .cliente-menu .form-select { background-color: rgba(255,255,255,.1); color: #fff; font-weight: 600;
  border-color: rgba(255,255,255,.2);
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
#sidebar .cliente-menu .form-select option { color: #1e293b; background: #fff; }
#sidebar .cliente-vazio { color: #fff; font-size: .85rem; text-decoration: none; }
.cliente-tag { display: inline-block; font-weight: 600; color: var(--cor-primaria); background: color-mix(in srgb, var(--cor-primaria) 10%, #fff);
  border-radius: 4px; padding: 0 .4rem; margin-right: .25rem; }
#sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0; }
#sidebar .nav-section { padding: .9rem 1.25rem .3rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); }
#sidebar .nav-link { color: rgba(255,255,255,.78); padding: .5rem 1.25rem; font-size: .9rem;
  display: flex; gap: .6rem; align-items: center; border-left: 3px solid transparent; }
#sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
#sidebar .nav-link.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--cor-destaque); }
#sidebar .sidebar-user { padding: .9rem 1.25rem; border-top: 1px solid rgba(255,255,255,.1);
  color: #fff; font-size: .85rem; }
#sidebar .sidebar-user small, #sidebar .sidebar-user a { color: rgba(255,255,255,.65); text-decoration: none; }
#sidebar .sidebar-user a:hover { color: #fff; }
#conteudo { margin-left: var(--sidebar-width); padding: 1.75rem 2rem 3rem; max-width: 1400px; transition: margin-left .15s; }

/* Grupos do menu recolhíveis */
#sidebar .nav-section.alternar { display: flex; width: 100%; justify-content: space-between; align-items: center;
  background: none; border: 0; text-align: left; cursor: pointer; }
#sidebar .nav-section.alternar:hover { color: rgba(255,255,255,.8); }
#sidebar .nav-section.alternar .bi { font-size: .7rem; transition: transform .15s; }
#sidebar .nav-grupo.fechado .nav-section.alternar .bi { transform: rotate(-90deg); }
#sidebar .nav-grupo.fechado .nav-itens { display: none; }

/* Botão para recolher o painel */
#sidebar { transition: width .15s; }
#sidebar .brand { position: relative; }
#sidebar .brand h5 { padding-right: 26px; }
#recolher-menu { position: absolute; top: .7rem; right: .5rem; width: 28px; height: 28px; border-radius: 6px;
  background: none; border: 0; color: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; }
#recolher-menu:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Painel recolhido: só os ícones (o nome aparece ao passar o mouse); no celular o menu já vai para o topo */
@media (min-width: 901px) {
html.menu-recolhido { --sidebar-width: 60px; }
html.menu-recolhido #sidebar .brand { padding: 1.1rem 0 .6rem; min-height: 52px; }
html.menu-recolhido #sidebar .brand h5, html.menu-recolhido #sidebar .brand small, html.menu-recolhido #sidebar .brand-logo,
html.menu-recolhido #sidebar .cliente-menu, html.menu-recolhido #sidebar .nav-section,
html.menu-recolhido #sidebar .projeto-menu-nome, html.menu-recolhido #sidebar .rot,
html.menu-recolhido #sidebar .sidebar-user .fw-semibold, html.menu-recolhido #sidebar .sidebar-user small { display: none; }
html.menu-recolhido #recolher-menu { position: static; margin: 0 auto; }
html.menu-recolhido #recolher-menu .bi { transform: rotate(180deg); }
html.menu-recolhido #sidebar .nav-grupo.fechado .nav-itens { display: block; }
html.menu-recolhido #sidebar .nav-grupo + .nav-grupo { border-top: 1px solid rgba(255,255,255,.08); margin-top: .3rem; padding-top: .3rem; }
html.menu-recolhido #sidebar .nav-link { justify-content: center; padding: .55rem 0; font-size: 1.05rem; }
html.menu-recolhido #sidebar .sidebar-user { padding: .7rem 0; text-align: center; font-size: 1rem; }
}

@media (max-width: 900px) {
  #recolher-menu { display: none !important; }
  #sidebar .nav-grupo, #sidebar .nav-grupo.fechado .nav-itens, #sidebar .nav-itens { display: contents; }
  #sidebar { position: static; width: 100%; height: auto; }
  #sidebar-nav { display: flex; flex-wrap: wrap; }
  #sidebar .nav-section, #sidebar .sidebar-user { display: none; }
  #conteudo { margin-left: 0; padding: 1rem; }
}

/* Componentes */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-header .sub { color: #6b7280; font-size: .9rem; }
.card { border: 1px solid #e5e4df; border-radius: 10px; box-shadow: none; }
.card-header { background: #fff; font-weight: 600; border-bottom-color: #ecebe6; }
.badge-opcao { font-weight: 600; font-size: .75rem; padding: .3em .6em; border-radius: 6px; }
.stat { border-left: 4px solid var(--cor-destaque); }
.stat .valor { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat .rotulo { color: #6b7280; font-size: .85rem; }
.table > :not(caption) > * > * { padding: .6rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280;
  font-weight: 600; background: #fafaf8; }
.dl-dados dt { color: #6b7280; font-weight: 500; font-size: .82rem; }
.dl-dados dd { margin-bottom: .75rem; }
.texto-longo { white-space: pre-line; }
.vazio { color: #6b7280; text-align: center; padding: 2rem 1rem; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 400px; border-top: 4px solid var(--cor-destaque); }

/* Matriz de riscos 5×5 */
.matriz-wrap { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; gap: .25rem .5rem; }
.matriz-eixo-y { grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
  font-size: .78rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.matriz-eixo-x { grid-column: 2; text-align: center; font-size: .78rem; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: .05em; }
.matriz { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.matriz td { height: 72px; border-radius: 8px; padding: 0; vertical-align: middle; text-align: center; }
.matriz-wrap.compacta .matriz td { height: 44px; }
.matriz-media .matriz { width: 300px; border-spacing: 3px; }
.matriz-media .matriz td { height: 46px; border-radius: 6px; }
.matriz-media .matriz-qtd { font-size: 1rem; }
.matriz-media .matriz-codigos { font-size: .6rem; margin-top: .1rem; }
.matriz-media .matriz-vazia { font-size: .7rem; }
.matriz-media .matriz-eixo-x, .matriz-media .matriz-eixo-y { font-size: .68rem; }
.resumo-riscos .list-group-item { padding: .45rem .9rem; }
.resumo-riscos .active-nivel { background: #f4f3ef; font-weight: 600; }
.matriz td.marcada { outline: 3px solid #1f2328; outline-offset: -3px; }
.matriz-rotulo { width: 28px; text-align: center; font-size: .8rem; color: #6b7280; font-weight: 600; }
.matriz-celula { display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: #1f2328; text-decoration: none; padding: .25rem; }
a.matriz-celula:hover { background: rgba(0,0,0,.07); border-radius: 8px; color: #1f2328; }
.matriz-qtd { font-size: 1.35rem; font-weight: 700; line-height: 1; }
.matriz-codigos { font-size: .68rem; line-height: 1.2; margin-top: .2rem; word-break: break-word; }
.matriz-vazia { color: rgba(31,35,40,.35); font-size: .8rem; }
.legenda-cor { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.risco-frase { border-left: 3px solid var(--cor-destaque); padding-left: .9rem; }

/* Linha do tempo dos marcos */
.tl { --tl-nome: 240px; }
.tl-regua { position: relative; height: 22px; margin-left: var(--tl-nome); border-bottom: 1px solid #e5e4df; }
.tl-mes { position: absolute; top: 0; transform: translateX(-50%); font-size: .72rem; color: #6b7280; white-space: nowrap; }
.tl-linha { display: flex; align-items: center; height: 30px; border-bottom: 1px dashed #efeee9; }
.tl-nome { width: var(--tl-nome); flex: none; font-size: .82rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; padding-right: .75rem; }
.tl-trilha { position: relative; flex: 1; height: 100%; }
.tl-hoje { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--cor-destaque); }
.tl-desvio { position: absolute; top: 13px; height: 4px; background: #9ca3af; border-radius: 2px; }
.tl-desvio.atraso { background: #f87171; }
.tl-ponto { position: absolute; top: 8px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); }
.tl-base { border: 2px solid #6b7280; background: #fff; }
.tl-prev { background: var(--cor-lateral); }
.tl-prev.atrasado { background: #dc2626; }
.tl-real { background: #16a34a; }
.tl-legenda { display: inline-block; width: 11px; height: 11px; transform: rotate(45deg); margin-right: .25rem; vertical-align: -1px; }
.tl-hoje-leg { width: 0; height: 12px; border-left: 2px dashed var(--cor-destaque); transform: none; }
@media (max-width: 900px) { .tl { --tl-nome: 120px; } }

/* Gestão da Mudança */
.fases-gm { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
@media (max-width: 767px) { .fases-gm { grid-template-columns: 1fr; } }
.fase-gm { display: flex; gap: .65rem; align-items: flex-start; background: #fff; border: 1px solid #e5e4df;
  border-radius: 10px; padding: .6rem .8rem; }
.fase-gm.atual { border-color: var(--cor-primaria); box-shadow: inset 0 0 0 1px var(--cor-primaria); }
.fase-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; background: #eceae4; color: #6b7280; }
.fase-gm.atual .fase-num { background: var(--cor-primaria); color: #fff; }
.fase-gm.feita .fase-num { background: #d1fae5; color: #065f46; }
.adkar { display: inline-flex; gap: 3px; }
.adkar-etapa { display: flex; flex-direction: column; align-items: center; width: 26px; }
.adkar-letra { font-size: .62rem; color: #6b7280; font-weight: 600; line-height: 1.2; }
.adkar-nota { width: 26px; height: 22px; border-radius: 4px; display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; }
.adkar-nota.n1, .adkar-nota.n2 { background: #fecaca; color: #991b1b; }
.adkar-nota.n3 { background: #fde68a; color: #854d0e; }
.adkar-nota.n4, .adkar-nota.n5 { background: #bbf7d0; color: #065f46; }
.adkar-etapa.barreira .adkar-nota { outline: 2px solid #1f2328; outline-offset: 1px; }
.adkar-etapa.apos { opacity: .45; }
.adkar.com-rotulos { gap: .5rem; }
.adkar.com-rotulos .adkar-etapa { width: 92px; }
.adkar.com-rotulos .adkar-nota { width: 100%; height: 34px; font-size: 1rem; }
.adkar-nome { font-size: .72rem; margin-top: .2rem; }
.impacto-gm { font-weight: 600; padding: .05rem .4rem; border-radius: 4px; font-size: .78rem; }
.impacto-gm.alto { background: #fee2e2; color: #991b1b; }
.impacto-gm.medio { background: #fef9c3; color: #854d0e; }
.impacto-gm.baixo { background: #d1fae5; color: #065f46; }
.aspecto-gm { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid #e5e4df; color: #9ca3af; }
.aspecto-gm.grau1 { background: #fef9c3; color: #854d0e; border-color: transparent; }
.aspecto-gm.grau2 { background: #fed7aa; color: #9a3412; border-color: transparent; }
.aspecto-gm.grau3 { background: #fecaca; color: #991b1b; border-color: transparent; font-weight: 600; }
.progress-bar:not(.bg-success) { background: var(--cor-primaria); }

/* ── Fluxos de integração ── */
.desenho-fluxo { overflow-x: auto; }
.desenho-fluxo svg { display: block; max-width: none; }
.desenho-fluxo a { text-decoration: none; }
.desenho-fluxo a rect { cursor: pointer; }
.desenho-fluxo a:hover rect { fill: #f8fafc; }

/* ── Matriz de acesso ── */
.matriz-acesso th { font-size: .72rem; white-space: normal; min-width: 92px; }
.matriz-acesso select { min-width: 110px; font-size: .8rem; }
.matriz-acesso .nivel-nenhum { background-color: #f8fafc; color: #64748b; }
.matriz-acesso .nivel-consultar { background-color: #eff6ff; color: #1d4ed8; }
.matriz-acesso .nivel-editar { background-color: #ecfdf5; color: #065f46; font-weight: 600; }

/* ── Abas do projeto: rolam na horizontal quando não cabem ── */
.nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.nav-tabs .nav-link { white-space: nowrap; }

/* ── Cutover ── */
.lista-marcar { max-height: 240px; overflow-y: auto; }
.tabela-cutover td { vertical-align: top; }
.tabela-cutover .form-select { min-width: 150px; }
.tabela-cutover tr.linha-atrasada td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.status-concluida { background-color: #ecfdf5; color: #065f46; }
.status-em_execucao { background-color: #eff6ff; color: #1d4ed8; font-weight: 600; }
.status-problema, .status-revertida { background-color: #fef2f2; color: #991b1b; font-weight: 600; }
.tl-cutover { font-size: .78rem; }
.tl-regua { position: relative; height: 18px; margin-left: 230px; color: #64748b; }
.tl-regua span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-linha { display: flex; align-items: center; height: 24px; }
.tl-nome { width: 230px; flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 8px;
  color: inherit; text-decoration: none; font-weight: 600; }
.tl-trilho { position: relative; flex: 1; height: 100%; }
.tl-trilho > i { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef2f6; }
.tl-prev, .tl-real { position: absolute; border-radius: 4px; }
.tl-prev { top: 4px; height: 16px; background: #cbd5e1; opacity: .8; }
.tl-prev.imp-critica { background: #fecaca; } .tl-prev.imp-alta { background: #fed7aa; }
.tl-real { top: 9px; height: 6px; background: #334155; }
.tl-real.st-concluida { background: #059669; } .tl-real.st-problema, .tl-real.st-revertida { background: #dc2626; }
.tl-real.st-em_execucao { background: #2563eb; }
.tl-agora { position: absolute; top: -2px; bottom: -2px; border-left: 2px solid #dc2626; z-index: 2; }
.tl-psr { position: absolute; top: 2px; transform: translateX(-2px); color: #1e293b; font-size: .8rem; }

/* ── Entregas (drops) ── */
.barra-entregas { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: -0.5rem 0 1rem;
  padding: .4rem .6rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .85rem; }
.barra-entregas .rot { font-weight: 600; color: #475569; margin-right: .25rem; }
.barra-entregas a { padding: .15rem .6rem; border-radius: 999px; text-decoration: none; color: #334155; border: 1px solid #e2e8f0; }
.barra-entregas a.ativa { background: var(--cor-primaria); border-color: var(--cor-primaria); color: #fff; font-weight: 600; }
.barra-entregas .dica { margin-left: auto; color: #94a3b8; font-size: .78rem; }
.tag-entrega { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 .4rem; border-radius: 4px;
  background: color-mix(in srgb, var(--cor-primaria) 12%, #fff); color: var(--cor-primaria); vertical-align: middle; }
.tag-entrega.comum { background: #f1f5f9; color: #64748b; font-weight: 600; }

/* ── Gantt das tarefas ── */
.gantt { font-size: .78rem; }
.g-regua { position: relative; height: 18px; margin-left: 260px; color: #64748b; }
.g-regua span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.g-linha { display: flex; align-items: center; height: 24px; }
.g-linha.g-marco { height: 26px; font-weight: 700; border-top: 1px solid #eef2f6; }
/* Faixa com o nome da demanda (entrega) acima dos marcos dela */
.g-linha.g-demanda { height: 28px; margin-top: 6px; background: color-mix(in srgb, var(--cor-primaria) 10%, #fff); border-radius: 4px; }
.g-linha.g-demanda .g-nome { width: auto; flex: 1; padding-left: 8px; font-weight: 700; color: var(--cor-primaria); font-size: .85rem; }
.g-linha.g-demanda .g-trilho { display: none; }
.g-demanda-cod { font-weight: 600; font-size: .72rem; opacity: .7; margin-left: 4px; }
.g-nome { width: 260px; flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 8px;
  color: inherit; text-decoration: none; }
.g-trilho { position: relative; flex: 1; height: 100%; }
.g-hoje { position: absolute; top: 0; bottom: 0; border-left: 2px solid #dc2626; opacity: .6; z-index: 2; }
.g-prev { position: absolute; top: 4px; height: 16px; border-radius: 4px; background: #cbd5e1; overflow: hidden; }
.g-prev > i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(5, 150, 105, .35); }
.g-prev.imp-critica { background: #fecaca; } .g-prev.imp-alta { background: #fed7aa; }
.g-prev.atrasada { outline: 2px solid #dc2626; }
.g-real { position: absolute; top: 10px; height: 5px; border-radius: 3px; background: #334155; }
.g-real.st-concluida { background: #059669; } .g-real.st-bloqueada { background: #dc2626; } .g-real.st-em_andamento { background: #2563eb; }
.g-losango { position: absolute; top: 6px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg);
  background: var(--cor-primaria); }
.g-losango.feito { background: #059669; }

/* ── Menu lateral do projeto ── */
#sidebar .nav-link.voltar { font-size: .8rem; color: rgba(255,255,255,.6); padding-top: .7rem; }
#sidebar .projeto-menu-nome { display: block; padding: .2rem 1.25rem .5rem; color: #fff; font-weight: 700; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
#sidebar .projeto-menu-nome small { display: block; font-weight: 600; font-size: .7rem; color: rgba(255,255,255,.55); letter-spacing: .04em; }

/* ── Painel do projeto ── */
.grupo-painel { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: .25rem 0 .5rem; }
.cartao-modulo .card-header:hover { background: #f8fafc; }
.cartao-modulo .numero { font-size: 1.6rem; font-weight: 700; line-height: 1.1; margin-bottom: .25rem; }
.cartao-modulo .numero span { font-size: .8rem; font-weight: 500; color: #64748b; }
.secao-projeto { margin-top: .25rem; }

.barra-entregas a.mae { border-color: var(--cor-primaria); color: var(--cor-primaria); font-weight: 600; }
.barra-entregas .sep { color: #94a3b8; font-weight: 700; }
.barra-entregas a.linha { font-size: .8rem; }
.linha-servico td { background: #fbfcfd; font-size: .92em; }
.linha-servico td:first-child { padding-left: 1.5rem; }

/* ── Revisão de riscos ── */
.revisao-risco.revisado { border-left: 4px solid #059669; }
.revisao-risco .nivel-quadrado { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.revisao-risco .form-label { margin-bottom: .1rem; font-size: .8rem; }
.revisao-risco .form-select { font-size: .85rem; padding-top: .25rem; padding-bottom: .25rem; }

/* ── Plano do projeto (árvore + Gantt) ───────────────────────────────────── */
.plano td { vertical-align: middle; }
.plano .nome-plano { min-width: 280px; }
.plano tr.resumo td { background: var(--bs-tertiary-bg, #f8fafc); }
.plano tr.resumo .nome-plano { font-weight: 600; }
.plano tr.nivel-1 .nome-plano { font-size: 1.02rem; }
.plano .abre { border: 0; background: none; padding: 0 .25rem 0 0; color: inherit; width: 1.3rem; }
.plano .abre i { transition: transform .15s; display: inline-block; }
.plano tr.fechado .abre i { transform: rotate(-90deg); }
.plano .losango { color: #7c3aed; }
.plano .pct-input { width: 4.2rem; }
.plano .desvio-pos { color: #b91c1c; font-weight: 600; }
.plano .desvio-neg { color: #047857; }
.plano .gantt-cel { min-width: 240px; width: 26%; position: relative; padding: 0 .5rem !important; }
.plano .gbar { position: relative; height: 18px; }
.plano .gbar .base { position: absolute; top: 12px; height: 4px; background: #cbd5e1; border-radius: 2px; }
.plano .gbar .prev { position: absolute; top: 2px; height: 9px; background: #93c5fd; border-radius: 3px; overflow: hidden; }
.plano .gbar .prev .feito { height: 100%; background: #2563eb; }
.plano tr.resumo .gbar .prev { background: #475569; height: 6px; top: 4px; }
.plano tr.resumo .gbar .prev .feito { background: #0f172a; }
.plano .gbar .prev.atrasada { background: #fca5a5; }
.plano .gbar .prev.atrasada .feito { background: #dc2626; }
.plano .gbar .marco { position: absolute; top: 1px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: #7c3aed; }
.plano .gbar .marco.concluida { background: #047857; }
.plano .gbar .marco.atrasada { background: #dc2626; }
.plano .hoje-linha { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed #f97316; z-index: 1; }
.plano .meses { position: relative; height: 16px; font-size: .68rem; color: var(--bs-secondary-color, #64748b); }
.plano .meses span { position: absolute; border-left: 1px solid #e2e8f0; padding-left: 2px; white-space: nowrap; }
@media (max-width: 991px) { .plano .gantt-cel, .plano .col-lg { display: none; } }

/* Caixas de seleção com busca (Tom Select) */
.ts-wrapper.form-select { padding: 0; }
.ts-wrapper .ts-control { min-height: calc(1.5em + .75rem + 2px); }
.ts-dropdown .option { white-space: pre; }
.ts-dropdown .option.disabled, .ts-dropdown [data-disabled] { color: var(--bs-secondary-color, #6b7280); }

/* Imprimir só o Gantt (botão Extrair › Imprimir) */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body.imprimir-gantt { background: #fff !important; }
  body.imprimir-gantt * { visibility: hidden; }
  body.imprimir-gantt #gantt, body.imprimir-gantt #gantt * { visibility: visible; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.imprimir-gantt #gantt { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; }
  body.imprimir-gantt #gantt .card-header { background: #fff; }
  body.imprimir-gantt .g-nome { width: 300px; }
  body.imprimir-gantt .g-regua { margin-left: 300px; }
}

/* Processos de negócio: cascata nos formulários e árvore do escopo */
.arvore-processos .pa-lista { max-height: 420px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: .5rem; background: #fff; padding: .35rem .5rem; }
.pa-no { display: flex; align-items: flex-start; gap: .25rem; padding-top: .15rem; padding-bottom: .15rem; border-radius: .35rem; }
.pa-no:hover { background: #f8fafc; }
.pa-no.pa-n0 { font-weight: 600; }
.pa-abrir { border: 0; background: none; width: 1.4rem; flex: none; color: #64748b; padding: 0; line-height: 1.5; }
.pa-abrir i { display: inline-block; transition: transform .15s; }
.pa-abrir.aberto i { transform: rotate(90deg); }
.pa-rot { display: flex; align-items: baseline; gap: .4rem; cursor: pointer; margin: 0; }
.pa-rot .form-check-input { margin-top: .2rem; flex: none; }
.pa-cod { color: #64748b; font-variant-numeric: tabular-nums; }
.cascata-processo .ts-wrapper { min-width: 0; }
.pc-opcao { white-space: normal; line-height: 1.25; }
.pc-acima { font-size: .78em; color: #64748b; }
.pc-item { font-weight: 600; }
.cascata-processo .ts-dropdown .option { white-space: normal; }

/* Requisitos organizados pelos processos do escopo */
.rq-bloco > summary { cursor: pointer; list-style: none; }
.rq-bloco > summary::-webkit-details-marker { display: none; }
.rq-seta { display: inline-block; transition: transform .15s; }
.rq-bloco[open] .rq-seta { transform: rotate(90deg); }
.rq-no { padding-top: .45rem; padding-bottom: .45rem; padding-right: .75rem; border-top: 1px solid #f1f5f9; }
.rq-no.rq-lacuna { background: #fffbeb; }
.rq-no.rq-ctx { padding-top: .3rem; padding-bottom: .3rem; }
.rq-fn { margin: .25rem 0 0 1.5rem; }
.rq-add { padding: .1rem .5rem; font-size: .78rem; }
body.rq-so-lacunas .rq-no:not(.rq-lacuna):not(.rq-ctx) { display: none; }

/* Financeiro */
.stat .valor.fin-valor { font-size: 1.35rem; white-space: nowrap; }
.fin-tabela td, .fin-tabela th { font-variant-numeric: tabular-nums; }

/* Físico-financeiro: grade marco × mês com a primeira coluna fixa */
.ff-wrap { max-height: 70vh; }
.ff-grade th, .ff-grade td { font-size: .82rem; }
.ff-grade thead th { position: sticky; top: 0; background: var(--bs-body-bg); z-index: 2; }
.ff-grade .ff-fixa { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; min-width: 260px; max-width: 320px; }
.ff-grade thead .ff-fixa { z-index: 3; }
.ff-grade .ff-nome { line-height: 1.25; }
.ff-grade td.ff-atual, .ff-grade th.ff-atual { background: color-mix(in srgb, var(--cor-primaria) 7%, transparent); }
.ff-grade tr.ff-grupo td { background: color-mix(in srgb, var(--cor-primaria) 10%, var(--bs-body-bg)); font-weight: 600; font-size: .8rem; }
.ff-grade .ff-celula { font-weight: 600; }
.ff-grade .ff-base { font-size: .7rem; color: #9ca3af; border: 1px dashed #cbd5e1; border-radius: 3px; padding: 0 3px; }
.ff-grade tfoot td { border-top: 1px solid #e5e7eb; }

/* Tarefas: lista no estilo checklist, agrupada, e quadro por situação */
.tk-filtros { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; flex-direction: row; }
.tk-filtros .form-select { width: auto; max-width: 190px; }
.tk-grupo-cab { display: flex; gap: .5rem; align-items: center; width: 100%; text-align: left; border: 0; font-weight: 600; }
.tk-grupo-cab .bi-chevron-down { transition: transform .15s; }
.tk-grupo-cab[aria-expanded="false"] .bi-chevron-down { transform: rotate(-90deg); }
.tk-item { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 1rem; border-top: 1px solid #eef0f3; }
.tk-item:first-child { border-top: 0; }
.tk-item:target { background: color-mix(in srgb, var(--cor-primaria) 8%, transparent); }
.tk-item.tk-sub { padding-left: 3rem; background: #fafbfc; }
.tk-item.encerrada .tk-titulo { color: #94a3b8; text-decoration: line-through; }
.tk-item.contexto { opacity: .7; }
.tk-corpo { flex: 1; min-width: 0; }
.tk-titulo { font-weight: 500; line-height: 1.3; }
.tk-titulo a { color: inherit; text-decoration: none; }
.tk-titulo a:hover { text-decoration: underline; }
.tk-codigo { font-size: .75rem; color: #94a3b8; margin-left: .25rem; }
.tk-desc { font-size: .82rem; color: #6b7280; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .78rem; color: #6b7280; margin-top: .25rem; align-items: center; }
.tk-prazo.atrasado { color: #b91c1c; font-weight: 600; }
.tk-tag { display: inline-block; font-size: .72rem; padding: 0 .45rem; border-radius: 999px; text-decoration: none; line-height: 1.5; }
.tk-onde { font-size: .78rem; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; max-width: 220px; }
.tk-onde a { text-decoration: none; }
.tk-acoes { width: 28px; flex: none; }
.tk-concluir { margin: 0; }
.tk-circulo { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #94a3b8; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; margin-top: 1px; color: transparent; font-size: .8rem; }
button.tk-circulo:hover { color: #64748b; background: #f1f5f9; }
.tk-circulo.imp-critica { border-color: #dc2626; } .tk-circulo.imp-alta { border-color: #ea580c; }
.tk-circulo.imp-media { border-color: #94a3b8; } .tk-circulo.imp-baixa { border-color: #cbd5e1; }
.tk-circulo.feito { background: #16a34a; border-color: #16a34a; color: #fff; }
.tk-circulo.cancelada { border-style: dashed; }
.tk-rapida { display: flex; gap: .5rem; align-items: center; padding: .45rem 1rem; border-top: 1px solid #eef0f3; color: #94a3b8; }
.tk-rapida .form-control { border-color: transparent; box-shadow: none; }
.tk-rapida .form-control:focus { border-color: #cbd5e1; }
.tk-rapida .btn { display: none; }
.tk-rapida:focus-within .btn { display: inline-block; }
.tk-quadro { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: .75rem; overflow-x: auto; }
.tk-coluna { background: #f6f7f9; border-radius: 8px; padding: .5rem; min-height: 200px; }
.tk-coluna-cab { padding: .25rem .25rem .5rem; display: flex; gap: .5rem; align-items: center; }
.tk-coluna-corpo { min-height: 160px; border-radius: 6px; display: flex; flex-direction: column; gap: .5rem; }
.tk-coluna-corpo.alvo { outline: 2px dashed var(--cor-primaria); }
.tk-cartao { background: var(--bs-body-bg); border-radius: 6px; padding: .55rem .65rem; border: 1px solid #e5e7eb; border-left: 4px solid #cbd5e1; }
.tk-cartao[draggable=true] { cursor: grab; }
.tk-cartao.arrastando { opacity: .5; }
.tk-cartao.imp-critica { border-left-color: #dc2626; } .tk-cartao.imp-alta { border-left-color: #ea580c; }
@media (max-width: 700px) {
  .tk-item { flex-wrap: wrap; }
  .tk-onde { order: 5; width: 100%; max-width: none; flex-direction: row; align-items: center; padding-left: 2.2rem; }
  .tk-item.tk-sub { padding-left: 1.75rem; }
}
.ver-como { background: #1e3a8a; color: #fff; padding: .5rem 1rem; border-radius: 8px; margin-bottom: .75rem; font-size: .9rem; }

/* Toolkit: módulos do projeto */
.tk-modulo.desligado .form-check-label, .tk-modulo.desligado .small { opacity: .6; }
.matriz-acesso td.desligado-projeto select { opacity: .45; }

/* Impacto sistêmico */
.im-caminho { overflow-wrap: anywhere; }

/* Painéis */
.pn-numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; }
.pn-numero { border: 1px solid #e2e8f0; border-radius: .5rem; padding: .6rem .75rem; background: #fff; }
.pn-valor { font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.pn-rotulo { font-size: .8rem; color: #475569; }
.pn-sub { font-size: .72rem; color: #94a3b8; }
.pn-numero.pn-perigo { border-color: #fecaca; background: #fef2f2; } .pn-numero.pn-perigo .pn-valor { color: #b91c1c; }
.pn-numero.pn-alerta { border-color: #fde68a; background: #fffbeb; } .pn-numero.pn-alerta .pn-valor { color: #b45309; }
.pn-numero.pn-ok .pn-valor { color: #047857; }
.pn-legenda { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .75rem; color: #475569; margin-bottom: .4rem; }
.pn-legenda i, .pn-ponto { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .25rem; vertical-align: -1px; }
.pn-barras { display: flex; flex-direction: column; gap: .3rem; }
.pn-linha { display: grid; grid-template-columns: minmax(90px, 28%) 1fr 2.2rem; gap: .5rem; align-items: center; font-size: .8rem; }
.pn-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-trilho { display: flex; height: 1.15rem; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.pn-seg { color: #fff; font-size: .7rem; text-align: center; line-height: 1.15rem; min-width: 1.1rem; overflow: hidden; }
.pn-total { text-align: right; font-weight: 600; }
.pn-perigo-linha td { color: #b91c1c; }
@media print {
  body.imprimir-painel #sidebar, body.imprimir-painel .barra-entregas, body.imprimir-painel .nao-imprimir { display: none !important; }
  body.imprimir-painel main, body.imprimir-painel #conteudo { margin: 0 !important; padding: 0 !important; }
  body.imprimir-painel .pn-bloco { break-inside: avoid; }
  body.imprimir-painel * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.desenho-fluxo.ajustado svg { width: 100%; height: auto; }
.roteiro .ordem { width: 56px; text-align: center; }
.roteiro textarea { min-height: 34px; }
.roteiro tr.roteiro-removida td { opacity: .45; text-decoration: line-through; }
.roteiro tr.roteiro-removida td:last-child { opacity: 1; }
/* Matriz de acesso: escopo numa linha própria, permissões na linha de baixo */
.matriz-acesso th.recuo, .matriz-acesso td.recuo { min-width: 0; width: 28px; padding: 0; }
.matriz-acesso tr.escopo-linha td { background: #f8fafc; border-bottom: 0; padding-top: .55rem; padding-bottom: .35rem; }
.matriz-acesso tr.escopo-linha.escopo-1 td { padding-left: 1.6rem; }
.matriz-acesso tr.escopo-linha.escopo-2 td { padding-left: 3.2rem; }
.matriz-acesso tr.permissoes-linha td { border-top: 0; padding-bottom: .7rem; }
.matriz-acesso tr.permissoes-linha.escopo-1 td.recuo { border-left: 3px solid #cbd5e1; }
.matriz-acesso tr.permissoes-linha.escopo-2 td.recuo { border-left: 3px solid #94a3b8; }
.matriz-acesso .escopo-tipo { background: #e2e8f0; color: #334155; font-weight: 600; }
.matriz-acesso td.difere select { box-shadow: 0 0 0 2px #f59e0b; }
.matriz-acesso .dif-antes { color: #b45309; font-size: .7rem; }
.matriz-acesso .escopo-conteudo { position: sticky; left: .75rem; display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; max-width: min(1000px, calc(100vw - 340px)); }
.matriz-acesso tr.escopo-1 .escopo-conteudo { left: 1.6rem; }
.matriz-acesso tr.escopo-2 .escopo-conteudo { left: 3.2rem; }
.matriz-acesso tr.escopo-linha.escopo-1 td, .matriz-acesso tr.escopo-linha.escopo-2 td { padding-left: .75rem; }
