.tess-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tess-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.tess-header h2 {
  margin: 0;
  font-size: 1.6rem;
}

.tess-creditos {
  background: #f3f4f6;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tess-creditos-label {
  color: #6b7280;
  font-weight: 500;
}

.tess-creditos-valor {
  font-weight: 700;
  color: #1f2937;
  font-size: 1.1rem;
}

.tess-help {
  margin-bottom: 20px;
  color: #6b7280;
  font-size: 0.95rem;
}

.tess-field {
  margin-bottom: 15px;
}

.tess-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.tess-field input,
.tess-field textarea,
.tess-field select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

.tess-field textarea {
  resize: vertical;
  min-height: 60px;
}

.tess-actions {
  margin-top: 20px;
}

.tess-actions button {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tess-actions button:hover:not(:disabled) {
  background: #4338ca;
}

.tess-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tess-error {
  color: #dc2626;
  background: #fee2e2;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}

.tess-success {
  color: #059669;
  background: #d1fae5;
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}

.tess-success a {
  color: #047857;
  font-weight: 600;
  text-decoration: underline;
}

.tess-historico {
  margin-top: 40px;
}

.tess-historico h3 {
  margin-bottom: 10px;
}

.tess-historico table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tess-historico th,
.tess-historico td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
}

.tess-historico th {
  background: #f9fafb;
  font-weight: 600;
}

.tess-historico a {
  color: #2563eb;
  text-decoration: none;
}

.tess-historico a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .tess-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tess-creditos {
    width: 100%;
    justify-content: space-between;
  }
}

.tess-alert {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.tess-alert a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

/* Seletor de modo */
.tess-modo-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tess-modo-btn {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  color: #6b7280;
}

.tess-modo-btn:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.tess-modo-btn.ativo {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

/* Conteúdo do modo */
.tess-modo-content {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Tabela de planejamento */
.tess-planejamento-table {
  overflow-x: auto;
  margin-bottom: 10px;
}

.tess-planejamento-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.tess-planejamento-table th,
.tess-planejamento-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
}

.tess-planejamento-table th {
  background: #f3f4f6;
  font-weight: 600;
  text-align: left;
}

.tess-planejamento-table select,
.tess-planejamento-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.85rem;
}

.tess-planejamento-table select:focus,
.tess-planejamento-table input:focus {
  outline: none;
  border-color: #4f46e5;
}

.tess-btn-remove {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.tess-btn-remove:hover:not(:disabled) {
  background: #fecaca;
}

.tess-btn-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tess-btn-add {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.tess-btn-add:hover:not(:disabled) {
  background: #bfdbfe;
}

.tess-btn-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .tess-planejamento-table {
    font-size: 0.8rem;
  }
  
  .tess-planejamento-table th,
  .tess-planejamento-table td {
    padding: 4px;
  }
  
  .tess-planejamento-table select,
  .tess-planejamento-table input {
    font-size: 0.75rem;
    padding: 4px;
  }
}
