/* ========================= 
   Layout base dos containers
   ========================= */
.project-panel {
  margin: 20px auto;
  padding: 20px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e6e0d8;
  border-radius: 12px;
  max-width: 1100px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.project-panel h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
}

/* =========================
   Seletores do projeto
   ========================= */
.project-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  align-items: flex-end;
}

.project-selectors label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
}

.project-selectors select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fafafa;
  transition: border-color 0.2s;
}

.project-selectors select:focus {
  border-color: var(--inst-color, #8a623f);
  outline: none;
}

/* =========================
   Áreas unificadas de botões
   ========================= */
.project-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.project-area .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.project-area .btn:hover {
  background: #f6f2ec;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.project-area .btn .icon {
  font-size: 1rem;
  line-height: 1;
}

/* Botão excluir */
.project-area .btn.danger,
.project-area #btnProjectDel {
  border-color: #c33;
  color: #c33;
}
.project-area .btn.danger:hover,
.project-area #btnProjectDel:hover {
  background: #fbeaea;
  color: #a00;
}

/* Estado do botão Cronograma */
#btnPlan[data-state="open"] {
  background: var(--inst-color, #8a623f);
  border-color: var(--inst-color, #8a623f);
  color: #fff;
}
#btnPlan[data-state="open"]:hover {
  background: #7a5637;
}
#btnPlan[data-state="close"] {
  background: transparent;
  border: 1px solid #bbb;
  color: #444;
}
#btnPlan[data-state="close"]:hover {
  background: #f0f0f0;
}

/* =========================
   Grid de dados
   ========================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.project-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 500;
  font-size: 0.9rem;
  color: #444;
  gap: 4px;
}

.project-grid input,
.project-grid select {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}

/* =========================
   Cronograma
   ========================= */
#planTable {
  margin-top: 12px;
  border-top: 1px solid #e8dfd1;
  padding-top: 12px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#planTable table {
  min-width: 480px;
  border-collapse: collapse;
}

#planTable th,
#planTable td {
  white-space: nowrap;
}

/* =========================
   Responsividade
   ========================= */
@media (max-width: 600px) {
  .project-selectors {
    flex-direction: column;
    align-items: stretch;
  }

  .project-area {
    justify-content: flex-start;
  }

  .project-area .btn {
    flex: 1 1 45%;
    min-width: 120px;
  }

  #planTable th,
  #planTable td {
    font-size: 0.8rem;
    padding: 6px 8px;
  }
}
