:root {
  --greggio-azul: #1f3a5f;
  --greggio-azul-claro: #2d5286;
}

body { background: #f4f6f9; }

.sidebar {
  background: var(--greggio-azul);
  min-height: 100vh;
  color: #fff;
}
.sidebar .nav-link {
  color: #c8d4e6;
  border-radius: 6px;
  margin: 2px 8px;
}
.sidebar .nav-link:hover { background: var(--greggio-azul-claro); color: #fff; }
.sidebar .nav-link.active { background: var(--greggio-azul-claro); color: #fff; font-weight: 600; }
.sidebar .brand {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 18px 16px;
  color: #fff;
}

.card-indicador { border: none; border-radius: 10px; }
.card-indicador .numero { font-size: 2rem; font-weight: 700; }

.badge-atrasada { background: #c0392b; }
.badge-hoje { background: #e67e22; }
.badge-semana { background: #f1c40f; color: #333; }
.badge-pendente { background: #6c757d; }
.badge-em_andamento { background: #0d6efd; }
.badge-concluida { background: #198754; }
.badge-nao_aplicavel { background: #adb5bd; color: #333; }

table.tabela-compacta td, table.tabela-compacta th { vertical-align: middle; }
.form-inline-acao { display: inline; }

/* Acompanhamento (matriz atividade x empresa, estilo planilha) */
.matriz-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: 74vh;
  border: 1px solid #c8d0db;
  border-radius: 6px;
}
.matriz {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: auto;
}
.matriz th, .matriz td {
  border-right: 1px solid #e3e6ea;
  border-bottom: 1px solid #e3e6ea;
  padding: 0;
}
/* Cabeçalho: nomes das empresas na vertical (colunas estreitas) */
.matriz thead th.col-emp {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--greggio-azul);
  color: #fff;
  height: 150px;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  vertical-align: bottom;
}
.matriz thead th.col-emp span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  display: block;
  max-height: 142px;
  overflow: hidden;
  margin: 4px auto;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}
/* Canto superior esquerdo (fixo nos dois eixos) */
.matriz .canto {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 4;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  background: var(--greggio-azul);
  color: #fff;
  text-align: left;
  vertical-align: bottom;
  padding: 6px 8px;
  font-size: 12px;
}
/* Primeira coluna: atividades travadas à esquerda */
.matriz .lin-obrig {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f1f4f8;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  height: 26px;
  text-align: left;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Células de status (quadradinhos uniformes) */
.matriz td.cel {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 26px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.matriz td.cel:hover { outline: 2px solid #1f3a5f; outline-offset: -2px; }
.cel-ok   { background: #2e9b54; }
.cel-and  { background: #2d6fd8; }
.cel-pend { background: #e98b8b; color: #6b1414 !important; }
.cel-atr  { background: #c0392b; }
.cel-na   { background: #cfd3d8; color: #5a5f66 !important; }
.cel-vazia { background: #fafbfc; cursor: default; }
.leg {
  display: inline-block; padding: 0 5px; border-radius: 3px;
  color: #fff; font-weight: 700; font-size: 10px;
}
.leg.cel-pend { color: #6b1414; }
.leg.cel-na { color: #5a5f66; }

/* Acompanhamento (mural de quadrinhos) */
.card-acomp {
  border: none;
  border-radius: 10px;
  color: #fff;
  min-height: 110px;
  transition: transform .08s ease-in-out, box-shadow .08s;
}
.card-acomp:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.card-acomp-verde { background: #198754; }
.card-acomp-vermelho { background: #c0392b; }
.card-acomp-cinza { background: #adb5bd; color: #333; }
.card-acomp .nome-empresa {
  font-size: .85rem;
  line-height: 1.15;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-acomp .lista-pendentes { opacity: .9; font-size: .7rem; line-height: 1.25; }

/* Calendário */
.calendario { table-layout: fixed; }
.calendario td {
  height: 112px;
  width: 14.28%;
  vertical-align: top;
  padding: 4px 5px;
}
.calendario .dia-numero { font-size: .8rem; color: #555; margin-bottom: 2px; }
.cal-item {
  display: block;
  font-size: .72rem;
  border-radius: 4px;
  padding: 1px 5px;
  margin-bottom: 2px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-item:hover { color: #fff; filter: brightness(1.15); }
.cal-atrasada { background: #c0392b; }
.cal-pendente { background: #5b7ba6; }
.cal-em_andamento { background: #0d6efd; }
.cal-concluida { background: #198754; }
.cal-outro-mes { background: #fafafa; }
.cal-hoje { background: #fff8e1; }
