/* Estilos só da tela competencia (matriz empresa × obrigação, 6 estados do painel da Emanuela). */
.g2-matriz { padding: 0; overflow: hidden; }
/* Célula sem tarefa: traço discreto (12/11/2026, menos poluição que a pílula "não se aplica") */
.mx-na { display: inline-block; min-width: 24px; text-align: center; color: var(--linha-forte); font-weight: 600; }
.g2-leg .mx-leg-na::before { content: "–"; width: auto; height: auto; border: 0; background: none; color: var(--texto-3); margin-right: 5px; }
.g2-matriz-rolagem { overflow: auto; max-height: calc(100dvh - 260px); }
.g2-matriz table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.84rem; }
.g2-matriz th { position: sticky; top: 0; z-index: 2; background: #fff; font-weight: 600; text-align: left; padding: 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.g2-matriz th small { display: block; font-weight: 500; color: var(--texto-3); }
.g2-matriz td { padding: 6px 10px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.g2-matriz tbody tr:last-child td { border-bottom: 0; }
.g2-matriz th:first-child, .g2-matriz td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 190px; max-width: 260px; white-space: normal; box-shadow: 1px 0 0 var(--linha); }
.g2-matriz th:first-child { z-index: 3; }
.g2-matriz td:first-child b { display: block; font-weight: 600; }
.g2-matriz td:first-child small { color: var(--texto-3); display: block; }
.g2-resp { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--texto-2); margin-top: 2px; }
.g2-cel { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.76rem; border: 0; font-family: inherit; min-height: 28px; }
button.g2-cel { cursor: pointer; }
button.g2-cel:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t-escuro-1) 18%, transparent); }
.c-ok { background: var(--ok-fundo); color: var(--verde); }
.c-meta { background: var(--alerta-fundo); color: var(--alerta); }
.c-meta-ab { background: var(--alerta-fundo); color: var(--alerta); box-shadow: inset 0 0 0 1px rgba(168, 100, 0, 0.35); }
.c-pos { background: #fbe3d9; color: #9c3d16; }
.c-atr { background: var(--perigo); color: #fff; }
.c-pen { background: #eef2f0; color: var(--texto-2); }
.c-na { background: none; color: var(--texto-3); border: 1px dashed var(--linha-forte); font-weight: 500; }
.g2-matriz .g2-leg { padding: 10px 14px 14px; }

/* Matriz dentro de Tarefas (12/11/2026): resumo de cada obrigação no cabeçalho da coluna (clicável),
   células como etiquetas do mesmo tamanho e legenda com as próprias etiquetas. */
.g2-matriz th { vertical-align: bottom; }
.mx-th-empresa small { display: block; font-weight: 500; color: var(--texto-3); margin-top: 2px; }
.mx-th { width: 100%; min-width: 150px; display: grid; gap: 4px; text-align: left; border: 0; border-radius: 10px; padding: 8px 10px; background: none; cursor: pointer; font: inherit; color: var(--texto); transition: background 0.15s; }
.mx-th:hover { background: color-mix(in srgb, var(--texto-3) 8%, transparent); }
.mx-th[aria-pressed="true"] { background: var(--ok-fundo); box-shadow: inset 0 0 0 2px var(--verde); }
.mx-th-nome { font: 700 0.86rem Sora, Inter, sans-serif; }
.mx-th-num { display: flex; align-items: baseline; gap: 2px; font-size: 0.8rem; color: var(--texto-3); }
.mx-th-num b { font: 700 1.1rem Sora, Inter, sans-serif; color: var(--texto); }
.mx-th-num em { font-style: normal; font-weight: 600; margin-left: auto; color: var(--texto-3); }
.mx-th.perigo .mx-th-num em { color: var(--perigo); }
.mx-th.alerta .mx-th-num em { color: var(--alerta); }
.mx-th.ok .mx-th-num em { color: var(--verde); }
.mx-th-barra { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--texto-3) 16%, transparent); overflow: hidden; }
.mx-th-barra i { display: block; height: 100%; background: var(--degrade); border-radius: 3px; }
.mx-th small { font-weight: 500; color: var(--texto-3); font-size: 0.72rem; }
.g2-matriz td { padding: 8px 10px; }
.g2-matriz .g2-cel { width: 100%; min-width: 132px; max-width: 170px; justify-content: center; border-radius: 8px; padding: 6px 8px; font-size: 0.74rem; white-space: normal; overflow-wrap: anywhere; }
.mx-na { min-width: 132px; }
.mx-leg { gap: 6px 8px; margin: 0; padding: 12px 14px; border-top: 1px solid var(--linha); }
.mx-leg span { padding: 3px 9px; border-radius: 6px; font-weight: 600; font-size: 0.72rem; }
.mx-leg span::before { display: none !important; }
.mx-leg .mx-leg-na { color: var(--texto-3); border: 1px dashed var(--linha-forte); }

/* Títulos das colunas centralizados (regra do sistema, 12/11/2026) */
.g2-matriz th, .g2-matriz th:first-child { text-align: center; }
.mx-th-nome { text-align: center; font-size: 0.92rem; }
.mx-th-empresa { text-align: center; font: 700 0.92rem Sora, Inter, sans-serif; }

/* Mais empresas à vista (12/11/2026): linha compacta (nome em cima; código, regime e responsável numa linha só),
   coluna da empresa mais larga para o nome não quebrar e área da tabela usando quase toda a altura da tela. */
.g2-matriz-rolagem { max-height: calc(100dvh - 120px); overscroll-behavior: contain; }
.g2-matriz th:first-child, .g2-matriz td:first-child { min-width: 240px; max-width: 320px; }
.g2-matriz tbody td { padding: 7px 10px; }
.g2-matriz tbody td:first-child { padding-left: 16px; }
.g2-matriz td:first-child b { font-size: 0.88rem; line-height: 1.3; }
.mx-emp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 2px; }
.g2-matriz td:first-child .mx-emp-sub small { display: inline; font-size: 0.74rem; }
.mx-emp-sub .g2-resp { margin-top: 0; }
.g2-matriz .g2-cel { min-height: 30px; padding: 5px 8px; }
.g2-matriz tbody tr:hover td { background: color-mix(in srgb, var(--texto-3) 5%, var(--cartao)); }
.mx-th { padding: 6px 10px; gap: 3px; }

/* ===== Por empresa, apresentação nova (12/11/2026) =====
   Um padrão só para todas as células: etiqueta clara com ponto na cor da situação. Pendências abertas e vencidas
   ganham contorno (pedem ação); entregas já feitas ficam lisas. Empresa com selo de iniciais. Linhas alternadas. */
.g2-matriz table { font-size: 0.86rem; }
.g2-matriz thead th { background: color-mix(in srgb, var(--texto-3) 6%, var(--cartao)); border-bottom: 2px solid var(--linha-forte); padding: 8px 8px 10px; }
.g2-matriz thead th + th, .g2-matriz tbody td + td { border-left: 1px solid var(--linha); }
.g2-matriz tbody td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--linha); }
.g2-matriz tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--texto-3) 4%, var(--cartao)); }
.g2-matriz tbody tr:hover td { background: color-mix(in srgb, var(--verde) 6%, var(--cartao)); }
.g2-matriz tbody td:first-child { text-align: left; padding: 8px 14px; }

/* Empresa: selo + nome + (código · regime · responsável) */
.mx-emp { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mx-emp-av { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 700 0.72rem/1 Sora, Inter, sans-serif; letter-spacing: 0.02em; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.mx-emp-txt { display: grid; gap: 2px; min-width: 0; }
.g2-matriz td:first-child .mx-emp-txt b { font: 700 0.9rem/1.25 Sora, Inter, sans-serif; color: var(--texto); }
.mx-emp-sub { gap: 2px 8px; margin-top: 0; color: var(--texto-3); }
.mx-emp-sub .g2-resp { font-size: 0.74rem; font-weight: 600; color: var(--texto-2); }

/* Células: todas iguais no formato */
.g2-matriz .g2-cel, .mx-legenda .g2-cel { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-width: 148px; max-width: 186px; min-height: 34px; padding: 6px 12px; border-radius: 10px; border: 1px solid transparent; box-shadow: none; font: 600 0.78rem/1.25 Inter, sans-serif; text-align: left; white-space: normal; overflow-wrap: anywhere; transition: border-color 0.15s, transform 0.15s; }
.g2-matriz .g2-cel i, .mx-legenda .g2-cel i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.g2-matriz button.g2-cel:hover { box-shadow: none; border-color: color-mix(in srgb, currentColor 45%, transparent); }
@media (prefers-reduced-motion: no-preference) { .g2-matriz button.g2-cel:hover { transform: translateY(-1px); } }
.g2-cel.c-atr { background: var(--perigo-fundo); color: var(--perigo); border-color: color-mix(in srgb, var(--perigo) 40%, transparent); font-weight: 700; }
.g2-cel.c-meta-ab { background: var(--alerta-fundo); color: var(--alerta); border-color: color-mix(in srgb, var(--alerta) 35%, transparent); box-shadow: none; }
.g2-cel.c-pen { background: color-mix(in srgb, var(--texto-3) 10%, var(--cartao)); color: var(--texto-2); }
.g2-cel.c-pen i { background: var(--texto-3); }
.g2-cel.c-ok { background: var(--ok-fundo); color: var(--verde); }
.g2-cel.c-meta { background: color-mix(in srgb, var(--alerta-fundo) 70%, var(--cartao)); color: var(--alerta); }
.g2-cel.c-pos { background: #fdeee8; color: #9c3d16; }
.g2-cel.c-na { background: transparent; color: var(--texto-3); border: 1px solid var(--linha); font-weight: 500; }
.g2-cel.c-na i { background: none; box-shadow: inset 0 0 0 1.5px var(--texto-3); }
.g2-matriz .mx-na { min-width: 148px; color: var(--linha-forte); }

/* Legenda: as mesmas etiquetas das células, centralizadas */
.mx-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; padding: 12px 14px 14px; border-top: 1px solid var(--linha); }
.mx-legenda .g2-cel { width: auto; min-width: 0; max-width: none; min-height: 28px; padding: 4px 11px 4px 9px; font-size: 0.74rem; border-radius: 999px; }
.mx-legenda-na { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 0.74rem; font-weight: 600; color: var(--texto-3); }
.mx-legenda-na b { color: var(--linha-forte); font-size: 1rem; }

/* Mais empresas na tela (12/11/2026): linhas e cabeçalho compactos. Linha ~44px (antes ~57px), cabeçalho ~64px (antes ~95px). */
.g2-matriz tbody td { padding: 5px 8px; }
.g2-matriz tbody td:first-child { padding: 5px 12px; }
.mx-emp { gap: 9px; }
.mx-emp-av { width: 28px; height: 28px; border-radius: 8px; font-size: 0.64rem; }
.mx-emp-txt { gap: 0; }
.g2-matriz td:first-child .mx-emp-txt b { font-size: 0.86rem; line-height: 1.2; }
.g2-matriz td:first-child .mx-emp-sub small { font-size: 0.7rem; }
.mx-emp-sub .g2-resp { font-size: 0.7rem; gap: 3px; }
.mx-emp-sub .g2-resp .g2-av { width: 16px; height: 16px; font-size: 0.48rem; }
.g2-matriz .g2-cel { min-height: 28px; padding: 3px 10px; font-size: 0.75rem; gap: 6px; border-radius: 8px; }
.g2-matriz .g2-cel i { width: 7px; height: 7px; }
.g2-matriz thead th { padding: 6px 8px 7px; }
.g2-matriz .mx-th { padding: 4px 8px; gap: 2px; }
.g2-matriz .mx-th-nome { font-size: 0.88rem; }
.g2-matriz .mx-th-num b { font-size: 0.98rem; }
.g2-matriz .mx-th-num { font-size: 0.74rem; }
.g2-matriz .mx-th-barra { height: 4px; }
.g2-matriz .mx-th small { font-size: 0.66rem; line-height: 1.2; }
.mx-th-empresa { font-size: 0.86rem; }
.g2-matriz .g2-nota-quadro { margin: 0; padding: 0 14px 14px; text-align: center; }

/* Responsável junto da empresa, mas num lugar fixo (12/11/2026): selo à direita da célula, alinhado em coluna
   em todas as linhas (antes vinha logo depois do regime e mudava de posição conforme o tamanho do texto). */
.mx-emp .mx-emp-txt { flex: 1; }
.mx-emp-resp { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 82px; padding: 3px 9px 3px 3px; border-radius: 999px; background: color-mix(in srgb, var(--texto-3) 9%, var(--cartao)); font: 600 0.74rem Inter, sans-serif; color: var(--texto); }
.mx-emp-resp .g2-av { width: 20px; height: 20px; font-size: 0.52rem; }
.g2-matriz th:first-child, .g2-matriz td:first-child { min-width: 300px; }
