
/* ==========================================================
   CENTRAL DE GESTÃO FM
   MÓDULO: TAREFAS E ROTINAS
   PADRONIZAÇÃO VISUAL
========================================================== */


/* ==========================================================
   1. IDENTIDADE VISUAL
========================================================== */

body.modulo-tarefas {
  --oliva: #5A6447;
  --oliva-escuro: #444E35;
  --areia: #E8DDC8;
  --pistache: #A8B77A;
  --terracota: #B66A4A;
  --terracota-escuro: #995238;

  --fundo: #F7F8F5;
  --branco: #FFFFFF;
  --texto: #30372D;
  --muted: #747B73;
  --borda: #E8DDC8;

  --sombra: 0 3px 12px rgba(40, 48, 39, 0.05);

  margin: 0;
  min-height: 100vh;
  background: var(--fundo);
  color: var(--texto);

  font-family: "Futura", "Century Gothic", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body.modulo-tarefas *,
body.modulo-tarefas *::before,
body.modulo-tarefas *::after {
  box-sizing: border-box;
}

body.modulo-tarefas button,
body.modulo-tarefas input,
body.modulo-tarefas select,
body.modulo-tarefas textarea {
  font: inherit;
}

body.modulo-tarefas button {
  cursor: pointer;
}

body.modulo-tarefas button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* ==========================================================
   2. ESTRUTURA PRINCIPAL
========================================================== */

.modulo-tarefas .pagina {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 32px 64px;
}


/* ==========================================================
   3. CABEÇALHO
========================================================== */

.modulo-tarefas .cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.modulo-tarefas .cabecalho-conteudo {
  min-width: 0;
}

.modulo-tarefas .voltar-painel {
  display: inline-flex;
  align-items: center;
  margin-bottom: 23px;

  color: var(--oliva);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;

  transition: color 0.2s ease;
}

.modulo-tarefas .voltar-painel:hover {
  color: var(--terracota);
  text-decoration: none;
}

.modulo-tarefas .cabecalho h1 {
  margin: 0 0 10px;
  padding-left: 16px;

  border-left: 5px solid var(--terracota);

  color: var(--oliva);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.2;
}

.modulo-tarefas .cabecalho p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modulo-tarefas .acoes-cabecalho {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}


/* ==========================================================
   4. BOTÕES
========================================================== */

.modulo-tarefas .botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  min-height: 40px;
  width: auto;
  padding: 11px 18px;

  border: 1px solid transparent;
  border-radius: 9px;

  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

/* Botão principal */

.modulo-tarefas .botao-primario {
  background: var(--terracota);
  color: var(--branco);
  border-color: var(--terracota);
}

.modulo-tarefas .botao-primario:hover {
  background: var(--terracota-escuro);
  border-color: var(--terracota-escuro);
}

/* Botão secundário */

.modulo-tarefas .botao-secundario {
  background: var(--branco);
  color: var(--oliva);
  border-color: var(--oliva);
}

.modulo-tarefas .botao-secundario:hover {
  background: #F5F2EB;
}

/* Botão de exclusão */

.modulo-tarefas .botao-perigo {
  background: var(--branco);
  color: var(--terracota);
  border-color: var(--terracota);
}

.modulo-tarefas .botao-perigo:hover {
  background: #F8EDE8;
}

/* Botão compacto */

.modulo-tarefas .botao-pequeno {
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}

/* Botões do cabeçalho */

.modulo-tarefas .acoes-cabecalho .botao {
  min-height: 44px;
  padding: 12px 19px;
  white-space: nowrap;
}


/* ==========================================================
   5. ABAS
========================================================== */

.modulo-tarefas .abas {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 28px;
  border-bottom: 1px solid var(--borda);

  overflow-x: auto;
}

.modulo-tarefas .aba {
  flex-shrink: 0;
  padding: 14px 19px;

  border: 0;
  border-bottom: 3px solid transparent;

  background: transparent;
  color: var(--muted);

  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;

  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.modulo-tarefas .aba:hover {
  color: var(--oliva);
}

.modulo-tarefas .aba.ativa {
  color: var(--oliva);
  border-bottom-color: var(--terracota);
}


/* ==========================================================
   6. CONTROLE DOS PAINÉIS
   CLASSES UTILIZADAS PELO JAVASCRIPT
========================================================== */

.modulo-tarefas .painel {
  display: none;
}

.modulo-tarefas .painel.ativo {
  display: block;
}


/* ==========================================================
   7. INDICADORES
========================================================== */

.modulo-tarefas .indicadores {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.modulo-tarefas .indicador {
  min-width: 0;
  padding: 23px;

  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 14px;
  box-shadow: var(--sombra);
}

.modulo-tarefas .indicador .rotulo {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.modulo-tarefas .indicador .numero {
  color: var(--oliva);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.modulo-tarefas .indicador.atrasadas .numero {
  color: var(--terracota);
}


/* ==========================================================
   8. GRADE DE CARDS
   QUADROS COM ALTURAS INDEPENDENTES
========================================================== */

.modulo-tarefas .grade-dupla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  margin-bottom: 20px;
}

.modulo-tarefas .grade-dupla > .card {
  align-self: start;
  height: auto;
  min-height: 0;
}


/* ==========================================================
   9. CARDS
========================================================== */

.modulo-tarefas .card {
  min-width: 0;
  padding: 27px;

  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 14px;
  box-shadow: var(--sombra);
}

.modulo-tarefas .card h2 {
  margin: 0 0 22px;
  padding-left: 13px;

  border-left: 4px solid var(--terracota);

  color: var(--oliva);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
}

.modulo-tarefas .card-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;

  margin-bottom: 23px;
}

.modulo-tarefas .card-topo h2 {
  margin: 0;
}

.modulo-tarefas .texto-auxiliar {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modulo-tarefas .introducao-rotinas {
  margin: 0 0 24px;
}

.modulo-tarefas .descricao-progresso {
  margin: 24px 0 0;
}


/* ==========================================================
   10. LISTAS DE ATIVIDADES
========================================================== */

.modulo-tarefas .lista {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.modulo-tarefas .item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;

  padding: 16px;

  background: #FFFFFF;
  border: 1px solid #EAE7DF;
  border-radius: 10px;
}

.modulo-tarefas .item-conteudo {
  flex: 1;
  min-width: 0;
}

.modulo-tarefas .item-titulo {
  margin-bottom: 6px;

  color: var(--texto);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;

  overflow-wrap: anywhere;
}

.modulo-tarefas .item-descricao {
  margin: 6px 0;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;

  overflow-wrap: anywhere;
}

.modulo-tarefas .item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;

  color: var(--muted);
  font-size: 12px;
}

.modulo-tarefas .item-acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.modulo-tarefas .item-acoes .botao {
  margin: 0;
}


/* ==========================================================
   11. SELOS
========================================================== */

.modulo-tarefas .selo {
  display: inline-flex;
  align-items: center;

  padding: 5px 10px;
  border-radius: 30px;

  background: #EDF2E5;
  color: var(--oliva);

  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.modulo-tarefas .selo.alta,
.modulo-tarefas .selo.atrasada {
  background: #FCECE7;
  color: #A34F37;
}

.modulo-tarefas .selo.media {
  background: #FFF3D9;
  color: #946819;
}

.modulo-tarefas .selo.baixa,
.modulo-tarefas .selo.concluida {
  background: #EAF2E3;
  color: #53723C;
}

.modulo-tarefas .selo.pausada {
  background: #F0F0F0;
  color: #777777;
}


/* ==========================================================
   12. FILTROS
========================================================== */

.modulo-tarefas .filtros {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 26px;
}

.modulo-tarefas .campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.modulo-tarefas .campo label {
  color: var(--texto);
  font-size: 13px;
  font-weight: 600;
}

.modulo-tarefas .campo input,
.modulo-tarefas .campo select,
.modulo-tarefas .campo textarea {
  display: block;
  width: 100%;
  min-height: 42px;

  padding: 11px 13px;

  border: 1px solid #D9D9D2;
  border-radius: 8px;
  outline: 0;

  background: var(--branco);
  color: var(--texto);
  font-size: 14px;
  line-height: 1.5;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.modulo-tarefas .campo textarea {
  min-height: 110px;
  resize: vertical;
}

.modulo-tarefas .campo input:focus,
.modulo-tarefas .campo select:focus,
.modulo-tarefas .campo textarea:focus {
  border-color: var(--oliva);
  box-shadow: 0 0 0 3px rgba(168, 183, 122, 0.22);
}


/* ==========================================================
   13. TABELAS
========================================================== */

.modulo-tarefas .tabela-container {
  width: 100%;
  overflow-x: auto;

  border: 1px solid #EBE8E0;
  border-radius: 10px;
}

.modulo-tarefas table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  background: var(--branco);
}

.modulo-tarefas th {
  padding: 16px 14px;

  background: #F5F2EB;
  color: var(--oliva);

  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
}

.modulo-tarefas td {
  padding: 16px 14px;

  border-bottom: 1px solid #EBE9E2;
  color: var(--texto);

  font-size: 13px;
  line-height: 1.5;
  vertical-align: middle;
}

.modulo-tarefas tbody tr:last-child td {
  border-bottom: 0;
}

.modulo-tarefas tbody tr:hover {
  background: #FCFBF8;
}

.modulo-tarefas td:last-child {
  white-space: nowrap;
}

.modulo-tarefas td:last-child .botao {
  min-height: 32px;
  margin: 2px 2px 2px 0;
  padding: 7px 11px;

  font-size: 12px;
  white-space: nowrap;
}

.modulo-tarefas .vazio {
  padding: 28px 16px;

  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}


/* ==========================================================
   14. PROGRESSO DO DIA
========================================================== */

.modulo-tarefas .progresso {
  height: 10px;
  margin: 16px 0 13px;

  overflow: hidden;

  background: #E9EEE4;
  border-radius: 30px;
}

.modulo-tarefas .progresso-barra {
  width: 0%;
  height: 100%;

  background: var(--oliva);
  border-radius: 30px;

  transition: width 0.3s ease;
}

.modulo-tarefas .progresso-texto {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}


/* ==========================================================
   15. MODAIS
========================================================== */

.modulo-tarefas .modal-fundo {
  display: none;

  position: fixed;
  inset: 0;
  z-index: 1000;

  align-items: center;
  justify-content: center;

  padding: 20px;
  overflow-y: auto;

  background: rgba(25, 30, 20, 0.58);
}

/* Mantém o comportamento do JavaScript */

.modulo-tarefas .modal-fundo.aberto {
  display: flex;
}

.modulo-tarefas .modal {
  width: 100%;
  max-width: 700px;
  max-height: calc(100vh - 40px);

  margin: auto;
  padding: 30px;

  overflow-y: auto;

  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 16px;

  box-shadow: 0 20px 70px rgba(40, 48, 39, 0.20);
}


/* ==========================================================
   16. CABEÇALHO DOS MODAIS
========================================================== */

.modulo-tarefas .modal-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 26px;
  padding-bottom: 18px;

  border-bottom: 1px solid var(--borda);
}

.modulo-tarefas .modal-topo h2 {
  margin: 0;
  padding-left: 13px;

  border-left: 4px solid var(--terracota);

  color: var(--oliva);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
}

.modulo-tarefas .fechar-modal {
  flex-shrink: 0;

  min-width: 36px;
  min-height: 36px;
  padding: 3px 9px;

  border: 0;
  border-radius: 8px;

  background: #F5F2EB;
  color: var(--oliva);

  font-size: 25px;
  line-height: 1;
}

.modulo-tarefas .fechar-modal:hover {
  background: var(--areia);
  color: var(--terracota);
}


/* ==========================================================
   17. FORMULÁRIOS DOS MODAIS
========================================================== */

.modulo-tarefas .form-grade {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 21px 18px;
}

.modulo-tarefas .form-grade .largura-total {
  grid-column: 1 / -1;
}

.modulo-tarefas .modal .campo label {
  font-size: 14px;
  font-weight: 600;
}

.modulo-tarefas .modal .campo textarea {
  min-height: 116px;
  padding: 13px;
}

.modulo-tarefas .modal-acoes {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 28px;
  padding-top: 20px;

  border-top: 1px solid var(--borda);
}

.modulo-tarefas .modal-acoes .botao {
  min-height: 42px;
  padding: 11px 22px;
}


/* ==========================================================
   18. AVISOS
========================================================== */

.modulo-tarefas .aviso {
  padding: 18px 20px;

  border-left: 4px solid var(--pistache);
  border-radius: 0 9px 9px 0;

  background: #F3F5EE;
  color: var(--oliva);

  font-size: 13px;
  line-height: 1.75;
}


/* ==========================================================
   19. ELEMENTOS OCULTOS
   ESSENCIAL PARA O FUNCIONAMENTO
========================================================== */

.modulo-tarefas .oculto {
  display: none !important;
}


/* ==========================================================
   20. ACESSIBILIDADE
========================================================== */

.modulo-tarefas a:focus-visible,
.modulo-tarefas button:focus-visible {
  outline: 2px solid var(--terracota);
  outline-offset: 3px;
}


/* ==========================================================
   21. TELAS MÉDIAS
========================================================== */

@media (max-width: 1100px) {

  .modulo-tarefas .cabecalho {
    align-items: flex-start;
    flex-direction: column;
  }

  .modulo-tarefas .acoes-cabecalho {
    justify-content: flex-start;
  }

  .modulo-tarefas .indicadores {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modulo-tarefas .grade-dupla {
    grid-template-columns: 1fr;
  }

  .modulo-tarefas .filtros {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}


/* ==========================================================
   22. TABLETS
========================================================== */

@media (max-width: 700px) {

  .modulo-tarefas .pagina {
    padding: 24px 20px 50px;
  }

  .modulo-tarefas .card {
    padding: 22px;
  }

  .modulo-tarefas .modal {
    padding: 23px;
  }

  .modulo-tarefas .item {
    flex-direction: column;
  }

  .modulo-tarefas .item-acoes {
    width: 100%;
    justify-content: flex-start;
  }

}


/* ==========================================================
   23. CELULARES
========================================================== */

@media (max-width: 560px) {

  .modulo-tarefas .pagina {
    padding: 20px 16px 40px;
  }

  .modulo-tarefas .cabecalho h1 {
    font-size: 27px;
  }

  .modulo-tarefas .acoes-cabecalho {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .modulo-tarefas .acoes-cabecalho .botao {
    width: 100%;
  }

  .modulo-tarefas .indicadores {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modulo-tarefas .indicador {
    padding: 20px;
  }

  .modulo-tarefas .card {
    padding: 19px;
  }

  .modulo-tarefas .filtros {
    grid-template-columns: 1fr;
  }

  .modulo-tarefas .modal-fundo {
    padding: 12px;
  }

  .modulo-tarefas .modal {
    max-height: calc(100vh - 24px);
    padding: 19px;
  }

  .modulo-tarefas .form-grade {
    grid-template-columns: 1fr;
  }

  .modulo-tarefas .form-grade .largura-total {
    grid-column: auto;
  }

  .modulo-tarefas .modal-acoes {
    flex-direction: column;
    align-items: stretch;
  }

  .modulo-tarefas .modal-acoes .botao {
    width: 100%;
  }

  .modulo-tarefas .progresso-texto {
    flex-wrap: wrap;
  }

}
